allow user to search from the start of @ file

This commit is contained in:
Mathew Pareles 2025-04-30 22:23:52 -07:00
parent a89934d7ad
commit 4ad286a030
2 changed files with 9 additions and 3 deletions

View file

@ -2589,12 +2589,12 @@ const CommandBarInChat = () => {
${isFinishedMakingFileChanges ? '' : 'opacity-0 pointer-events-none'}
`}
>
<JumpToFileButton
{/* <JumpToFileButton
uri={uri}
data-tooltip-id='void-tooltip'
data-tooltip-place='top'
data-tooltip-content='Go to file'
/>
/> */}
<IconShell1 // RejectAllButtonWrapper
Icon={X}
onClick={() => { editCodeService.acceptOrRejectAllDiffAreas({ uri, removeCtrlKs: true, behavior: "reject", _addToHistory: true, }); }}

View file

@ -312,6 +312,11 @@ const getOptionsAtPath = async (accessor: ReturnType<typeof useAccessor>, path:
if (generateNextOptionsAtPath) {
nextOptionsAtPath = await generateNextOptionsAtPath(optionText)
}
else if (path.length === 0 && optionText.trim().length > 0) { // (special case): directly search for both files and folders if optionsPath is empty and there's a search term
const filesResults = await searchForFilesOrFolders(optionText, 'files') || [];
const foldersResults = await searchForFilesOrFolders(optionText, 'folders') || [];
nextOptionsAtPath = [...foldersResults, ...filesResults,]
}
const optionsAtPath = nextOptionsAtPath
.filter(o => isSubsequence(o.fullName, optionText))
@ -367,7 +372,8 @@ export const VoidInputBox2 = forwardRef<HTMLTextAreaElement, InputBox2Props>(fun
const [didLoadInitialOptions, setDidLoadInitialOptions] = useState(false);
const currentPathRef = useRef<string>(JSON.stringify([]));
const areBreadcrumbsShowing = didLoadInitialOptions && optionPath.length >= 1;
// Show breadcrumbs when we have options loaded AND we're either at root level OR in a subfolder
const areBreadcrumbsShowing = true
const insertTextAtCursor = (text: string) => {