Per-route: Randomize/Re-roll button in EncounterModal picks a uniform
random pokemon from eligible (non-duped) encounters. Bulk: new
POST /runs/{run_id}/encounters/bulk-randomize endpoint fills all
remaining routes in order, respecting dupes clause cascading, pinwheel
zones, and route group locking. Frontend Randomize All button on the
run page triggers the bulk endpoint with a confirm dialog.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add items-start to the flex-col container so badge images respect
their intrinsic width instead of stretching to fill the container.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add a "Change Form" button in StatusChangeModal for Pokemon with
alternate forms sharing the same national_dex number. Mirrors the
existing evolution UI pattern, reusing currentPokemonId to track
the active form.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Ran --export to refresh seed JSON files with current database state.
Includes updated games, pokemon, routes/encounters, evolutions, and
new firered-bosses.json boss battle data.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replaces --export-bosses with a unified --export that dumps games,
pokemon, evolutions, routes/encounters, and bosses to seeds/data/.
Each export function mirrors the corresponding API export endpoint.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add seeder support for boss battles so new database instances come
pre-populated. Adds --export-bosses CLI flag to dump boss data from the
database to JSON seed files, and loads those files during normal seeding.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
EncounterModal and ShinyEncounterModal were calling useRoutePokemon
without a gameId, returning encounters for all games in the version
group. Now both receive and pass the run's gameId to scope results
to the current game only.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Routes and boss battles now belong to a version_group instead of
individual games, so paired versions (e.g. Red/Blue, Gold/Silver)
share the same route structure and boss battles. Route encounters
gain a game_id column to support game-specific encounter tables
within a shared route. Includes migration, updated seeds, API
changes, and frontend type updates.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Boss battle cards now collapse the pokemon team by default with a
chevron toggle. Expanded teams show larger sprites with "Lvl" prefix.
In hardcore mode, the BossDefeatModal hides the attempts field and
lost button since a loss ends the run.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Refactors AdminGameDetail to use tabs instead of stacked sections,
adds GET /export/games/{game_id}/bosses endpoint, and adds Export
button to the Boss Battles tab.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Introduces full boss battle system: data models (BossBattle, BossPokemon,
BossResult), API endpoints for CRUD and per-run defeat tracking, and frontend
UI including a sticky level cap bar with badge display on the run page,
interleaved boss battle cards in the encounter list, and an admin panel
section for managing boss battles and their pokemon teams.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Backend export endpoints return DB data in seed JSON format
(games, routes+encounters, pokemon, evolutions). Frontend
downloads the JSON via new Export buttons on each admin page.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fetches routes for the selected game during run creation and hides
the Pinwheel Clause option when no routes have pinwheel zone data.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sourced from Bulbapedia. 147 encounters across 20 zones, using walk
method with overworld spawn rates. Excludes fixed alphas and event-only
spawns. Pumpkaboo (Zone 15) omitted as it's not yet in pokemon.json.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move game/type labels from a fixed-width column into the bar itself so
long names like "Pokemon Brilliant Diamond" aren't truncated. Compute
luminance from the bar's hex color to pick dark or light text, with a
subtle text shadow for readability at bar/track boundaries.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add version group entry with region_id 0 (no PokeAPI region) and region
"lumiose". The Go fetch tool now skips route fetching for region_id 0 so
manually provided data won't be overwritten by re-runs. Includes
placeholder data file and box art.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Wrap the box art img in a div with the game color as background and
switch from object-cover to object-contain. This shows the full box art
without cropping, especially important for the taller Switch-era cases.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Try .png first, then .jpg, falling back to the color swatch only if
neither format exists for a game slug.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use local /boxart/{slug}.png images instead of database boxArtUrl with
color-swatch fallback. Add region filter pills and run-status checkboxes
(hide active/completed) to GameGrid. Move the Next button into a sticky
top bar showing selected game summary so it's always visible. Capitalize
region names in all display locations.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace inline typeColors maps in PokemonCard and StatusChangeModal
with a shared TypeBadge component that renders the type icon PNGs
from /types/{type}.png.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Dupes Clause greys out Pokemon in the encounter modal whose evolution
family has already been caught, preventing duplicate selections. Shiny
Clause adds a dedicated Shiny Box and lets shiny catches bypass the
one-per-route lock via a new is_shiny column on encounters and a
/pokemon/families endpoint that computes evolution family groups.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Implements a dedicated /stats page showing cross-run aggregate statistics:
run overview with win rate, runs by game bar chart, encounter breakdowns,
top caught/encountered pokemon rankings, mortality analysis with death
causes, and type distribution. Backend endpoint uses aggregate SQL queries
to avoid N+1 fetching.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Creates 6 runs across FireRed, Platinum, Emerald, HeartGold, Black, and
Crystal with mixed statuses (failed/completed/active), diverse encounter
states (caught/fainted/missed/evolved/dead), and varied rule configs.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Allows each sub-zone within a route group to have its own independent
encounter when the Pinwheel Clause rule is enabled (default on), instead
of the entire group sharing a single encounter.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Regional evolutions (e.g., Pikachu → Alolan Raichu) only occur in specific
regions. This adds a nullable region column so the app can filter evolutions
by the game's region. When a regional evolution exists for a given trigger/item,
the non-regional counterpart is automatically hidden.
Full-stack: migration, model, schemas, API with region query param, seeder,
Go fetch tool, frontend types/API/hook/components, and admin form.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add Go to .tool-versions, update .gitignore for Go build output and
cache, document seed data regeneration in README, and change API port
from 8000 to 8080 in docker-compose.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Updated all game JSON files with data from the new Go-based PokeAPI
fetcher. Includes corrected encounter data and form identification.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove fetch_pokeapi.py and special_encounters.py (now handled by the
Go tool) and add special_encounters.json as the new config source.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replaces the Python fetch_pokeapi.py script with a Go tool that crawls
a local PokeAPI instance and writes seed JSON files. Supports caching
and special encounter definitions via JSON config.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Skip games with null route data (Gen 8-9 have no PokeAPI encounters)
and silence SQLAlchemy echo unless --verbose/-v is passed.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Pokemon forms (e.g., Alolan Rattata) had their PokeAPI ID (10091) stored as
national_dex, causing them to display incorrectly. This renames the unique
identifier to pokeapi_id and adds a real national_dex field shared between
forms and their base species, so Alolan Rattata correctly shows as #19.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Moves ~850 lines of inline data from fetch_pokeapi.py into
version_groups.json and route_order.json for easier editing.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Pokemon forms with dex IDs >= 10000 (e.g., Alolan Rattata = 10091) were
being collected in encounter data but missing from pokemon.json, causing
them to be silently dropped during DB seeding. Now fetch_all_pokemon()
also fetches form entries that appear in encounter data, with clean
display names like "Rattata (Alola)" and correct form-specific types.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Merges the run dashboard into the encounters page as a unified view at /runs/:runId,
adds encounter method grouping in the modal and badges on route rows, improves the
home page with recent runs, adds mobile hamburger nav, and polishes empty states.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>