Skip to content

feat: game search / filter (#35) - #43

Merged
yanekyuk merged 6 commits into
nextfrom
feat/game-filter
Apr 3, 2026
Merged

feat: game search / filter (#35)#43
yanekyuk merged 6 commits into
nextfrom
feat/game-filter

Conversation

@yanekyuk

@yanekyuk yanekyuk commented Apr 3, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds live fuzzy-filter to the Main screen games list (/ to enter, Esc to clear)
  • Filter uses SkimMatcherV2 (case-insensitive, subsequence match) via fuzzy-matcher crate
  • Filter state persists across screen transitions; selection is preserved on Esc (translates filtered index back to full-list position)

Changes

  • App: filter_query, filter_mode fields + filtered_games() method; selected_game() and scroll_down() are now filter-aware
  • handle_main: branches on filter_mode — action keys blocked while filtering, / still navigate, Esc exits cleanly
  • draw_game_list: filter row (/ query▌) shown at top of GAMES block when active; list built from filtered_games()
  • Status bar swaps to filter hints when in filter mode
  • 8 unit tests added covering filter logic, selection, and scroll bounds

Test Plan

  • Press / — filter row appears, status bar changes to filter hints
  • Type partial name — list narrows in real time
  • Try fuzzy input (e.g. cs2 for Counter-Strike 2) — matches correctly
  • Press / — navigates filtered list; j/k type into filter
  • Navigate to a game via filter, press Esc — filter clears, full list restored, same game still selected
  • Navigate to another screen while filter is active, return — filter still applied
  • cargo test — all 63 tests pass

Implements #35

@yanekyuk
yanekyuk merged commit 155e6de into next Apr 3, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant