@@ -146,7 +227,6 @@ export const SidebarChat = () => {
// config state
const voidConfigState = useConfigState()
-
// threads state
const threadsState = useThreadsState()
const threadsStateService = useService('threadsStateService')
@@ -176,19 +256,33 @@ export const SidebarChat = () => {
if (isLoading) return
- const currSelns = threadsStateService.state._currentStagingSelections
+
+ const currSelns = threadsStateService.state._currentStagingSelections ?? []
const selections = !currSelns ? null : await Promise.all(
currSelns.map(async (sel) => ({ ...sel, content: await VSReadFile(modelService, sel.fileURI) }))
).then(
(files) => files.filter(file => file.content !== null) as CodeSelection[]
)
+
+ // // TODO don't save files to the thread history
+ // const selectedSnippets = currSelns.filter(sel => sel.selectionStr !== null)
+ // const selectedFiles = await Promise.all( // do not add these to the context history
+ // currSelns.filter(sel => sel.selectionStr === null)
+ // .map(async (sel) => ({ ...sel, content: await VSReadFile(modelService, sel.fileURI) }))
+ // ).then(
+ // (files) => files.filter(file => file.content !== null) as CodeSelection[]
+ // )
+ // const contextToSendToLLM = ''
+ // const contextToAddToHistory = ''
+
+
// add system message to chat history
const systemPromptElt: ChatMessage = { role: 'system', content: generateDiffInstructions }
threadsStateService.addMessageToCurrentThread(systemPromptElt)
- const userContent = userInstructionsStr(instructions, selections)
- const userHistoryElt: ChatMessage = { role: 'user', content: userContent, displayContent: instructions, selections }
+ // add user's message to chat history
+ const userHistoryElt: ChatMessage = { role: 'user', content: userInstructionsStr(instructions, selections), displayContent: instructions, selections: selections }
threadsStateService.addMessageToCurrentThread(userHistoryElt)
const currentThread = threadsStateService.getCurrentThread(threadsStateService.state) // the the instant state right now, don't wait for the React state
@@ -239,7 +333,7 @@ export const SidebarChat = () => {
}
const onAbort = () => {
- // abort the LLM
+ // abort the LLM call
if (latestRequestIdRef.current)
sendLLMMessageService.abort(latestRequestIdRef.current)
@@ -264,87 +358,84 @@ export const SidebarChat = () => {
{currentThread !== null && currentThread?.messages.map((message, i) =>
)}
+
{/* message stream */}
- {/* chatbar */}
-
- {/* selection */}
-
-
-
- {/* selections */}
- {(selections && selections.length !== 0) &&
-
-
}
- {/* error message */}
- {latestError === null ? null :
-
{ setLatestError(null) }}
- showDismiss={true}
- />}
+ {/* input box */}
+
+ {/* error message */}
+ {latestError === null ? null :
+
{ setLatestError(null) }}
+ showDismiss={true}
+ />
+ }
-
+
+ {/* middle row */}
+
+ {/* text input */}
+
+
+
+ {/* bottom row */}
+
+ {/* submit / stop button */}
+ {isLoading ?
+ // stop button
+
+ :
+ // submit button (up arrow)
+
+ }
+
+
+
+
+
+
+
>
}
diff --git a/src/vs/workbench/contrib/void/browser/react/tailwind.config.js b/src/vs/workbench/contrib/void/browser/react/tailwind.config.js
index 40d4257e..94923827 100644
--- a/src/vs/workbench/contrib/void/browser/react/tailwind.config.js
+++ b/src/vs/workbench/contrib/void/browser/react/tailwind.config.js
@@ -11,22 +11,98 @@ module.exports = {
colors: {
vscode: {
// see https://code.visualstudio.com/api/references/theme-color
- "sidebar-bg": "var(--vscode-sideBar-background)",
- "editor-bg": "var(--vscode-editor-background)",
- "editor-fg": "var(--vscode-editor-foreground)",
+
+ // base colors
+ "fg": "var(--vscode-foreground)",
+ "focus-border": "var(--vscode-focusBorder)",
+ "disabled-fg": "var(--vscode-disabledForeground)",
+ "widget-border": "var(--vscode-widget-border)",
+ "widget-shadow": "var(--vscode-widget-shadow)",
+ "selection-bg": "var(--vscode-selection-background)",
+ "description-fg": "var(--vscode-descriptionForeground)",
+ "error-fg": "var(--vscode-errorForeground)",
+ "icon-fg": "var(--vscode-icon-foreground)",
+ "sash-hover-border": "var(--vscode-sash-hoverBorder)",
+
+ // text colors
+ "text-blockquote-bg": "var(--vscode-textBlockQuote-background)",
+ "text-blockquote-border": "var(--vscode-textBlockQuote-border)",
+ "text-codeblock-bg": "var(--vscode-textCodeBlock-background)",
+ "text-link-active-fg": "var(--vscode-textLink-activeForeground)",
+ "text-link-fg": "var(--vscode-textLink-foreground)",
+ "text-preformat-fg": "var(--vscode-textPreformat-foreground)",
+ "text-preformat-bg": "var(--vscode-textPreformat-background)",
+ "text-separator-fg": "var(--vscode-textSeparator-foreground)",
+
+ // input colors
"input-bg": "var(--vscode-input-background)",
- "input-fg": "var(--vscode-input-foreground)",
"input-border": "var(--vscode-input-border)",
- "button-fg": "var(--vscode-button-foreground)",
+ "input-fg": "var(--vscode-input-foreground)",
+ "input-placeholder-fg": "input-var(--vscode-placeholderForeground)",
+ "input-active-bg": "inputOption-var(--vscode-activeBackground)",
+ "input-option-active-border": "inputOption-var(--vscode-activeBorder)",
+ "input-option-active-fg": "inputOption-var(--vscode-activeForeground)",
+ "input-option-hover-bg": "inputOption-var(--vscode-hoverBackground)",
+ "input-validation-error-bg": "inputValidation-var(--vscode-errorBackground)",
+ "input-validation-error-fg": "inputValidation-var(--vscode-errorForeground)",
+ "input-validation-error-border": "inputValidation-var(--vscode-errorBorder)",
+ "input-validation-info-bg": "inputValidation-var(--vscode-infoBackground)",
+ "input-validation-info-fg": "inputValidation-var(--vscode-infoForeground)",
+ "input-validation-info-border": "inputValidation-var(--vscode-infoBorder)",
+ "input-validation-warning-bg": "inputValidation-var(--vscode-warningBackground)",
+ "input-validation-warning-fg": "inputValidation-var(--vscode-warningForeground)",
+ "input-validation-warning-border": "inputValidation-var(--vscode-warningBorder)",
+
+ // badge colors
+ "badge-fg": "var(--vscode-badge-foreground)",
+ "badge-bg": "var(--vscode-badge-background)",
+
+ // button colors
"button-bg": "var(--vscode-button-background)",
- "button-hoverBg": "var(--vscode-button-hoverBackground)",
+ "button-fg": "var(--vscode-button-foreground)",
+ "button-border": "var(--vscode-button-border)",
+ "button-separator": "var(--vscode-button-separator)",
+ "button-hover-bg": "var(--vscode-button-hoverBackground)",
"button-secondary-fg": "var(--vscode-button-secondaryForeground)",
"button-secondary-bg": "var(--vscode-button-secondaryBackground)",
- "button-secondary-hoverBg": "var(--vscode-button-secondaryHoverBackground)",
- "dropdown-bg": "var(--vscode-settings-dropdownBackground)",
- "dropdown-foreground": "var(--vscode-settings-dropdownForeground)",
- "dropdown-border": "var(--vscode-settings-dropdownBorder)",
- "focus-border": "var(--vscode-focusBorder)",
+ "button-secondary-hover-bg": "var(--vscode-button-secondaryHoverBackground)",
+
+ // checkbox colors
+ "checkbox-bg": "var(--vscode-checkbox-background)",
+ "checkbox-fg": "var(--vscode-checkbox-foreground)",
+ "checkbox-border": "var(--vscode-checkbox-border)",
+ "checkbox-select-bg": "var(--vscode-checkbox-selectBackground)",
+
+
+ // sidebar colors
+ "sidebar-bg": "var(--vscode-sideBar-background)",
+ "sidebar-fg": "var(--vscode-sideBar-foreground)",
+ "sidebar-border": "var(--vscode-sideBar-border)",
+ "sidebar-drop-backdrop": "var(--vscode-sideBar-dropBackground)",
+ "sidebar-title-fg": "var(--vscode-sideBarTitle-foreground)",
+ "sidebar-header-bg": "var(--vscode-sideBarSectionHeader-background)",
+ "sidebar-header-fg": "var(--vscode-sideBarSectionHeader-foreground)",
+ "sidebar-header-border": "var(--vscode-sideBarSectionHeader-border)",
+ "sidebar-activitybartop-border": "var(--vscode-sideBarActivityBarTop-border)",
+ "sidebar-title-bg": "var(--vscode-sideBarTitle-background)",
+ "sidebar-title-border": "var(--vscode-sideBarTitle-border)",
+ "sidebar-stickyscroll-bg": "var(--vscode-sideBarStickyScroll-background)",
+ "sidebar-stickyscroll-border": "var(--vscode-sideBarStickyScroll-border)",
+ "sidebar-stickyscroll-shadow": "var(--vscode-sideBarStickyScroll-shadow)",
+
+
+ // other colors (these are partially complete)
+
+ // editor colors
+ "editor-bg": "var(--vscode-editor-background)",
+ "editor-fg": "var(--vscode-editor-foreground)",
+
+ // editorWidget colors
+ "editor-widget-fg": "var(--vscode-editorWidget-foreground)",
+ "editor-widget-bg": "var(--vscode-editorWidget-background)",
+ "editor-widget-border": "var(--vscode-editorWidget-border)",
+
+
},
},
},
diff --git a/src/vs/workbench/contrib/void/browser/registerThreads.ts b/src/vs/workbench/contrib/void/browser/registerThreads.ts
index d442668b..851b5de7 100644
--- a/src/vs/workbench/contrib/void/browser/registerThreads.ts
+++ b/src/vs/workbench/contrib/void/browser/registerThreads.ts
@@ -12,13 +12,13 @@ import { URI } from '../../../../base/common/uri.js';
import { Emitter, Event } from '../../../../base/common/event.js';
import { IAutocompleteService } from './registerAutocomplete.js';
-// if selectionStr is null, it means just send the whole file
export type CodeSelection = {
selectionStr: string | null;
fileURI: URI;
- content: string;
+ content: string; // TODO remove this
}
+// if selectionStr is null, it means to use the entire file at send time
export type CodeStagingSelection = {
selectionStr: string | null;
fileURI: URI;
@@ -29,14 +29,14 @@ export type CodeStagingSelection = {
export type ChatMessage =
| {
role: 'user';
- content: string | null; // content sent to the llm - yes, allowed to be '', will be replaced with (empty)
- displayContent: string | null; // content displayed to user - yes, allowed to be '', will be ignored
+ content: string | null; // content sent to the llm - allowed to be '', will be replaced with (empty)
+ displayContent: string | null; // content displayed to user - allowed to be '', will be ignored
selections: CodeSelection[] | null; // the user's selection
}
| {
role: 'assistant';
- content: string | null; // content received from LLM - yes, allowed to be '', will be replaced with (empty)
- displayContent: string | null; // content displayed to user (this is the same as content for now) - yes, allowed to be '', will be ignored
+ content: string | null; // content received from LLM - allowed to be '', will be replaced with (empty)
+ displayContent: string | null; // content displayed to user (this is the same as content for now) - allowed to be '', will be ignored
}
| {
role: 'system';