soroban-abacus-flashcards/apps/web/drizzle
Thomas Hallock b36df3a40c fix(worksheets): ten-frames not rendering in mastery mode
Fixed two critical bugs preventing ten-frames from rendering:

1. **Mastery mode not handled** (typstGenerator.ts:61)
   - Code only checked for 'smart' | 'manual' modes
   - Mastery mode fell into manual path, tried to use boolean flags that don't exist
   - Resulted in all display options being `undefined`
   - Fix: Check for both 'smart' OR 'mastery' modes (both use displayRules)

2. **Typst array membership syntax** (already fixed in previous commit)
   - Used `(i in array)` which doesn't work in Typst
   - Changed to `array.contains(i)`

Added comprehensive unit tests (tenFrames.test.ts):
- Problem analysis tests (regrouping detection)
- Display rule evaluation tests
- Full Typst template generation tests
- Mastery mode specific tests
- All 14 tests now passing

Added debug logging to trace display rules resolution:
- displayRules.ts: Shows rule evaluation per problem
- typstGenerator.ts: Shows enriched problems and Typst data
- Helps diagnose future issues

The issue was that mastery mode (which uses displayRules like smart mode)
was being treated as manual mode (which uses boolean flags), resulting in
undefined display options.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-10 10:06:27 -06:00
..
meta fix(worksheets): ten-frames not rendering in mastery mode 2025-11-10 10:06:27 -06:00
0000_third_carnage.sql
0001_friendly_stingray.sql
0002_loose_ultimatum.sql
0003_naive_reptil.sql
0004_shiny_madelyne_pryor.sql
0005_flimsy_squadron_sinister.sql feat: add database schema for room moderation and invitations 2025-10-13 11:22:02 -05:00
0005_jazzy_mimic.sql
0006_pretty_invaders.sql feat: add database schema for room moderation and invitations 2025-10-13 11:22:02 -05:00
0007_access_modes.sql feat: add room access modes and ownership transfer 2025-10-13 19:19:49 -05:00
0008_make_room_name_nullable.sql feat: improve room creation UX and add password support for share links 2025-10-14 07:09:22 -05:00
0009_add_display_password.sql fix(migrations): add migration 0009 for display_password column 2025-10-14 09:56:26 -05:00
0010_make_game_name_nullable.sql refactor: make game_name nullable to support in-room game selection 2025-10-14 11:30:27 -05:00
0011_add_room_game_configs.sql feat: add drizzle migration for room_game_configs table 2025-10-15 13:40:40 -05:00
0012_damp_mongoose.sql feat(abacus): add nativeAbacusNumbers setting to schema and UI 2025-10-31 20:44:16 -05:00
0013_add_player_stats.sql feat: add per-player stats tracking system 2025-11-03 10:53:54 -06:00
0013_conscious_firebird.sql fix(db): add statement-breakpoint to worksheet_settings migration 2025-11-06 08:26:09 -06:00
0014_remarkable_master_chief.sql fix(worksheets): remove foreign key constraint to support guest users 2025-11-06 08:26:09 -06:00
0015_early_pepper_potts.sql fix: correct GPT-5 API parameters and surface actual grading errors 2025-11-10 06:12:10 -06:00
0016_confused_the_enforcers.sql fix: correct GPT-5 API parameters and surface actual grading errors 2025-11-10 06:12:10 -06:00
0017_skinny_red_hulk.sql feat: add AI-powered worksheet grading with GPT-5 vision 2025-11-10 04:33:22 -06:00
0018_brief_red_wolf.sql feat: add AI-powered worksheet grading with GPT-5 vision 2025-11-10 04:33:22 -06:00
0019_broad_vance_astro.sql feat: add AI-powered worksheet grading with GPT-5 vision 2025-11-10 04:33:22 -06:00
0020_supreme_saracen.sql fix: correct GPT-5 API parameters and surface actual grading errors 2025-11-10 06:12:10 -06:00