Skip to content

feat(dex): add search, sorting, and filters to Pokédex and Catch Log - #329

Merged
chattymin merged 5 commits into
chattymin:mainfrom
KillianHzr:feat/dex-search-sort-filters
Sep 25, 2026
Merged

chattymin merged 5 commits into
chattymin:mainfrom
KillianHzr:feat/dex-search-sort-filters

Conversation

@KillianHzr

Copy link
Copy Markdown
Contributor

Summary

This PR introduces comprehensive search, sorting, and filtering capabilities to both the Pokédex grid and the Catch Log (Journal de captures) in the Collection tab:

  • Search Bar: Live search by Pokémon name (case- and diacritic-insensitive), Pokédex number (e.g. 25 or #25), and multilingual translations stored in saves. Includes a clear button (xmark.circle.fill).
  • Shiny Filter: Quick toggle button to filter species captured as shiny (in Pokédex) or individual shiny catches (in Catch Log), with clear visual highlight when active.
  • Sorting Options:
    • Pokédex: Number (Low to High - default), Number (High to Low), Name (A–Z), Name (Z–A), and Rarity (High to Low).
    • Catch Log: Most Recent (default, active companion pinned first), Oldest First, Number (Low to High), Number (High to Low), Name (A–Z), Name (Z–A), and Rarity (High to Low).
  • Empty State: Displays a friendly empty search result state with an icon, message, and a "Reset filters" button to quickly restore the full collection.
  • Localization: All UI copy and sort option labels are localized across all 7 supported languages (ko, en, ja, es, fr, pt, de).
  • Tests: Comprehensive unit tests covering search matching, sort orders, and filter combinations in DexSearchAndFilterTests.swift.

Type of change

  • Bug fix
  • New feature
  • Refactor / cleanup
  • Documentation
  • Other:

UI changes

Before After
The Pokédex grid only displayed species in fixed ascending numerical order without search, custom sorting, or shiny filtering. The Catch Log only displayed entries in chronological order. A compact toolbar sits below the Collection subtab picker with a search field, a shiny filter toggle, and a sort menu. When no matches are found, a clear empty state with a "Reset filters" button is shown. Cell sizes remain balanced within the 520pt fixed popover height.

Checklist

  • swift build and swift test pass locally
  • PR title and description are written in English
  • UI changes are described above (before/after — images optional)
  • No copyrighted assets, secrets, or private tooling references are committed (see CONTRIBUTING)
  • Tests were added or updated for this change

@chattymin chattymin left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make name search diacritic-insensitive as promised by the PR. Pokédex and Catch Log should share the same matcher using case-insensitive and diacritic-insensitive comparison, with a regression test such as matching . Please also rebase onto the current main branch.

@chattymin

Copy link
Copy Markdown
Owner

Clarification: the regression example above is Flabébé matching flabebe.

- Add search bar matching by species name, # ID, and multilingual names
- Add sorting options: Pokédex number asc/desc, name A-Z / Z-A, and rarity descending
- Add Catch Log sorting options: most recent / oldest first, number asc/desc, name, and rarity
- Add shiny-only filter toggle with visual indicator
- Add empty search results state with reset filters button
- Support all 7 application languages
- Add comprehensive unit test suite in DexSearchAndFilterTests
…n DexSearchAndFilterTests

- Initialize CompanionStore via encoded file to avoid private state setter access
- Use boolean comparison checks for ComparisonResult ordering
- Remove unused store instance in localization test
Pokédex and Catch Log each matched names with localizedCaseInsensitiveContains,
which keeps accents, so "flabebe" missed Flabébé. Both screens now use
DexSearchMatcher.
@KillianHzr
KillianHzr force-pushed the feat/dex-search-sort-filters branch from 6cf3484 to d7bfaf0 Compare September 24, 2026 06:35
@KillianHzr

Copy link
Copy Markdown
Contributor Author

@chattymin Done: rebased on main, and both screens now share one matcher that ignores case and accents. Added a test for Flabébé / flabebe.

@chattymin
chattymin merged commit ae7bd9d into chattymin:main Sep 25, 2026
2 checks passed
@chattymin

Copy link
Copy Markdown
Owner

Thank you for your contribution!

LuceteYang added a commit to LuceteYang/PikaTokenBar that referenced this pull request Sep 25, 2026
- New usage recap shots (en/ko/ja) rendered from the production RecapCard in
  ScreenshotGenTests, with Gen 1 graduates, plus a tour row in each README (chattymin#332).
- Pace-marker shots pick bar and percent colors with PaceTier like quotaRow does
  (chattymin#349); the pace row explains the six tiers.
- Settings shots gain automatic backup snapshots under Backup & Transfer (chattymin#330)
  and a per-account session key row under Advanced (chattymin#346); footer bumped to 1.9.0.
- "Also in the box" lists Pokedex search/filters (chattymin#329, chattymin#343) and save backups.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Strongorange added a commit to Strongorange/PokeTokenBar-windows that referenced this pull request Oct 19, 2026
Port macOS chattymin#329: a search box matching species names in every stored
language (case- and diacritic-insensitive, so 'flabebe' finds Flabebe)
plus Pokedex numbers with partial-digit matches ('25' finds chattymin#125); sort
options for the grid (number asc/desc, name, rarity) and the catch log
(most recent / oldest first with the raising row pinned, number, name,
rarity); and a shiny-only toggle whose fixed width keeps the row from
resizing when toggled (upstream chattymin#390). Empty search results show a
reset-filters button. DexQuery carries the one matcher and both sort
contracts; the engine rows now carry multilingual names for search.
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.

2 participants