Add randomize encounters feature (per-route + bulk)

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>
This commit is contained in:
2026-02-08 13:14:43 +01:00
parent 6779e3effa
commit 46f246028f
7 changed files with 349 additions and 7 deletions

View File

@@ -0,0 +1,24 @@
---
# nuzlocke-tracker-ymbd
title: Implement randomize encounters
status: completed
type: feature
priority: normal
created_at: 2026-02-08T12:12:09Z
updated_at: 2026-02-08T12:13:47Z
---
Add per-route Randomize button in EncounterModal and bulk Randomize All on RunEncounters page.
## Checklist
- [ ] Phase 1: Per-route randomize in EncounterModal.tsx
- [ ] Add pickRandomPokemon helper function
- [ ] Add Randomize/Re-roll button in Pokemon selection header
- [ ] Phase 2: Bulk randomize backend
- [ ] Add BulkRandomizeResponse schema in encounter.py
- [ ] Add POST /runs/{run_id}/encounters/bulk-randomize endpoint
- [ ] Phase 3: Bulk randomize frontend
- [ ] Add bulkRandomizeEncounters() API function
- [ ] Add useBulkRandomize() hook
- [ ] Add Randomize All button on RunEncounters page