Plan 08: File Browser And Fuzzy Search
Summary
Replace sample file entries with a read-only file browser for the selected thread working directory, including hidden file visibility, ignore rules, and fuzzy search.
Requirements
- Technical Requirements: File Browser, Right Tool Panel, Storage.
- Non-Functional Requirements: Performance, Responsiveness, Data Integrity.
- Testing Requirements: Unit Test Policy, Test Data.
Implementation
- Index files from the selected thread working directory without blocking the main UI thread.
- Use the current file-browser hidden-file setting when deciding whether hidden files are visible.
- Ignore heavy directories by default, including
.git,node_modules,dist,.build, and derived-data folders. The default ignore list lives in the YAML settings file seeded by Plan 02. - Add deterministic ranking: exact filename matches, prefix matches, then fuzzy path matches.
- Keep indexing read-only and never modify repository files.
- Add a SQLite migration for file-index metadata and durable cache entries. Cache entries are app-owned and may be shared by threads with the same canonical working directory, Git identity, ignore-rules fingerprint, and index schema version; they MUST remain safe to rebuild on demand.
Tests
- Unit tests for ignore-rule evaluation against the seeded default list.
- Unit tests for path normalization.
- Unit tests for fuzzy ranking order.
- Temporary-directory tests using deterministic fixture files, including hidden files.
- Migration test verifies the file-index metadata table initializes correctly on a fresh database and on an upgrade from the prior schema version.
Acceptance Criteria
- Files mode shows the selected thread working directory.
- Hidden file visibility follows the current file-browser setting.
- Heavy ignored directories are skipped per the JSON-config default list.
- File search returns exact filename matches before prefix matches and fuzzy path matches.
- File indexing does not block primary UI state changes.
- File indexing is read-only.
- File-index metadata and cache entries persist across app relaunch and are safe to rebuild from scratch.
scripts/build.shpasses.scripts/test.shpasses with file browser and fuzzy search coverage.