Skip to content

feat: add a Pokédex tab, and fix the learnsets it exposed - #11

Merged
TechLuddite merged 1 commit into
mainfrom
claude/pokedex-details-section-atfxd8
Aug 8, 2026
Merged

TechLuddite merged 1 commit into
mainfrom
claude/pokedex-details-section-atfxd8

Conversation

@TechLuddite

Copy link
Copy Markdown
Owner

Joseph asked for a Pokédex section — full details, a decent sized picture, a bio if we're sure the data is canonical, and inline link buttons on the Stats page to jump straight there.

The Pokédex tab

One Pokémon at a time, picture first:

  • Official artwork in its own inset LCD panel, not the 96px battle sprite.
  • The bio, quoted from the games, with the game named underneath it — "From the Pokédex in Pokémon Shield". That attribution is the whole reason it's safe to show: nothing on the page is something we wrote about a Pokémon, it's either the game's own words or a number out of the dex.
  • Vital statistics — height, weight, gender split, catch rate with a word on which end of the scale that is, egg groups, egg cycles, growth rate, generation.
  • Abilities with what each one actually does, hidden ones marked, and a quiet "not in the sim yet" tag where the Battle tab doesn't model it — same honesty rule the ability picker already follows.
  • Base stats and defensive type matchups, with 4× and ¼× shown properly, and a note that abilities change them in a real battle.
  • The evolution line and what each step takes. Every route is kept where there's more than one ("Level up near a special rock or Use a Leaf Stone"), and each stage is clickable.
  • Every move it can learn, toggling between the order it learns them as it levels up and the whole list, with a search box.

Stats → Pokédex

An inline icon button sits beside every name in the Stats table and in the expanded card. It stops the click from also expanding the row, and it carries a counter alongside the id so pressing the same link twice still moves the Pokédex.

The bug this turned up

Baking the level-up data meant working out which game a learnset comes from, and the existing answer was wrong twice over:

  • PokéAPI's Japan-only Gen 1 re-releases were added to the API years late and carry version-group ids above Scarlet/Violet. Ranked on id they won "latest game" for most of Gen 1. Mewtwo had 43 moves, all from Red and Blue — Barrier, Bide, Skull Bash. Bulbasaur had 23. 187 Pokémon were stranded like that.
  • The Legends games and battle-only spin-offs have the opposite problem: full entries, tiny move pools. In Legends: Arceus a Zubat knows seven moves and there are no TMs at all.

scripts/version-groups.mjs now holds the main-series list with the reason each exclusion is there, and both bakes import it, so a move's level and the learnset it sits in always come from the same game. Mewtwo is on 102 moves, Bulbasaur on 48.

Only learnsets moved in pokedex.json — 444 entries changed, 0 stats, types, abilities, names or sprites. 93 shrank, all Pokémon that had been drawing their moves from a battle-only spin-off; what's left is what they can actually learn in Scarlet/Violet. There's a changelog line saying so, because Machamp losing 18 options is the kind of thing Joseph notices.

Data

npm run refresh-species (scripts/build-species.mjs) writes src/data/species.json and src/data/abilities.json, committed like the rest — still nothing fetched at runtime. LIMIT=20 runs it over a slice for a quick check. The bake asserts the artwork URL it builds matches the one PokéAPI reports, so a moved path fails there rather than on a phone. All 1025 Pokémon came back with artwork and a modern-game bio.

Tests

npm run test:run — 353 pass (up from 314).

  • src/lib/dex.test.js — matchup multipliers, unit conversions, gender, evolution steps, learnset splitting. Values derived by hand from the type chart, same as battle.test.js.
  • src/data/species.test.js — guards the bake: every Pokémon covered, every bio present and naming its game, no raw Game Boy line breaks, evolution conditions readable and grammatical, every level pointing at a real move, artwork for everyone, and a regression check that Gen 1 isn't back on its Red/Blue learnset.

Verified in a real browser at desktop and phone widths — including that the new toggle style doesn't leak onto the battle screen's move buttons, which carry data-on on every slot.

npm run build is green and dist/CNAME survives.

🤖 Generated with Claude Code

https://claude.ai/code/session_01E63KHsTdwuRVEzKx7sBK1Y


Generated by Claude Code

Joseph asked for a section showing full Pokémon details with a decent
sized picture, and a way to jump straight there from the Stats tab.

The Pokédex tab (src/features/Dex.jsx) shows one Pokémon at a time:
official artwork, the Pokédex entry quoted from the games with the game
named underneath it, height/weight/gender/catch rate/egg groups, every
ability with what it does, base stats, defensive type matchups, the
evolution line with what each step takes, and the full learnset with a
"as it levels up" / "everything it can learn" toggle and a search.

Stats rows get an inline link button beside each name that opens that
Pokémon in the Pokédex.

The descriptive data is baked, not fetched: scripts/build-species.mjs
(npm run refresh-species) writes src/data/species.json and
abilities.json, same rule as the rest of the dex. The bio is stored
verbatim with the game it came from, because attribution is what makes
it safe to show.

Baking it surfaced a real bug in the existing learnsets. PokéAPI's
Japan-only Gen 1 re-releases were added to the API late and carry
version-group ids above Scarlet/Violet, so ranking on id made them
"latest" for most of Gen 1 — Mewtwo had 43 moves, all from Red and Blue,
and Bulbasaur had 23. 187 Pokémon were affected. The Legends games and
the battle-only spin-offs have the opposite problem: full entries, tiny
move pools. scripts/version-groups.mjs now holds the main-series list
and both bakes share it, so a move's level and the learnset it sits in
always come from the same game. Mewtwo is on 102 moves; only learnsets
changed in pokedex.json, no stats or types moved.

New tests: src/lib/dex.test.js (matchups, conversions, evolution steps,
learnset splitting — values derived by hand) and src/data/species.test.js
(guards the bake, including that every bio names its game).
@TechLuddite
TechLuddite merged commit 38fdd24 into main Aug 8, 2026
2 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.

2 participants