diff --git a/src/vs/workbench/contrib/void/browser/chatThreadService.ts b/src/vs/workbench/contrib/void/browser/chatThreadService.ts
index cf641fa6..e3024792 100644
--- a/src/vs/workbench/contrib/void/browser/chatThreadService.ts
+++ b/src/vs/workbench/contrib/void/browser/chatThreadService.ts
@@ -732,11 +732,10 @@ class ChatThreadService extends Disposable implements IChatThreadService {
}) {
// define helper functions so we can tell what's going on
+ // for now, do not recompute selections as we run (it seems to confuse tool-use models)
+ const selectionsStr = await chat_selectionsString(prevSelns, currSelns, this._voidModelService) // all the file CONTENTS or "selections" de-duped
+ const userMessageFullContent = chat_lastUserMessageWithFilesAdded(userMessageContent, selectionsStr) // full last message: user message + CONTENTS of all files
const getLatestMessages = async () => {
- // recompute files in last message
- const selectionsStr = await chat_selectionsString(prevSelns, currSelns, this._voidModelService) // all the file CONTENTS or "selections" de-duped
- const userMessageFullContent = chat_lastUserMessageWithFilesAdded(userMessageContent, selectionsStr) // full last message: user message + CONTENTS of all files
-
// replace last userMessage with userMessageFullContent (which contains all the files too)
const thread = this.state.allThreads[threadId]
const latestMessages = thread?.messages ?? []
diff --git a/src/vs/workbench/contrib/void/browser/react/src/void-command-bar-tsx/VoidCommandBar.tsx b/src/vs/workbench/contrib/void/browser/react/src/void-command-bar-tsx/VoidCommandBar.tsx
index 99cf9bc5..ca8437eb 100644
--- a/src/vs/workbench/contrib/void/browser/react/src/void-command-bar-tsx/VoidCommandBar.tsx
+++ b/src/vs/workbench/contrib/void/browser/react/src/void-command-bar-tsx/VoidCommandBar.tsx
@@ -15,8 +15,6 @@ import { VoidCommandBarProps } from '../../../voidCommandBarService.js';
export const VoidCommandBarMain = ({ uri, editor }: VoidCommandBarProps) => {
const isDark = useIsDark()
- if (uri?.scheme !== 'file') return null // don't show in editors that we made, they must be files
-
return
@@ -26,7 +24,6 @@ export const VoidCommandBarMain = ({ uri, editor }: VoidCommandBarProps) => {
-
const stepIdx = (currIdx: number | null, len: number, step: -1 | 1) => {
if (len === 0) return null
return ((currIdx ?? 0) + step + len) % len // for some reason, small negatives are kept negative. just add len to offset
@@ -45,6 +42,10 @@ const VoidCommandBar = ({ uri, editor }: VoidCommandBarProps) => {
const { state: commandBarState, sortedURIs: sortedCommandBarURIs } = useCommandBarState()
+ // useEffect(() => {
+ // console.log('MOUNTING!!!')
+ // }, [])
+
// latestUriIdx is used to remember place in leftRight
const _latestValidUriIdxRef = useRef
(null)
@@ -60,7 +61,19 @@ const VoidCommandBar = ({ uri, editor }: VoidCommandBarProps) => {
: _latestValidUriIdxRef.current < sortedCommandBarURIs.length ? _latestValidUriIdxRef.current
: null
+ // when change URI, scroll to the proper spot
+ useEffect(() => {
+ setTimeout(() => {
+ // check undefined
+ if (!uri) return
+ const s = commandBarService.stateOfURI[uri.fsPath]
+ if (!s) return
+ const { diffIdx } = s
+ goToDiffIdx(diffIdx ?? 0)
+ }, 50)
+ }, [uri, commandBarService])
+ if (uri?.scheme !== 'file') return null // don't show in editors that we made, they must be files
const getNextDiffIdx = (step: 1 | -1) => {
// check undefined
@@ -73,19 +86,19 @@ const VoidCommandBar = ({ uri, editor }: VoidCommandBarProps) => {
return nextDiffIdx
}
const goToDiffIdx = (idx: number | null) => {
+ if (idx === null) return
// check undefined
if (!uri) return
const s = commandBarState[uri.fsPath]
if (!s) return
const { sortedDiffIds } = s
// reveal
- if (idx !== null) {
- const diffid = sortedDiffIds[idx]
- const diff = editCodeService.diffOfId[diffid]
- const range = { startLineNumber: diff.startLine - 1, endLineNumber: diff.startLine - 1, startColumn: 1, endColumn: 1 };
- editor.revealRangeInCenter(range, ScrollType.Immediate)
- commandBarService.setDiffIdx(uri, idx)
- }
+ const diffid = sortedDiffIds[idx]
+ if (diffid === undefined) return
+ const diff = editCodeService.diffOfId[diffid]
+ if (!diff) return
+ editor.revealLineNearTop(diff.startLine, ScrollType.Immediate)
+ commandBarService.setDiffIdx(uri, idx)
}
const getNextUriIdx = (step: 1 | -1) => {
return stepIdx(uriIdxInStepper, sortedCommandBarURIs.length, step)
@@ -101,21 +114,6 @@ const VoidCommandBar = ({ uri, editor }: VoidCommandBarProps) => {
}
}
-
-
- // when change URI, scroll to the proper spot
- useEffect(() => {
- setTimeout(() => {
- // check undefined
- if (!uri) return
- const s = commandBarService.stateOfURI[uri.fsPath]
- if (!s) return
- const { diffIdx } = s
- goToDiffIdx(diffIdx)
- }, 50)
- }, [uri, commandBarService])
-
-
const currDiffIdx = uri ? commandBarState[uri.fsPath]?.diffIdx ?? null : null
const sortedDiffIds = uri ? commandBarState[uri.fsPath]?.sortedDiffIds ?? [] : []
const sortedDiffZoneIds = uri ? commandBarState[uri.fsPath]?.sortedDiffZoneIds ?? [] : []
@@ -140,8 +138,7 @@ const VoidCommandBar = ({ uri, editor }: VoidCommandBarProps) => {
className={`
size-6 rounded cursor-default
hover:bg-void-bg-1-alt
- --border border-void-border-3 focus:border-void-border-1
- `}
+ `}// --border border-void-border-3 focus:border-void-border-1
disabled={upDownDisabled}
onClick={() => { goToDiffIdx(prevDiffIdx) }}
onKeyDown={(e) => {
@@ -156,7 +153,6 @@ const VoidCommandBar = ({ uri, editor }: VoidCommandBarProps) => {
className={`
size-6 rounded cursor-default
hover:bg-void-bg-1-alt
- --border border-void-border-3 focus:border-void-border-1
`}
disabled={upDownDisabled}
onClick={() => { goToDiffIdx(nextDiffIdx) }}
@@ -172,7 +168,6 @@ const VoidCommandBar = ({ uri, editor }: VoidCommandBarProps) => {
className={`
size-6 rounded cursor-default
hover:bg-void-bg-1-alt
- --border border-void-border-3 focus:border-void-border-1
`}
disabled={leftRightDisabled}
onClick={() => goToURIIdx(prevURIIdx)}
@@ -188,7 +183,6 @@ const VoidCommandBar = ({ uri, editor }: VoidCommandBarProps) => {
className={`
size-6 rounded cursor-default
hover:bg-void-bg-1-alt
- --border border-void-border-3 focus:border-void-border-1
`}
disabled={leftRightDisabled}
onClick={() => goToURIIdx(nextURIIdx)}
@@ -218,7 +212,7 @@ const VoidCommandBar = ({ uri, editor }: VoidCommandBarProps) => {
if (!isADiffZoneInAnyFile) return null
const acceptAllButton = {
const rejectAllButton = {
// >x
//
- const leftRightUpDownButtons =
+ const leftRightUpDownButtons =
{/* Changes in file */}
- {isADiffZoneInThisFile &&
-
- {upButton}
- {downButton}
-
- {isADiffInThisFile ?
+
+ {downButton}
+ {upButton}
+
+ {isADiffInThisFile ?
`Diff ${(currDiffIdx ?? 0) + 1} of ${sortedDiffIds.length}`
: streamState === 'streaming' ?
'No changes yet'
: `No changes`
}
-
-
- }
+
+
+
{/* Files */}
- {
-
- {leftButton}
- {/*
*/}
- {rightButton}
- {/*
*/}
-
- {currFileIdx !== null ?
- `File ${currFileIdx + 1} of ${sortedCommandBarURIs.length}`
- : `${sortedCommandBarURIs.length} file${sortedCommandBarURIs.length === 1 ? '' : 's'} changed`
- }
-
-
- }
+
+ {leftButton}
+ {/*
*/}
+ {rightButton}
+ {/*
*/}
+
+ {currFileIdx !== null ?
+ `File ${currFileIdx + 1} of ${sortedCommandBarURIs.length}`
+ : `${sortedCommandBarURIs.length} file${sortedCommandBarURIs.length === 1 ? '' : 's'} changed`
+ }
+
+
- return
+ return
{showAcceptRejectAll && acceptRejectAllButtons}
{leftRightUpDownButtons}
diff --git a/src/vs/workbench/contrib/void/browser/voidCommandBarService.ts b/src/vs/workbench/contrib/void/browser/voidCommandBarService.ts
index 9fd0c654..4b298ac8 100644
--- a/src/vs/workbench/contrib/void/browser/voidCommandBarService.ts
+++ b/src/vs/workbench/contrib/void/browser/voidCommandBarService.ts
@@ -420,7 +420,7 @@ class AcceptRejectAllFloatingWidget extends Widget implements IOverlayWidget {
this._register(editor.onDidChangeModel((model) => {
const uri = model.newModelUrl
- res.rerender({ uri, editor })
+ res.rerender({ uri, editor } satisfies VoidCommandBarProps)
}))
});
diff --git a/src/vs/workbench/contrib/void/common/prompt/prompts.ts b/src/vs/workbench/contrib/void/common/prompt/prompts.ts
index aacc5627..b84d3af5 100644
--- a/src/vs/workbench/contrib/void/common/prompt/prompts.ts
+++ b/src/vs/workbench/contrib/void/common/prompt/prompts.ts
@@ -147,7 +147,7 @@ Here's an example of a good description:\n${editToolDescription}.`
export const chat_systemMessage = (workspaces: string[], runningTerminalIds: string[], mode: ChatMode) => `\
You are an expert coding ${mode === 'agent' ? 'agent' : 'assistant'} that runs in the Void code editor. Your job is \
${mode === 'agent' ? `to help the user develop, run, deploy, and make changes to their codebase. You should ALWAYS bring user's task to completion to the fullest extent possible, calling tools to make all necessary changes. Do not be lazy.`
- : mode === 'gather' ? `to search and understand their codebase by reading files and content and providing references to help with their query.`
+ : mode === 'gather' ? `to search and understand the user's codebase. You MUST use tools to read files and help the user understand the codebase, even if you were initially given files.`
: mode === 'normal' ? `to assist the user with their coding tasks.`
: ''}
You will be given instructions to follow from the user, \`INSTRUCTIONS\`. You may also be given a list of files that the user has specifically selected, \`SELECTIONS\`.