--- # nuzlocke-tracker-kz5g title: Genlocke creation wizard status: completed type: feature priority: normal created_at: 2026-02-09T07:42:10Z updated_at: 2026-02-09T08:23:53Z parent: nuzlocke-tracker-25mh blocking: - nuzlocke-tracker-x4p6 - nuzlocke-tracker-thbz --- Multi-step wizard UI for creating a new genlocke. This is the entry point for the entire genlocke feature. ## Steps ### Step 1: Name - User enters a name for the genlocke (e.g., "My First Genlocke") ### Step 2: Game Selection - Offer preset templates: - **True Genlocke** — slots for each region using original releases only - **Normal Genlocke** — slots for each region using the latest remake/enhanced version as the default pick - **Custom** — start with an empty list, add games freely - For preset templates, show one slot per region (Kanto, Johto, Hoenn, Sinnoh, Unova, Kalos, Alola, Galar, Paldea). Each slot shows available games for that region and lets the user pick one. - The user can add/remove/reorder legs after selecting a template. - Games are grouped by region (FireRed is a "Kanto" option, not "Gen 3"). ### Step 3: Rules - **Nuzlocke rules** — standard rules configuration (reuse existing `RulesConfiguration` component). Set once, applied to all legs. - **Genlocke rules** — Keep HoF (default) vs Retire HoF. Radio select. ### Step 4: Confirm & Start - Summary of the genlocke: name, legs in order, rules. - "Start Genlocke" button creates the Genlocke entity, all GenlockeLeg records, and auto-creates + starts the first NuzlockeRun. ## Backend - `POST /api/v1/genlockes` — Create a genlocke with all legs and rules in one request. Should create the Genlocke, GenlockeLeg records, and the first NuzlockeRun. - Needs the `Genlocke` and `GenlockeLeg` database models + migration. ## Frontend - New route: `/genlockes/new` - Multi-step form component with back/next navigation - Reuse `GameCard`/`GameGrid` components for game selection - Reuse `RulesConfiguration` for nuzlocke rules step ## Dependencies - Needs generation/region metadata to power the preset templates (see nuzlocke-tracker-glh8) ## Checklist - [x] Create `Genlocke` SQLAlchemy model (name, status, genlocke_rules JSONB, nuzlocke_rules JSONB, created_at) - [x] Create `GenlockeLeg` SQLAlchemy model (genlocke_id FK, run_id FK nullable, leg_order, game_id FK) - [x] Create Alembic migration for both new tables - [x] Create Pydantic schemas for genlocke creation request/response - [x] Implement `POST /api/v1/genlockes` endpoint (creates genlocke, legs, and first run) - [x] Build the multi-step wizard shell component with back/next navigation and step indicator - [x] Build Step 1: Name input - [x] Build Step 2: Preset template selector (True / Normal / Custom) with region-grouped game picker - [x] Build Step 3: Rules configuration (reuse `RulesConfiguration` + genlocke rules radio) - [x] Build Step 4: Confirmation summary with "Start Genlocke" action - [x] Add `/genlockes/new` route to the React Router config - [x] Add TypeScript types for genlocke API responses - [x] Wire up the wizard to call the create endpoint and redirect to the genlocke overview on success