mirror of
https://github.com/NanmiCoder/cc-haha
synced 2026-07-17 13:13:35 +08:00
Desktop @ file search was recursively walking the filesystem with a local skip list, which let Python and Node generated directories leak into results and diverged from CLI behavior. Route candidate discovery through the same git-first model: tracked files, untracked files with exclude-standard, and ripgrep fallback for non-git folders, then derive selectable directories from those candidates. Constraint: Desktop picker must select both files and directories without surfacing ignored project artifacts. Constraint: No new dependencies; reuse the existing git, ripgrep, settings, and ignore utilities. Rejected: Maintain a hardcoded directory denylist | it would drift from CLI and miss project-specific ignore rules. Rejected: Full recursive readdir scanning | it ignores git index semantics and makes large dependency trees visible. Confidence: high Scope-risk: moderate Directive: Keep desktop @ file candidate discovery aligned with src/hooks/fileSuggestions.ts before changing ranking or ignore behavior. Tested: bun test src/server/__tests__/filesystem.test.ts Tested: cd desktop && bun run test -- FileSearchMenu.test.tsx ChatInput.test.tsx Tested: cd desktop && bun run lint && bun run test -- --run && bun run build Tested: bun run check:server Tested: bun run check:coverage Tested: bun run verify Not-tested: Native Windows/Linux manual UI smoke; path handling relies on cross-platform git/ripgrep wrappers and normalized relative paths.