Goal
Achieve near-zero latency search by reusing previous results when the query grows.
Description
Currently, every keystroke triggers a full re-scan of all packages. When a user types "gi" after "g", the new results are always a subset of the previous ones.
Implement incremental search:
- Cache the last search results along with the query that produced them
- If the new query is a prefix extension of the previous query (e.g.,
"g"→"gi"→"git"), run the fuzzy scorer only against the previous result set instead of all packages
- If the new query diverges (different prefix or shorter than previous), fall back to full re-scan
This optimization should be transparent to the rest of the app. The logic lives in src/ui/app.rs where searches are dispatched.
Tech
Rust, Algorithms (prefix detection, incremental filtering)
Difficulty
Level 3 – Advanced
Goal
Achieve near-zero latency search by reusing previous results when the query grows.
Description
Currently, every keystroke triggers a full re-scan of all packages. When a user types
"gi"after"g", the new results are always a subset of the previous ones.Implement incremental search:
"g"→"gi"→"git"), run the fuzzy scorer only against the previous result set instead of all packagesThis optimization should be transparent to the rest of the app. The logic lives in
src/ui/app.rswhere searches are dispatched.Tech
Rust, Algorithms (prefix detection, incremental filtering)
Difficulty
Level 3 – Advanced