diff --git a/src/vs/workbench/contrib/void/browser/prompt/prompts.ts b/src/vs/workbench/contrib/void/browser/prompt/prompts.ts index 8cf9fb0f..15d72af1 100644 --- a/src/vs/workbench/contrib/void/browser/prompt/prompts.ts +++ b/src/vs/workbench/contrib/void/browser/prompt/prompts.ts @@ -281,7 +281,7 @@ export const ctrlKStream_prefixAndSuffix = ({ fullFileStr, startLine, endLine }: const fullFileLines = fullFileStr.split('\n') // we can optimize this later - const MAX_CHARS = 1024 + const MAX_PREFIX_SUFFIX_CHARS = 20_000 /* a @@ -302,7 +302,7 @@ export const ctrlKStream_prefixAndSuffix = ({ fullFileStr, startLine, endLine }: // we'll include fullFileLines[i...(startLine-1)-1].join('\n') in the prefix. while (i !== 0) { const newLine = fullFileLines[i - 1] - if (newLine.length + 1 + prefix.length <= MAX_CHARS) { // +1 to include the \n + if (newLine.length + 1 + prefix.length <= MAX_PREFIX_SUFFIX_CHARS) { // +1 to include the \n prefix = `${newLine}\n${prefix}` i -= 1 } @@ -313,7 +313,7 @@ export const ctrlKStream_prefixAndSuffix = ({ fullFileStr, startLine, endLine }: let j = endLine - 1 while (j !== fullFileLines.length - 1) { const newLine = fullFileLines[j + 1] - if (newLine.length + 1 + suffix.length <= MAX_CHARS) { // +1 to include the \n + if (newLine.length + 1 + suffix.length <= MAX_PREFIX_SUFFIX_CHARS) { // +1 to include the \n suffix = `${suffix}\n${newLine}` j += 1 } diff --git a/src/vs/workbench/contrib/void/browser/react/src/sidebar-tsx/SidebarChat.tsx b/src/vs/workbench/contrib/void/browser/react/src/sidebar-tsx/SidebarChat.tsx index f7ea83d6..0d45f917 100644 --- a/src/vs/workbench/contrib/void/browser/react/src/sidebar-tsx/SidebarChat.tsx +++ b/src/vs/workbench/contrib/void/browser/react/src/sidebar-tsx/SidebarChat.tsx @@ -26,6 +26,7 @@ import { IModelService } from '../../../../../../../editor/common/services/model import { SidebarThreadSelector } from './SidebarThreadSelector.js'; import { useScrollbarStyles } from '../util/useScrollbarStyles.js'; import { VOID_CTRL_L_ACTION_ID } from '../../../actionIDs.js'; +import { X } from 'lucide-react'; const IconX = ({ size, className = '', ...props }: { size: number, className?: string } & React.SVGProps) => { @@ -277,7 +278,7 @@ export const SelectedFiles = ( return ( !!selections && selections.length !== 0 && (
{selections.map((selection, i) => { @@ -297,8 +298,7 @@ export const SelectedFiles = ( select-none bg-void-bg-3 hover:brightness-95 text-void-fg-1 text-xs text-nowrap - border border-void-border-2 rounded-xs - `} + border border-void-border-2 rounded-xs`} onClick={() => { // open the file if it is a file if (isThisSelectionAFile) { @@ -316,9 +316,7 @@ export const SelectedFiles = ( } }} > - + {/* file name */} {getBasename(selection.fileURI.fsPath)} {/* selection range */} @@ -337,25 +335,7 @@ export const SelectedFiles = ( }} > - - } - - {/* type of selection */} - {/* {selection.selectionStr !== null ? 'Selection' : 'File'} */} - {/* X button */} - {/* {type === 'staging' && // hoveredIdx === i - { - e.stopPropagation(); - if (type !== 'staging') return; - setStaging([...selections.slice(0, i), ...selections.slice(i + 1)]) - setSelectionIsOpened(o => [...o.slice(0, i), ...o.slice(i + 1)]) - }} - > - - - } */} - + }
{/* selection text */} {isThisSelectionOpened && @@ -376,6 +356,27 @@ export const SelectedFiles = ( ) })} + + + {type !== 'staging' || selections.length <= 1 ? null :
+ + {/* clear button */} + { setStaging([]) }} + + /> +
} + + ) )