Skip to content

Add evolution chain navigation with e/E keys - #6

Open
rae89 wants to merge 3 commits into
mainfrom
robert/add-evolution-chains
Open

Add evolution chain navigation with e/E keys#6
rae89 wants to merge 3 commits into
mainfrom
robert/add-evolution-chains

Conversation

@rae89

@rae89 rae89 commented Feb 8, 2026

Copy link
Copy Markdown
Owner

Summary

  • Decouple evolution chain fetching from load_detail so left/right arrow navigation stays fast — chain loads asynchronously after detail arrives
  • Add e/E keybindings to navigate forward/backward through the evolution chain with wrap-around
  • Add evolution_chain_species() helper to flatten chains (including branching ones like Eevee) into a navigable species list
  • Update detail view help text to show [←→] Nav and [e/E] Evo keybindings

Refactor

  • Extract duplicate capitalize() from 3 UI files into shared pub fn in ui/mod.rs
  • Consolidate filtered_list() and modal_filtered_list() via shared filter_pokemon_list(query) method
  • Have App::new() delegate to new_with_team_data() to eliminate 30 lines of duplicated field initialization
  • Add test_summary(), test_detail(), test_pokemon_list() test helpers to reduce boilerplate (~400 lines removed)
  • Simplify evolution chain test construction using make_chain() helper

Test plan

  • cargo build passes
  • cargo test — all 101 tests pass
  • cargo clippy — no warnings
  • Run TUI: Left/Right arrows navigate filtered list (same speed as before)
  • Run TUI: Press e on Bulbasaur → loads Ivysaur → e → Venusaur → e → wraps to Bulbasaur
  • Run TUI: Press E goes backward through the chain
  • Edge cases: single-stage Pokemon (e/E does nothing), Eevee (navigates through all eeveelutions)

🤖 Generated with Claude Code

… loading

Decouple evolution chain fetching from load_detail so left/right arrow
navigation stays fast. The chain now loads asynchronously after the detail
arrives. Add e/E keybindings to navigate forward/backward through the
evolution chain with wrap-around support.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
rae89 and others added 2 commits February 8, 2026 10:54
…ing and constructors, add test helpers

- Move duplicate capitalize() from 3 UI files to shared pub fn in ui/mod.rs
- Add filter_pokemon_list() to deduplicate filtered_list() and modal_filtered_list()
- Have App::new() delegate to new_with_team_data() to eliminate duplicated field init
- Add test_summary(), test_detail(), test_pokemon_list() helpers to reduce test boilerplate
- Simplify evolution chain test construction using make_chain()

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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