Files
nuzlocke-tracker/.beans/nuzlocke-tracker-94hx--add-sort-options-to-run-team-overview.md
Julian Tabel bc9bcf4c4b Add sort options to run team overview
Add a dropdown to sort Active Team and Graveyard by route order,
catch level, species name, or national dex number.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 12:11:54 +01:00

29 lines
1.4 KiB
Markdown

---
# nuzlocke-tracker-94hx
title: Add sort options to run team overview
status: completed
type: feature
priority: normal
created_at: 2026-02-09T10:03:49Z
updated_at: 2026-02-09T11:09:33Z
---
The Active Team / Final Team section on the run dashboard (`RunDashboard.tsx`) currently displays Pokemon in whatever order encounters arrive from the backend — there is no explicit sorting. Add a sort dropdown so the user can choose how their team is ordered.
## Sort options
- **Route order** (default) — sort by the route's `order` field, matching game progression
- **Catch level** — sort by `catchLevel`, ascending
- **Species name** — sort alphabetically by the display Pokemon's name (accounting for evolutions via `currentPokemon`)
- **National Dex** — sort by the display Pokemon's `nationalDex` number
## Scope
- Frontend-only change — all data is already available in the `EncounterDetail` objects
- Add a small sort control (dropdown or segmented buttons) above the team grid
- Persist the selected sort in component state (no need for localStorage)
- Apply the same sort options to both the Active Team and Graveyard sections
## Checklist
- [x] Add sort state and sort logic to `RunDashboard.tsx`
- [x] Add sort dropdown/control above the team grid
- [x] Apply sorting to both `alive` and `dead` encounter arrays
- [x] Verify sort works correctly with evolved Pokemon (use `currentPokemon ?? pokemon` for name/dex)