soroban-abacus-flashcards/apps/web/.claude
Thomas Hallock a769fe1e20 refactor: complete subtraction modularization - 793 lines → modular structure
Major refactoring milestone: Successfully modularized subtraction problem
rendering from a monolithic 360-line function into focused, composable components.

File size reduction:
- typstHelpers.ts: 793 lines → 356 lines (55% reduction)
- Subtraction function: 360 lines → distributed across 6 focused files

New modular structure:
├── subtraction/
│   ├── problemStack.ts (120 lines) - Main composition function
│   ├── borrowBoxes.ts (94 lines) - Borrow boxes with hints/arrows
│   ├── minuendRow.ts (96 lines) - Top number with scratch boxes
│   ├── subtrahendRow.ts (75 lines) - Bottom number with − sign
│   └── answerRow.ts (126 lines) - Line, ten-frames, answer boxes
└── index.ts - Re-exports for backward compatibility

Benefits achieved:
 No file exceeds 130 lines (was 793 lines)
 Each component has single, clear responsibility
 Easier to locate and edit specific features
 Centralized constants (TYPST_CONSTANTS)
 Better separation of concerns
 Backward compatibility maintained via re-exports

Implementation details:
- Updated typstHelpers.ts to re-export from modular structure
- Removed old 360-line generateSubtractionProblemStackFunction
- All imports remain unchanged (backward compatible)
- No functional changes - pure refactoring

Next phase:
- Extract addition components (carry boxes, addend rows)
- Validate output matches current worksheets byte-for-byte
- Add unit tests for individual components

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-08 09:20:18 -06:00
..
3D_PRINTING_DOCKER.md fix: prevent undefined displayRules error in worksheet generator 2025-11-07 13:01:54 -06:00
ARCADE_ARCHITECTURE.md fix: prevent undefined displayRules error in worksheet generator 2025-11-07 13:01:54 -06:00
ARCADE_ROUTING_ARCHITECTURE.md fix: prevent undefined displayRules error in worksheet generator 2025-11-07 13:01:54 -06:00
ARCADE_SETUP_PATTERN.md
BLOG_EXAMPLES_PATTERN.md fix: prevent undefined displayRules error in worksheet generator 2025-11-07 13:01:54 -06:00
CARD_SORTING_AUDIT.md fix: prevent undefined displayRules error in worksheet generator 2025-11-07 13:01:54 -06:00
CARD_SORTING_MULTIPLAYER_PLAN.md fix: prevent undefined displayRules error in worksheet generator 2025-11-07 13:01:54 -06:00
CARD_SORTING_SPECTATOR_UX.md fix: prevent undefined displayRules error in worksheet generator 2025-11-07 13:01:54 -06:00
CLAUDE.md fix: prevent undefined displayRules error in worksheet generator 2025-11-07 13:01:54 -06:00
CODE_QUALITY_REGIME.md
COMPLEMENT_RACE_ASSESSMENT.md fix: prevent undefined displayRules error in worksheet generator 2025-11-07 13:01:54 -06:00
COMPLEMENT_RACE_MIGRATION_PLAN.md fix: prevent undefined displayRules error in worksheet generator 2025-11-07 13:01:54 -06:00
COMPLEMENT_RACE_MULTIPLAYER_REVIEW.md fix: prevent undefined displayRules error in worksheet generator 2025-11-07 13:01:54 -06:00
COMPLEMENT_RACE_PROGRESS_SUMMARY.md fix: prevent undefined displayRules error in worksheet generator 2025-11-07 13:01:54 -06:00
COMPLEMENT_RACE_STATE_ADAPTER.md fix: prevent undefined displayRules error in worksheet generator 2025-11-07 13:01:54 -06:00
DEPLOYMENT.md fix: prevent undefined displayRules error in worksheet generator 2025-11-07 13:01:54 -06:00
EDUCATION_ROADMAP.md fix: prevent undefined displayRules error in worksheet generator 2025-11-07 13:01:54 -06:00
GAME_SETTINGS_PERSISTENCE.md fix: prevent undefined displayRules error in worksheet generator 2025-11-07 13:01:54 -06:00
GAME_SETTINGS_REFACTORING.md fix: prevent undefined displayRules error in worksheet generator 2025-11-07 13:01:54 -06:00
GAME_STATS_COMPARISON.md fix: prevent undefined displayRules error in worksheet generator 2025-11-07 13:01:54 -06:00
GAME_THEMES.md fix: prevent undefined displayRules error in worksheet generator 2025-11-07 13:01:54 -06:00
GOOGLE_CLASSROOM_SETUP.md fix: prevent undefined displayRules error in worksheet generator 2025-11-07 13:01:54 -06:00
MANUAL_MIGRATION_0011.md fix: prevent undefined displayRules error in worksheet generator 2025-11-07 13:01:54 -06:00
MATCHING_GAME_STATS_INTEGRATION.md fix: prevent undefined displayRules error in worksheet generator 2025-11-07 13:01:54 -06:00
PANDA_CSS_DYNAMIC_TOKENS.md fix: prevent undefined displayRules error in worksheet generator 2025-11-07 13:01:54 -06:00
PER_PLAYER_STATS_ARCHITECTURE.md fix: prevent undefined displayRules error in worksheet generator 2025-11-07 13:01:54 -06:00
PLATFORM_INTEGRATION_ROADMAP.md fix: prevent undefined displayRules error in worksheet generator 2025-11-07 13:01:54 -06:00
PLAYER_OWNERSHIP_CENTRALIZATION_PLAN.md
PLAYING_GUIDE_MODAL_SPEC.md fix: prevent undefined displayRules error in worksheet generator 2025-11-07 13:01:54 -06:00
THEME_AUDIT.md feat: implement light/dark theme system with semantic tokens 2025-11-07 16:47:04 -06:00
THEME_AUDIT_SUMMARY.txt feat: implement light/dark theme system with semantic tokens 2025-11-07 16:47:04 -06:00
THEME_IMPLEMENTATION_CHECKLIST.md feat: implement light/dark theme system with semantic tokens 2025-11-07 16:47:04 -06:00
THEME_IMPLEMENTATION_PLAN.md feat: implement light/dark theme system with semantic tokens 2025-11-07 16:47:04 -06:00
TUTORIAL_SYSTEM.md fix: prevent undefined displayRules error in worksheet generator 2025-11-07 13:01:54 -06:00
UI_STYLE_GUIDE.md fix: prevent undefined displayRules error in worksheet generator 2025-11-07 13:01:54 -06:00
Z_INDEX_MANAGEMENT.md fix: prevent undefined displayRules error in worksheet generator 2025-11-07 13:01:54 -06:00
settings.local.json refactor: complete subtraction modularization - 793 lines → modular structure 2025-11-08 09:20:18 -06:00