scope file search to current directory
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -104,7 +104,7 @@ export const useFileBrowserApp = (basePath: string, rootOverride?: string, initi
|
||||
setSearching(true);
|
||||
searchTimerRef.current = setTimeout(async () => {
|
||||
try {
|
||||
const data = await filesRef.current.search(q);
|
||||
const data = await filesRef.current.search(q, currentPath);
|
||||
setSearchResults(data.results);
|
||||
} catch {
|
||||
toast.error('Search failed');
|
||||
|
||||
@@ -24,8 +24,8 @@ export const useFilesAPI = (root: string = 'home') => {
|
||||
writeFile: (path: string, content: string) =>
|
||||
client.post(withRoot('/file-browser/write'), { path, content }),
|
||||
|
||||
search: (query: string) =>
|
||||
client.get<{ results: DirEntry[] }>(withRoot(`/file-browser/search?q=${encodeURIComponent(query)}`)),
|
||||
search: (query: string, path?: string) =>
|
||||
client.get<{ results: DirEntry[] }>(withRoot(`/file-browser/search?q=${encodeURIComponent(query)}${path ? `&path=${encodeURIComponent(path)}` : ''}`)),
|
||||
|
||||
copy: (sources: string[], destination: string) =>
|
||||
client.post(withRoot('/file-browser/copy'), {
|
||||
|
||||
Reference in New Issue
Block a user