Simplify file picker to show only git files with filtering

- Remove server file search API calls
- Only use git file status for file list
- Filter git files by search query on client side
- Add trailing / when inserting folder paths
- Simpler and faster implementation
- Respects gitignore (via git status)
This commit is contained in:
Shantur Rathore
2025-10-24 09:49:16 +01:00
parent fdd6c8d63b
commit f19add1c47
2 changed files with 5 additions and 48 deletions

View File

@@ -328,14 +328,13 @@ export default function PromptInput(props: PromptInputProps) {
if (pos !== null) {
const before = currentPrompt.substring(0, pos + 1)
const after = currentPrompt.substring(cursorPos)
const folderPath = path.slice(0, -1)
const newPrompt = before + folderPath + after
const newPrompt = before + path + after
setPrompt(newPrompt)
setFileSearchQuery(folderPath)
setFileSearchQuery(path)
setTimeout(() => {
if (textareaRef) {
const newCursorPos = pos + 1 + folderPath.length
const newCursorPos = pos + 1 + path.length
textareaRef.setSelectionRange(newCursorPos, newCursorPos)
textareaRef.style.height = "auto"
textareaRef.style.height = Math.min(textareaRef.scrollHeight, 200) + "px"