Commit Graph

2 Commits

Author SHA1 Message Date
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
Thomas Hallock
7a4a37ec6d feat: add comprehensive Storybook coverage and migration guide
- Add StandaloneBead.stories.tsx with 11 stories covering all use cases
  (icons, decorations, progress indicators, size/color variations)
- Add AbacusDisplayProvider.stories.tsx with 9 stories demonstrating
  context features, localStorage persistence, and configuration
- Add MIGRATION_GUIDE.md for useAbacusState → useAbacusPlaceStates
  with code examples, API comparison, and BigInt documentation
- Consolidate all test files to src/__tests__/ directory for consistency
- Fix vitest configuration ESM module issue (rename to .mts)

This improves discoverability, documentation, and developer experience
for the abacus-react component library.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-03 13:24:15 -06:00