soroban-abacus-flashcards/apps/web/docs
Thomas Hallock 7c33d0246f fix: prevent undefined displayRules error in worksheet generator
Fixes production error "Cannot read properties of undefined (reading 'carryBoxes')"
that occurred when users tried to adjust difficulty settings.

Root cause: displayRules was undefined for new users or users with old V1 config
in database. Difficulty adjustment buttons accessed displayRules.carryBoxes without
checking if displayRules existed first.

Changes:
- AdditionWorksheetClient: Initialize displayRules with defaults when missing
- ConfigPanel: Use null-coalescing operators instead of non-null assertions
- ConfigPanel: Add error logging when required fields are missing
- NEW: WorksheetErrorBoundary component to catch all errors in worksheet page
- page.tsx: Wrap client component with error boundary

This ensures users see helpful error messages instead of blank pages,
and never need to open the browser console to understand what went wrong.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-07 13:01:54 -06:00
..
ARCHITECTURAL_IMPROVEMENTS.md fix: prevent undefined displayRules error in worksheet generator 2025-11-07 13:01:54 -06:00
AUDIT_2_ARCHITECTURE_QUALITY.md fix: prevent undefined displayRules error in worksheet generator 2025-11-07 13:01:54 -06:00
AUDIT_MODULAR_GAME_SYSTEM.md fix: prevent undefined displayRules error in worksheet generator 2025-11-07 13:01:54 -06:00
FIXES-APPLIED.md fix: prevent database imports from being bundled into client code 2025-10-10 11:40:46 -05:00
GAME_MIGRATION_PLAYBOOK.md fix: prevent undefined displayRules error in worksheet generator 2025-11-07 13:01:54 -06:00
INCONSISTENCIES.md fix: prevent database imports from being bundled into client code 2025-10-10 11:40:46 -05:00
MATCHING_PAIRS_AUDIT.md fix: prevent undefined displayRules error in worksheet generator 2025-11-07 13:01:54 -06:00
MATCHING_PAIRS_MIGRATION_PLAN.md fix: prevent undefined displayRules error in worksheet generator 2025-11-07 13:01:54 -06:00
MEMORY_QUIZ_MIGRATION_PLAN.md fix: prevent undefined displayRules error in worksheet generator 2025-11-07 13:01:54 -06:00
MULTIPLAYER_SYNC_ARCHITECTURE.md fix: prevent database imports from being bundled into client code 2025-10-10 11:40:46 -05:00
arcade-game-architecture.md fix: prevent undefined displayRules error in worksheet generator 2025-11-07 13:01:54 -06:00
arcade-rooms-implementation-tasks.md fix: prevent database imports from being bundled into client code 2025-10-10 11:40:46 -05:00
arcade-rooms-technical-plan.md fix: prevent database imports from being bundled into client code 2025-10-10 11:40:46 -05:00
terminology-user-player-room.md fix: prevent database imports from being bundled into client code 2025-10-10 11:40:46 -05:00