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>
This commit is contained in:
Julian Tabel
2026-02-09 09:23:48 +01:00
parent aaaeb2146e
commit 7851e14c2f
18 changed files with 923 additions and 29 deletions

View File

@@ -73,11 +73,11 @@ A dedicated page showing:
7. **Gauntlet/Retire HoF rule** — Enforce the "retire" mechanic with cumulative dupe list
## Success Criteria
- [ ] A user can create a new genlocke via a multi-step wizard (name, game selection with presets, rules)
- [ ] Games can be selected using True Genlocke, Normal Genlocke, or Custom presets, grouped by region
- [ ] Nuzlocke rules are configured once and applied uniformly to all legs
- [ ] Genlocke-specific rules (Keep HoF / Retire HoF) can be selected
- [ ] The first leg starts automatically upon genlocke creation
- [x] A user can create a new genlocke via a multi-step wizard (name, game selection with presets, rules)
- [x] Games can be selected using True Genlocke, Normal Genlocke, or Custom presets, grouped by region
- [x] Nuzlocke rules are configured once and applied uniformly to all legs
- [x] Genlocke-specific rules (Keep HoF / Retire HoF) can be selected
- [x] The first leg starts automatically upon genlocke creation
- [ ] Each leg is a full nuzlocke run, tracked identically to standalone runs
- [ ] Completing a leg triggers a transfer step where surviving Pokemon can be carried forward
- [ ] Failing a leg marks the entire genlocke as failed

View File

@@ -1,11 +1,11 @@
---
# nuzlocke-tracker-glh8
title: Gather generation metadata (games, regions)
status: in-progress
status: completed
type: task
priority: normal
created_at: 2026-02-08T19:20:49Z
updated_at: 2026-02-09T08:05:52Z
updated_at: 2026-02-09T08:06:19Z
parent: nuzlocke-tracker-25mh
blocking:
- nuzlocke-tracker-kz5g

View File

@@ -1,11 +1,11 @@
---
# nuzlocke-tracker-kz5g
title: Genlocke creation wizard
status: todo
status: in-progress
type: feature
priority: normal
created_at: 2026-02-09T07:42:10Z
updated_at: 2026-02-09T07:45:34Z
updated_at: 2026-02-09T08:10:10Z
parent: nuzlocke-tracker-25mh
blocking:
- nuzlocke-tracker-x4p6
@@ -50,16 +50,16 @@ Multi-step wizard UI for creating a new genlocke. This is the entry point for th
- Needs generation/region metadata to power the preset templates (see nuzlocke-tracker-glh8)
## Checklist
- [ ] Create `Genlocke` SQLAlchemy model (name, status, genlocke_rules JSONB, nuzlocke_rules JSONB, created_at)
- [ ] Create `GenlockeLeg` SQLAlchemy model (genlocke_id FK, run_id FK nullable, leg_order, game_id FK)
- [ ] Create Alembic migration for both new tables
- [ ] Create Pydantic schemas for genlocke creation request/response
- [ ] Implement `POST /api/v1/genlockes` endpoint (creates genlocke, legs, and first run)
- [ ] Build the multi-step wizard shell component with back/next navigation and step indicator
- [ ] Build Step 1: Name input
- [ ] Build Step 2: Preset template selector (True / Normal / Custom) with region-grouped game picker
- [ ] Build Step 3: Rules configuration (reuse `RulesConfiguration` + genlocke rules radio)
- [ ] Build Step 4: Confirmation summary with "Start Genlocke" action
- [ ] Add `/genlockes/new` route to the React Router config
- [ ] Add TypeScript types for genlocke API responses
- [ ] Wire up the wizard to call the create endpoint and redirect to the genlocke overview on success
- [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