From 92fa1efefd302f44ce1682fb7d4a88d5f5daf272 Mon Sep 17 00:00:00 2001 From: Shantur Rathore Date: Fri, 24 Oct 2025 09:21:33 +0100 Subject: [PATCH] Fix @ to show all files using wildcard query - Use '.' as query instead of empty string for @ mention - Fuzzy search matches all files with '.' pattern - Filter out directories (paths ending with /) - Shows git files + all project files when typing @ --- src/components/file-picker.tsx | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/components/file-picker.tsx b/src/components/file-picker.tsx index cca668d1..f597c4be 100644 --- a/src/components/file-picker.tsx +++ b/src/components/file-picker.tsx @@ -100,8 +100,21 @@ const FilePicker: Component = (props) => { isGitFile: false, })) } else { - console.log(`[FilePicker] Empty query, showing only git files`) - searchFiles = [] + console.log(`[FilePicker] Empty query, fetching all files with wildcard`) + const searchResponse = await props.instanceClient.find.files({ + query: { query: "." }, + }) + const elapsed = Date.now() - startTime + + console.log(`[FilePicker] All files response received in ${elapsed}ms:`, searchResponse) + + searchFiles = (searchResponse?.data || []) + .filter((path: string) => !path.endsWith("/")) + .filter((path: string) => !gitFiles.some((gf) => gf.path === path)) + .map((path: string) => ({ + path, + isGitFile: false, + })) } const filteredGitFiles = searchQuery.trim()