Files
soroban-abacus-flashcards/apps/web
Thomas Hallock 186fa81b08 feat(worksheets): implement auto-save and load for worksheet settings
API Routes:
- GET /api/worksheets/settings?type=addition - Load user's saved config
- POST /api/worksheets/settings - Save current config (upsert)
- Uses parseAdditionConfig() for validation and migration
- Returns defaults if no saved settings exist

UI Integration:
- Load saved settings on mount (preserves derived state)
- Auto-save settings 1 second after changes (debounced)
- Only save after initial load completes (prevents overwriting on mount)
- Exclude transient fields (date, seed, rows, total) from persistence
- Show "Saving settings..." and "✓ Settings saved at HH:MM:SS" indicator

User Experience:
- Settings persist across sessions automatically
- New seed generated on each page load (fresh problems)
- Date field always starts empty (filled at generation time)
- Derived state (rows, total) recalculated from primary state

Technical Details:
- Type-safe with Zod validation
- Automatic schema migration (v1 → v2 when we add fields)
- Graceful fallback to defaults on errors
- 1s debounce prevents excessive saves during rapid changes

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-06 08:26:09 -06:00
..

Test deployment - Mon Nov 3 16:31:57 CST 2025