Commit Graph

139 Commits

Author SHA1 Message Date
Julian Tabel
d39898a7a1 Add run deletion guard to genlocke edge cases bean
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 10:52:21 +01:00
Julian Tabel
a81a17c485 Add genlocke admin panel with CRUD endpoints and UI
Backend: PATCH/DELETE genlocke, POST/DELETE legs with order
re-numbering. Frontend: admin list page with status filter,
detail page with inline editing, legs table, and stats display.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 10:51:47 +01:00
Julian Tabel
08f6857451 Add genlocke list and detail pages
Add GET /genlockes and GET /genlockes/{id} endpoints with aggregate
encounter/death stats per leg, and a frontend list page at /genlockes
plus a detail page at /genlockes/:genlockeId showing progress timeline,
cumulative stats, configuration, retired families, and quick actions.
Update nav link to point to the list page instead of /genlockes/new.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 10:39:59 +01:00
Julian Tabel
c7c66c76d3 Mark HoF team selection and genlocke retirement integration as completed
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 10:27:29 +01:00
Julian Tabel
056bef9f75 Scope genlocke retireHoF to HoF team instead of all alive Pokemon
advance_leg() now checks current_run.hof_encounter_ids first and only
retires those Pokemon and their families. Falls back to all alive
non-shiny Pokemon when no HoF team is selected (backwards compatible).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 10:26:49 +01:00
Julian Tabel
58d36c4433 Fix hooks order violation in RunEncounters
Move hofTeam useMemo before early returns to comply with Rules of Hooks.
It was placed after the loading/error guards, causing a "rendered more
hooks than during the previous render" crash.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 10:22:54 +01:00
Julian Tabel
08a5e5c621 Add Hall of Fame team selection for completed runs
After marking a run as completed, a modal prompts the player to select
which Pokemon (up to 6) entered the Hall of Fame. The selection is stored
as hof_encounter_ids on the run, displayed in the victory banner, and
can be edited later. This lays the foundation for scoping genlocke
retireHoF to only the actual HoF team.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 10:19:56 +01:00
Julian Tabel
89f46e2b12 Add HoF team selection and genlocke retirement integration beans
The current retireHoF logic retires all alive Pokemon instead of just
the HoF team. Add beans to track the fix: a general HoF team selection
feature for all runs, and a follow-up task to integrate it into genlocke
retirement logic.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 10:16:13 +01:00
Julian Tabel
48b56f9360 Implement Retire HoF (Gauntlet) rule enforcement for genlockes
When retireHoF is enabled, surviving HoF Pokemon and their evolutionary
families are retired at leg advancement and treated as duplicates in all
subsequent legs — both in the encounter modal and bulk randomize.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 10:05:03 +01:00
Julian Tabel
3ff132f284 Add genlocke edge cases tracking bean (draft)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 09:49:26 +01:00
Julian Tabel
07343e94e2 Add genlocke leg progression with advance endpoint and run context
When a run belonging to a genlocke is completed or failed, the genlocke
status updates accordingly. The run detail API now includes genlocke
context (leg order, total legs, genlocke name). A new advance endpoint
creates the next leg's run, and the frontend shows genlocke-aware UI
including a "Leg X of Y" banner, advance button, and contextual
messaging in the end-run modal.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 09:47:28 +01:00
Julian Tabel
96178622f9 Add genlocke admin management bean
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 09:38:39 +01:00
Julian Tabel
fa6f3c97d2 Add end-of-run condition rule bean, mark genlocke wizard completed
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 09:36:03 +01:00
Julian Tabel
7851e14c2f Add genlocke creation wizard with backend API and 4-step frontend
Implements the genlocke creation feature end-to-end: Genlocke and
GenlockeLeg models with migration, POST /genlockes endpoint that
creates the genlocke with all legs and auto-starts the first run,
and a 4-step wizard UI (Name, Select Games with preset templates,
Rules, Confirm) at /genlockes/new.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 09:33:37 +01:00
Julian Tabel
aaaeb2146e Add game category and region metadata for genlocke presets
Add `category` field (original/remake/enhanced/sequel/spinoff) to the
Game model and tag all 38 games. Create regions.json with generation
mapping, ordering, and genlocke preset defaults per region. Add
GET /games/by-region endpoint returning games grouped by region.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 09:06:15 +01:00
Julian Tabel
dab0cf986f Add soullink tracking epic (draft)
Multiplayer nuzlocke variant where players' Pokemon are linked in
pairs — if one dies, both die. Blocked by user authentication epic.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 08:57:42 +01:00
Julian Tabel
3a1aedda32 Refine genlocke epic with user flow, child features, and action items
Break down the genlocke tracking epic into 8 child beans with
checklists, dependency chains, and success criteria. Add CLAUDE.md
instruction for updating parent checklists on child completion.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 08:47:49 +01:00
6a36738b8b Update seed data and boss sprites from latest export
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 22:40:07 +01:00
58787460c4 Update seed data 2026-02-08 22:33:25 +01:00
2ff9e81cc4 Fix image export in container and skip already-local URLs
Mount frontend/public into the api container so the export can write
badge/sprite images. Skip re-downloading URLs that are already local
paths from a previous export.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 22:32:00 +01:00
35df9023f1 Add egg encounter logging with route-lock bypass
Egg hatches can now be logged at any location without consuming the
route's encounter slot. Adds an EggEncounterModal with pokemon search
and a "Log Egg" button on the run encounters page.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 22:25:47 +01:00
8bd4ad1ecf Download badge and boss sprite images locally during export
The seed export command now downloads badge images and boss sprites
from remote URLs and stores them in frontend/public/, rewriting the
JSON URLs to local paths. Sprites are namespaced by game version
(e.g. /boss-sprites/red/brock.png) so each generation can have
its own sprite style.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 22:13:30 +01:00
d2144e47bf Add bean for fetching and storing badge images locally
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 21:57:26 +01:00
dd277889fd Refine egg encounter logging bean
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 21:56:07 +01:00
803a1a0edf Add draft bean refinement instruction to CLAUDE.md
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 21:51:08 +01:00
41621cd993 Add bean lifecycle instructions to CLAUDE.md
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 21:50:13 +01:00
5ba464f37f Update bean statuses
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 21:48:26 +01:00
a2127f2126 Handle Nincada split evolution (Ninjask + Shedinja)
When evolving Nincada, a confirmation prompt now offers to also add
Shedinja as a new encounter on the same route. The Shedinja encounter
uses a "shed_evolution" origin to bypass route-locking.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 21:47:35 +01:00
fb0ad23c45 Update bean statuses
- nuzlocke-tracker-3el1: mark completed (run progression dividers)
- nuzlocke-tracker-66hg: mark completed (auto-select boss variant)
- nuzlocke-tracker-x8ol: mark completed (conditional boss teams)
- nuzlocke-tracker-igl3: change type to epic
- nuzlocke-tracker-jain: add new bean (Nincada split evolution)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 21:35:01 +01:00
512be228a2 Auto-select boss team variant based on starter choice
When a run has a starter Pokemon, automatically match its species name
against boss battle condition labels (e.g., "charmander" matches "Chose
Charmander"). If exactly one variant matches, pre-select it and hide the
pill selector. Falls back to showing pills when no match is found.

Fixes starter lookup to use game routes data (which has encounterMethods
populated) instead of the run detail route (which defaults to empty).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 21:33:28 +01:00
3de99859a1 Add bean for auto-selecting boss team variant based on starter choice
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 21:22:10 +01:00
a6bf8b4af2 Add conditional boss battle teams (variant teams by condition)
Wire up the existing condition_label column on boss_pokemon to support
variant teams throughout the UI. Boss battles can now have multiple team
configurations based on conditions (e.g., starter choice in Gen 1).

- Add condition_label to BossPokemonInput schema (frontend + backend bulk import)
- Rewrite BossTeamEditor with variant tabs (Default + named conditions)
- Add variant pill selector to BossDefeatModal team preview
- Add BossTeamPreview component to RunEncounters boss cards
- Fix MissingGreenlet error in set_boss_team via session.expunge_all()
- Fix PokemonSelector state bleed between tabs via composite React key
- Add Alembic migration for condition_label column

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 21:20:30 +01:00
8931424ef4 Update bean statuses and add wildcard Pokemon checklist item
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 20:34:07 +01:00
0931884f1e Add child route (sub-area) management to route detail page
Shows a sub-areas section below encounters with add/delete support
and links to navigate to child route details.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 20:32:17 +01:00
c6521dd206 Add filter controls to admin tables
Pokemon (type), Evolutions (trigger), Games (region/generation),
and Runs (status/game) now have dropdown filters alongside search.
Server-side filtering for paginated tables, client-side for small datasets.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 20:29:55 +01:00
5d444f0c91 Add bean for gathering generation metadata
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 20:21:26 +01:00
c3bbd365a9 Replace free-text encounter method input with dropdown selector
Use the predefined METHOD_ORDER/METHOD_CONFIG from EncounterMethodBadge
to populate a select dropdown with all known encounter methods plus an
"Other" option for custom values. Shows a colored badge preview on
selection. Correctly handles editing encounters with non-standard methods.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 20:19:16 +01:00
fb3b003a6d Mark randomize encounters bean as completed
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 20:14:45 +01:00
8f6d72a9c4 Add bulk import for evolutions, routes, and bosses
Add three new bulk import endpoints that accept the same JSON format as
their corresponding export endpoints, enabling round-trip compatibility:

- POST /evolutions/bulk-import (upsert by from/to pokemon pair)
- POST /games/{id}/routes/bulk-import (reuses seed loader for hierarchy)
- POST /games/{id}/bosses/bulk-import (reuses seed loader with team data)

Generalize BulkImportModal to support all entity types with configurable
title, example, and result labels. Wire up Bulk Import buttons on
AdminEvolutions, and AdminGameDetail routes/bosses tabs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 20:14:19 +01:00
8e1c8b554f Use PokemonSelector autocomplete for route encounter form
Replace the manual search input + select dropdown with the existing
PokemonSelector component, matching the boss team editor UX.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 20:04:26 +01:00
3d515f0e4e Add prev/next and dropdown route navigation to route detail page
Reduces navigation depth when working with route encounters by adding
prev/next buttons and a route dropdown selector to AdminRouteDetail.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 20:02:59 +01:00
b29b716fe5 Update Boss and Route data 2026-02-08 15:53:36 +01:00
758750b7b8 Add after_route_name to boss battle export/seed pipeline
Exports now include after_route_name (resolved from the route FK),
and the seed loader resolves it back to an ID on import. Also adds
a draft bean for displaying encounter-less locations.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 15:51:23 +01:00
47c8fa8e88 Update seed data with boss battles and route changes
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 15:40:07 +01:00
8483c4b109 Add specialty type column to admin bosses table
Shows the Pokemon type image badge in the boss battles table,
or an em-dash when no specialty is set.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 15:38:10 +01:00
0e4fac8790 Add optional specialty type field to boss battles
Gym leaders, Elite Four, and champions can now have a Pokemon type
specialty (e.g. Rock, Water). Shown as a type image badge on boss
cards in the run view, and editable via dropdown in the admin form.
Includes migration, export, and seed pipeline support.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 15:23:59 +01:00
1a7476f811 Add section field to boss battle export and seed pipeline
The section field was missing from the export endpoint, seed loader
(insert + upsert), and the seed export function.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 15:05:36 +01:00
1bf37a6bd9 Add drag-and-drop boss reordering and new feature beans
Adds boss battle reorder API endpoint with two-phase order update to
avoid unique constraint violations. Includes frontend mutation hook
and API client. Also adds draft beans for progression dividers and
conditional boss battle teams features.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 14:58:49 +01:00
a4f814e66e Add section field to boss battles for run progression dividers
Adds a nullable `section` column to boss battles (e.g. "Main Story",
"Endgame") with dividers rendered in the run view between sections.
Admin UI gets a Section column in the table and a text input in the form.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 14:55:26 +01:00
a01d01c565 Add Pokemon detail card with tabbed encounter/evolution views
Pokemon edit modal now shows three tabs (Details, Evolutions, Encounters)
instead of a single long form. Evolution chain entries are clickable to
open the EvolutionFormModal for direct editing. Encounter locations link
to admin route detail pages. Create mode shows only the form (no tabs).

Backend adds GET /pokemon/{id}/encounter-locations (grouped by game) and
GET /pokemon/{id}/evolution-chain (BFS family discovery). Extracts
formatEvolutionMethod to shared utility.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 14:03:43 +01:00