mirror of
https://github.com/NeuralNomadsAI/CodeNomad.git
synced 2026-07-10 00:14:27 +00:00
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 @
This commit is contained in:
parent
a667d1e232
commit
92fa1efefd
1 changed files with 15 additions and 2 deletions
|
|
@ -100,8 +100,21 @@ const FilePicker: Component<FilePickerProps> = (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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue