Commit Graph

226 Commits

Author SHA1 Message Date
Thomas Hallock
cd75df7221 chore: restore stashed work from previous session
Recover all changes from stash including:
- Linter/formatter updates across codebase
- Settings permission updates for git checkout

This commit captures the complete state of work that was
stashed during the previous session's git operations.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-08 14:59:40 -06:00
semantic-release-bot
11930b6328 chore(abacus-react): release v2.14.0 [skip ci]
# [2.14.0](https://github.com/antialias/soroban-abacus-flashcards/compare/abacus-react-v2.13.2...abacus-react-v2.14.0) (2025-11-08)

### Bug Fixes

* add light/dark mode support to tutorial tooltips and decomposition UI ([ea10249](ea10249e94))
* replace hardcoded colors with semantic tokens in HomeBlogSection ([e124096](e124096914))
* use semantic tokens for nav bar transparent mode on hero ([d05c6a8](d05c6a8664))
* **worksheets:** Add "Practice" difficulty profile for scaffolded regrouping mastery ([d23b606](d23b606642))
* **worksheets:** Fix subtraction regrouping frequency bug ([8d8e55d](8d8e55d5c4))

### Features

* add close button and theme support to mobile menu ([ea41b32](ea41b323d0))
* add function-based custom bead rendering and HTTP status code easter eggs ([fde5ae9](fde5ae9164))
* add theme support to abacus style dropdown ([2e294ee](2e294ee820))
* add theme support to config panel components ([c868421](c8684213fa))
* add theme support to desktop hamburger menu ([ab9272b](ab9272bee6))
* add theme support to MyAbacus button ([702c1c9](702c1c9af2))
* add theme support to orientation and generate panels ([e38775b](e38775b991))
* add theme support to worksheet page container ([5c14925](5c14925d7d))
* add theme support to worksheet preview ([693b679](693b679965))
* implement full-screen mobile hamburger menu with portal ([615cd28](615cd28829))
* implement two-column landscape layout with smart viewport-based flexbox ([b57458b](b57458b039))
* make mobile menu more responsive with larger touch targets ([3ad244f](3ad244f2d3))
* **worksheets:** filter operator-specific scaffolds from difficulty change descriptions ([cace1c7](cace1c75c6))
* **worksheets:** filter operator-specific scaffolds from preset summaries ([8407b07](8407b070f9))
* **worksheets:** integrate subtraction scaffolding into smart difficulty mode ([15bded1](15bded1ab8))
2025-11-08 20:30:28 +00:00
Thomas Hallock
fde5ae9164 feat: add function-based custom bead rendering and HTTP status code easter eggs
Add dynamic custom bead rendering system that allows beads to change appearance
based on their context (active state, position, place value, type, etc.).

Custom Bead Features:
- Add emoji-function, image-function, and svg-function types
- Functions receive CustomBeadContext with bead state and style info
- Support for dynamic rendering based on: active state, position, place value,
  bead type (heaven/earth), color, and size
- Enables creative visualizations like traffic lights, themed symbols, etc.

404 Page Easter Eggs:
- Create interactive 404 page with manipulable abacus
- Add 14 HTTP status code easter eggs (200, 201, 301, 400, 401, 403, 418,
  420, 451, 500, 503, 666, 777, 911)
- Each code triggers site-wide custom bead transformation
- Use function-based rendering for variety (different emojis per bead
  position/state)
- Easter eggs persist until page reload via global AbacusDisplayContext

Storybook Documentation:
- Add comprehensive custom bead stories showing static and function-based usage
- Include examples: active/inactive states, heaven/earth types, place value
  colors, traffic lights, color theming
- Document CustomBeadContext API and usage patterns

Technical Implementation:
- Extend CustomBeadContent union type in AbacusContext
- Update AbacusStaticBead and AbacusAnimatedBead to handle function types
- Pass bead context (type, value, active, position, placeValue, color, size)
  to custom render functions
- Maintain consistency across static (SSR) and animated (client) rendering

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-08 14:28:58 -06:00
semantic-release-bot
f01ef9479d chore(abacus-react): release v2.13.2 [skip ci]
## [2.13.2](https://github.com/antialias/soroban-abacus-flashcards/compare/abacus-react-v2.13.1...abacus-react-v2.13.2) (2025-11-08)

### Bug Fixes

* **abacus-react:** remove duplicate numeral rendering and fix dark mode colors ([fcbf0f5](fcbf0f5421))
2025-11-08 15:44:29 +00:00
Thomas Hallock
fcbf0f5421 fix(abacus-react): remove duplicate numeral rendering and fix dark mode colors
Two critical issues fixed:

1. **Duplicate numerals**: Both AbacusSVGRenderer and AbacusReact were rendering
   numerals when showNumbers={true}, causing two overlapping number displays.
   - Disabled SVG text numerals in AbacusSVGRenderer (line 436: added `false &&`)
   - NumberFlow provides better animated numerals, keep only those

2. **White numerals in dark mode**: NumberFlow components were inheriting CSS
   color from parent, turning white in dark mode (unreadable on light frames).
   - Added explicit color style to NumberFlow: uses themeAwareCustomStyles
   - Now consistently dark (rgba(0,0,0,0.8)) regardless of page theme

This was the root cause of the "white numerals everywhere" issue - the
NumberFlow components were inheriting dark mode CSS colors.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-08 09:43:18 -06:00
semantic-release-bot
a79a97a5b9 chore(abacus-react): release v2.13.1 [skip ci]
## [2.13.1](https://github.com/antialias/soroban-abacus-flashcards/compare/abacus-react-v2.13.0...abacus-react-v2.13.1) (2025-11-08)

### Bug Fixes

* **abacus-react:** showNumbers prop was hardcoded to false, breaking numeral display ([de89dcd](de89dcddb3))
2025-11-08 15:41:07 +00:00
Thomas Hallock
de89dcddb3 fix(abacus-react): showNumbers prop was hardcoded to false, breaking numeral display
Critical bug: AbacusReact was passing showNumbers={false} to AbacusSVGRenderer
regardless of the prop value, causing numerals to never be displayed.

Changed line 2315 from:
  showNumbers={false}
to:
  showNumbers={finalConfig.showNumbers}

This was preventing the automatic theme detection for numerals from working,
since numerals were never being rendered at all.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-08 09:39:56 -06:00
semantic-release-bot
195aff161b chore(abacus-react): release v2.13.0 [skip ci]
# [2.13.0](https://github.com/antialias/soroban-abacus-flashcards/compare/abacus-react-v2.12.0...abacus-react-v2.13.0) (2025-11-08)

### Bug Fixes

* add missing color definitions to example route ([bc7ca12](bc7ca12158))
* PDF generation now respects operator and digitRange settings ([8b8dfee](8b8dfeefbd))

### Features

* **abacus-react:** add comprehensive Storybook stories for automatic theme detection ([8ef57cc](8ef57ccec5))
2025-11-08 15:35:25 +00:00
Thomas Hallock
8ef57ccec5 feat(abacus-react): add comprehensive Storybook stories for automatic theme detection
Add new story file demonstrating the automatic theme detection feature:

- **AutomaticThemeDetection**: Interactive demo with light/dark toggle showing automatic numeral color adjustment
- **UseSystemThemeHook**: Demonstrates the useSystemTheme hook API and how it detects theme changes
- **ManualColorOverride**: Shows how custom numeral colors override automatic detection
- **NumeralsComparison**: Side-by-side comparison of abacus with/without numerals in both themes
- **EducationalAppExample**: Real-world example of a theme-aware math learning app

Each story includes:
- Interactive theme toggle controls
- Visual demonstrations of the feature
- Explanatory text and usage notes
- Theme-appropriate styling

The stories complement the README documentation by providing live,
interactive examples that users can experiment with in Storybook.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-08 09:34:15 -06:00
semantic-release-bot
09f6a1f0fd chore(abacus-react): release v2.12.0 [skip ci]
# [2.12.0](https://github.com/antialias/soroban-abacus-flashcards/compare/abacus-react-v2.11.0...abacus-react-v2.12.0) (2025-11-08)

### Bug Fixes

* add missing blog dependencies to package.json ([ceefb2f](ceefb2f1bd))
* arrow direction - go RIGHT to borrowed 10s box, not left ([fab1fb1](fab1fb10b7))
* disable place value colors in subtraction borrow boxes to fix arrow layering ([b4586ba](b4586bac8e))
* make borrow notation destination boxes full height ([17307f7](17307f7e82))
* position arrowhead at endpoint and increase size ([bdf28b2](bdf28b21b2))
* prevent undefined displayRules error in worksheet generator ([7c33d02](7c33d0246f))
* reduce borrowing hint font size from 0.5x to 0.25x ([f5d3de2](f5d3de2309))
* resolve TypeScript errors blocking Docker build ([a195338](a195338ba1))
* use curved Bezier path for borrow arrow ([9b4eb14](9b4eb14aaa))
* use dark gray for borrowing hints on colored backgrounds ([5cb346d](5cb346deee))
* use numeric cellSize for borrow box sizing in hints ([cc54176](cc54176cb1))
* **worksheets:** actually fix dropdown button height by constraining description area ([aa9052a](aa9052a49e))
* **worksheets:** Add operator to preview query key and update UI labels ([97ddc7e](97ddc7ee67))
* **worksheets:** add V4 fields to preview query key for cache invalidation ([d9b54a7](d9b54a736c))
* **worksheets:** align makeEasier fallback with spec priorities ([3e56e1d](3e56e1d6b6))
* **worksheets:** align makeHarder fallback with spec priorities ([a170209](a170209b2f))
* **worksheets:** correct findNearestPreset direction logic ([878cf02](878cf02511))
* **worksheets:** correct scaffolding summary to include all conditional modes ([2797038](2797038502))
* **worksheets:** dynamically size grid based on actual problem digits ([130bbd4](130bbd49dd))
* **worksheets:** increase color visibility for difficulty presets ([a7412ad](a7412adbee))
* **worksheets:** increase dropdown button height to fit all content lines ([3a43149](3a43149995))
* **worksheets:** Make destination borrow box more visible ([a01fa81](a01fa818b4))
* **worksheets:** persist digitRange and manualPreset in auto-save ([c874995](c87499535a))
* **worksheets:** prevent wrong preset showing as active at custom positions ([88e929e](88e929ed63))
* **worksheets:** Set showBorrowNotation to false for smart mode ([e9d52ba](e9d52bab49))
* **worksheets:** show ten-frames in smart mode when rule is 'always' ([0bc8272](0bc8272830))
* **worksheets:** update display options preview to use new problem-stack signature ([258b9ac](258b9ac1b4))
* **worksheets:** use fixed height instead of min-height for dropdown button ([fe1ef8a](fe1ef8a7fc))
* **worksheets:** use imperative voice for difficulty adjustment button labels ([d991512](d99151239d))
* **worksheets:** use white text on colored backgrounds for readability ([2b7b8ec](2b7b8ecc87))

### Features

* **abacus-react:** add automatic theme detection for numeral colors ([cbfd861](cbfd8618a9))
* add arrow from '1' in borrow hint pointing right ([b718994](b718994dab))
* add diagonal arrow from '1' to borrowed 10s box ([a9319c3](a9319c3bd8))
* add infrastructure for borrowing hints toggle ([74c6756](74c67566d2))
* add smooth curved arrow for borrowing hints ([112745c](112745ce16))
* **blog:** add "The Calculator Won" post on abacus education history ([8e04867](8e0486765a))
* **blog:** add navigation bar to blog pages ([6b4ed5d](6b4ed5d9dc))
* handle cascading borrows in borrowing hints ([3e1b51b](3e1b51bd84))
* implement borrowing hints arrow visualization ([b2f875c](b2f875c5a5))
* implement borrowing hints visual guidance ([89b8f98](89b8f98662))
* implement light/dark theme system with semantic tokens ([210a014](210a014699))
* optimize ten-frame blog examples for dark theme ([904701d](904701da2b))
* refactor borrow scaffolding into unified UI with column alignment ([41b5c05](41b5c057ed))
* **worksheets:** Add borrow notation scaffolding for subtraction ([ff161d4](ff161d4e30))
* **worksheets:** add color-coding to difficulty presets with interpolation ([b1201b8](b1201b83c0))
* **worksheets:** add difficulty preset dropdown for Smart mode ([49f6c02](49f6c029f6))
* **worksheets:** add interactive 2D difficulty map with hover preview ([b92b702](b92b702223))
* **worksheets:** add ModeSelector component for Smart/Manual mode switching ([4ffd47a](4ffd47a6b6))
* **worksheets:** add operator selection and subtraction problem generation ([ab87c6e](ab87c6ebe7))
* **worksheets:** add regrouping frequency controls to Manual mode ([f060692](f06069241f))
* **worksheets:** add subtraction problem analysis and implementation plan ([a7b48a2](a7b48a2879))
* **worksheets:** add V3 config schema with Smart/Manual mode discrimination ([cd1b3ed](cd1b3edc15))
* **worksheets:** add visual mode badges to scaffolding summary ([eaeeae4](eaeeae4ce8))
* **worksheets:** display scaffolding attributes on separate lines with fixed button height ([cc9fff7](cc9fff7733))
* **worksheets:** implement true RGB color interpolation for custom difficulty ([952cffa](952cffa2d1))
* **worksheets:** implement unique place value colors for 1-6 digit problems ([65e272c](65e272c570))
* **worksheets:** improve preset dropdown with descriptions and remove duplicate buttons ([852504a](852504a4fd))
* **worksheets:** make progressive difficulty available in both Smart and Manual modes ([54abd5d](54abd5de09))
* **worksheets:** Phase 10 - Add operator validation ([d93dfac](d93dfac461))
* **worksheets:** Phase 5 - Update typstGenerator for operator support ([b191bb9](b191bb9a82))
* **worksheets:** Phase 7 - Add operator to auto-save persistence ([01d0959](01d095942d))
* **worksheets:** Phase 8 - Update preview and example routes for operator ([0106068](010606848d))
* **worksheets:** Phase 9 - Update DisplayOptionsPreview for operator ([d5bbd78](d5bbd783b3))
* **worksheets:** reorganize orientation panel with Radix dropdown and compact layout ([f37960a](f37960aa94))
* **worksheets:** replace digit selector with Radix double-thumbed slider ([c0298cf](c0298cf65d))
* **worksheets:** show enabled scaffolding aids instead of numeric level ([0b8b0d2](0b8b0d21c5))
* **worksheets:** show nearest presets for custom difficulty configurations ([0e3f0ae](0e3f0aed94))
* **worksheets:** update validation and generation for V3 mode-aware schema ([ada9600](ada96005f5))
* **worksheets:** use more vibrant and distinct difficulty colors ([984b75c](984b75cb94))
* **worksheets:** use scaffolding summary for all preset descriptions ([23f0f1d](23f0f1dc21))

### Reverts

* remove all color-coding attempts for difficulty presets ([d52b2aa](d52b2aa4aa))
2025-11-08 15:30:30 +00:00
Thomas Hallock
cbfd8618a9 feat(abacus-react): add automatic theme detection for numeral colors
Implement Option 3: Make AbacusReact theme-aware to automatically
adjust numeral colors based on the document's theme.

**New Features:**
- Add `useSystemTheme` hook that detects theme from document root
  - Watches for `data-theme` attribute changes
  - Watches for `.light` / `.dark` class changes
  - Returns 'light' or 'dark' theme
  - SSR-safe with proper fallback

**Changes:**
- AbacusReact now automatically sets dark numeral color (rgba(0,0,0,0.8))
  as default when no custom color is provided
- Works on white/translucent abacus frames in both light/dark page themes
- Users can still override with custom `customStyles.numerals.color`
- Theme detection uses MutationObserver for automatic updates

**Exports:**
- Export `useSystemTheme` hook for consumer use
- Export `SystemTheme` type ('light' | 'dark')

**Benefits:**
- Numerals always visible regardless of page theme
- No manual coordination needed
- Works automatically with web app's ThemeContext
- Zero breaking changes (respects existing customStyles)

Fixes numeral visibility issue where white numerals appeared on
white abacus frames in dark mode.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-08 09:28:35 -06:00
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
semantic-release-bot
6cc5be7096 chore(abacus-react): release v2.11.0 [skip ci]
# [2.11.0](https://github.com/antialias/soroban-abacus-flashcards/compare/abacus-react-v2.10.1...abacus-react-v2.11.0) (2025-11-07)

### Bug Fixes

* **abacus-react:** include space for numbers in viewBox calculation ([1da3358](1da3358db1))
* **db:** add statement-breakpoint to worksheet_settings migration ([42e1a71](42e1a71292))
* **docker:** add libfuse2 and APPIMAGE_EXTRACT_AND_RUN for OpenSCAD extraction ([12490a7](12490a7083))
* **syntax:** correct div nesting and indentation in abacus page ([3c9ecca](3c9eccab78))
* **syntax:** remove emoji variation selector causing build error ([00aabd8](00aabd8e6b))
* **ui:** add wrapper div to prevent content from appearing under nav ([99f4dd5](99f4dd51e3))
* **worksheets:** only show ten-frames row for problems that need regrouping ([8f92f5a](8f92f5a57b))
* **worksheets:** remove foreign key constraint to support guest users ([e6e9ec3](e6e9ec3e4f))
* **worksheets:** resolve SSR URL error and guest user foreign key constraint ([42ea8d5](42ea8d561e))

### Features

* add API endpoint for live worksheet preview examples ([bef3a21](bef3a21442))
* add DisplayOptionsPreview component with debouncing ([6502da7](6502da7e37))
* **blog:** add blog pages and API endpoints ([1886ea0](1886ea0e73))
* **blog:** generate worksheet examples showing scaffolding progression ([b628a34](b628a34605))
* **create:** add worksheet creator card to hub page ([c84d712](c84d7122f3))
* **flashcards:** add live preview functionality ([b38bec8](b38bec814b))
* **homepage:** responsive 2-column layout with data attributes ([ad33056](ad33056b12))
* **i18n:** add translations for addition worksheet creator ([2bf645a](2bf645a30c))
* **i18n:** add worksheet translations for all languages ([6acd15a](6acd15aab8))
* replace static examples with live preview in display options ([4361ad3](4361ad3005))
* **worksheets:** add customizable operands to preview ([21cda18](21cda181e4))
* **worksheets:** add diagonal-split pattern to carry boxes ([5b91809](5b9180916e))
* **worksheets:** add double-digit addition worksheet creator ([1a75213](1a75213df0))
* **worksheets:** add type-safe config persistence with schema versioning ([0406adc](0406adc9da))
* **worksheets:** enhance addition worksheets with ten-frames and refinements ([71ad300](71ad300c23))
* **worksheets:** generate discrete pages with precise sizing ([56c0227](56c0227e9f))
* **worksheets:** implement auto-save and load for worksheet settings ([186fa81](186fa81b08))
* **worksheets:** implement constrained 2D difficulty system with pedagogical zones ([c39b7f6](c39b7f6d3a))
* **worksheets:** improve difficulty controls and problem sizing ([aedeb45](aedeb456f1))
* **worksheets:** improve preview error reporting ([d8b4951](d8b4951d63))
* **worksheets:** pre-generate preview on server to eliminate loading flash ([02c9187](02c918713d))
* **worksheets:** redesign display options as toggle buttons ([ac3b749](ac3b749605))
* **worksheets:** simplify difficulty controls with collapsible regrouping pane ([bb363c0](bb363c0837))
* **worksheets:** update ConfigPanel with accurate page calculations ([2c0fbd9](2c0fbd9074))
2025-11-07 14:51:43 +00:00
Thomas Hallock
1da3358db1 fix(abacus-react): include space for numbers in viewBox calculation
When showNumbers is enabled, the SVG viewBox now includes the 40px space
needed for NumberFlow elements rendered below abacus columns.

Previously: Always passed showNumbers: false to calculateStandardDimensions
Now: Pass finalConfig.showNumbers to include numbers space when needed

This fixes overflow issues where numerals were cut off because the viewBox
height didn't account for them.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-07 08:49:41 -06:00
Thomas Hallock
2a1471056b chore: approve git fetch command in local settings
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-05 10:03:13 -06:00
semantic-release-bot
9bab0b49c3 chore(abacus-react): release v2.10.1 [skip ci]
## [2.10.1](https://github.com/antialias/soroban-abacus-flashcards/compare/abacus-react-v2.10.0...abacus-react-v2.10.1) (2025-11-05)

### Bug Fixes

* **i18n:** add nav bar to 3D abacus creator page ([827a949](827a949216))
2025-11-05 16:02:52 +00:00
Thomas Hallock
0c4b0c2fac style: fix formatting and add approved bash commands
- Add trailing comma in cropToActiveBeads config
- Format console.log call for better readability
- Format postMessage call parameters
- Add approved bash commands for icon testing to local settings

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-05 10:01:46 -06:00
semantic-release-bot
ac6c3c1376 chore(abacus-react): release v2.10.0 [skip ci]
# [2.10.0](https://github.com/antialias/soroban-abacus-flashcards/compare/abacus-react-v2.9.0...abacus-react-v2.10.0) (2025-11-05)

### Bug Fixes

* replace regex HTML parsing with deterministic bead position calculations in icon generation ([41a3707](41a3707841))

### Features

* add cropToActiveBeads prop to AbacusStatic and AbacusReact ([35b0824](35b0824fc4))
* **calendar:** add beautiful daily calendar with locale-based paper size detection ([bdca315](bdca3154f8))
* **calendar:** add i18n support and cropped abacus day numbers ([5242f89](5242f890f7))
* **i18n:** add internationalization for all create pages ([b080970](b080970d76))
2025-11-05 15:59:39 +00:00
Thomas Hallock
104f3e65d4 docs: add Storybook stories demonstrating cropToActiveBeads feature
Add comprehensive cropping examples including:
- Basic cropping (with and without hideInactiveBeads)
- Padding configuration examples
- Interactive AbacusReact examples with different scale factors
- Favicon-style icons (all 31 days) showing adaptive crop positioning
- Compact mode showcase

These stories demonstrate how cropping adapts to active bead positions,
resulting in different vertical positions for each value (intentional behavior).

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-05 09:58:12 -06:00
Thomas Hallock
35b0824fc4 feat: add cropToActiveBeads prop to AbacusStatic and AbacusReact
- Add cropToActiveBeads prop to AbacusSVGRenderer that accepts boolean or {padding} object
- Pass actual scaleFactor to calculateAbacusCrop for correct crop calculations at any scale
- Remove double scaling (was multiplying width/height by scaleFactor after crop already included it)
- Add cropToActiveBeads prop to AbacusStatic config and pass through to renderer
- Add cropToActiveBeads prop to AbacusReact config and pass through to renderer

This enables both components to crop the SVG viewBox to show only active beads with optional padding, working correctly at all scale factors (0.8, 1.0, 1.5, 2.0, etc.).

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-05 09:57:58 -06:00
Thomas Hallock
b080970d76 feat(i18n): add internationalization for all create pages
Implemented i18n across all three create pages with translations for 7 languages (en, de, ja, hi, es, la, goh):

- Created comprehensive translation files in src/i18n/locales/create/
- Updated /create (hub) page with all card content translations
- Updated /create/abacus page with parameter labels and help text
- Updated /create/flashcards page with UI elements and status messages
- Integrated create translations into main messages system

Translation coverage includes:
- Page titles and subtitles
- Feature descriptions and lists
- Form labels and placeholders
- Button text (normal and loading states)
- Error messages
- Help text and instructions

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-05 09:57:15 -06:00
semantic-release-bot
7ea8399745 chore(abacus-react): release v2.9.0 [skip ci]
# [2.9.0](https://github.com/antialias/soroban-abacus-flashcards/compare/abacus-react-v2.8.3...abacus-react-v2.9.0) (2025-11-05)

### Bug Fixes

* **docker:** upgrade OpenSCAD to 2024.11 to fix CGAL intersection bug ([e1bcd24](e1bcd24169))
* **guide:** increase abacus sizes - they were too small ([1074624](1074624b2f))
* **guide:** make abacus sizes consistent and add nav spacing ([bea4842](bea4842a29))
* **guide:** remove inner containers and tighten margins ([7e54c6f](7e54c6f4fc))
* **layout:** add systematic spacing for fixed nav bar ([4559fb1](4559fb121d))
* **layout:** remove wrapper, use utility class for nav spacing ([247c3d9](247c3d9874))
* **nav:** restrict transparent hero styling to home page only ([fab227d](fab227d686))

### Features

* **3d-abacus:** change default columns from 13 to 4 ([cd15c70](cd15c70a25))
* add client-side OpenSCAD WASM support for 3D preview ([eaaf17c](eaaf17cd4c))
2025-11-05 14:46:28 +00:00
Thomas Hallock
ec887c895c chore: update Claude Code auto-approvals for abacus-react
Add additional auto-approved commands to improve Claude Code workflow:
- git log/tag operations
- pnpm dev server
- biome formatting
- TypeScript compilation
- GitHub API access
- WebSearch and WebFetch
- npm/pnpm package management

These are safe, read-only, or routine development operations.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-05 08:43:53 -06:00
semantic-release-bot
11d0c341a8 chore(abacus-react): release v2.8.3 [skip ci]
## [2.8.3](https://github.com/antialias/soroban-abacus-flashcards/compare/abacus-react-v2.8.2...abacus-react-v2.8.3) (2025-11-05)

### Bug Fixes

* **tutorial:** correct column validation for bead highlights ([9ba1824](9ba1824226))
* **tutorial:** fix overlay rendering, arrow indicators, and bead visibility ([a804316](a80431608d))
* **web,docker:** add --format flag for Typst and upgrade to v0.13.0 ([19b9d7a](19b9d7a74f))
* **web:** move tsx to production dependencies for calendar generation ([ffae9c1](ffae9c1bdb))
2025-11-05 00:51:55 +00:00
Thomas Hallock
ece2ffb40f chore: remove debug logging from tutorial fixes
Remove console.log statements added during debugging:
- Bead style merge logging in AbacusReact
- Extra bead props calculation logging
- Yellow highlight bead render logging in AbacusAnimatedBead

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-04 18:50:35 -06:00
Thomas Hallock
a80431608d fix(tutorial): fix overlay rendering, arrow indicators, and bead visibility
Multiple fixes for tutorial regression issues:

- Fix overlay rendering: Changed from <g> to <foreignObject> to support
  DOM components (Radix UI Tooltip), fixing hydration errors
- Fix overlay positioning: Use calculateBeadPosition for accurate placement
- Fix arrow indicators: Reduce size, fix transform origin for center-based
  scaling, correct direction logic for heaven vs earth beads, add black
  stroke for contrast on yellow backgrounds, remove unnecessary circle
- Fix bead visibility: Implement proper opacity cascade (customStyle ->
  active -> hideInactiveBeads + hover), use opacity 0 instead of
  conditional rendering to enable hover detection
- Add abacus-level hover: Track hover state at abacus level and propagate
  to beads so inactive beads appear on hover over any part of abacus

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-04 18:50:35 -06:00
semantic-release-bot
16ccaf2c8b chore(abacus-react): release v2.8.2 [skip ci]
## [2.8.2](https://github.com/antialias/soroban-abacus-flashcards/compare/abacus-react-v2.8.1...abacus-react-v2.8.2) (2025-11-04)

### Bug Fixes

* **abacus-react:** add data-testid attributes back to beads for testing ([23ae1b0](23ae1b0c6f))
2025-11-04 19:25:18 +00:00
Thomas Hallock
23ae1b0c6f fix(abacus-react): add data-testid attributes back to beads for testing
After the refactor to shared SVG rendering, data-testid attributes were
removed from beads, causing controlled-input tests to fail. Added them
back to both AbacusAnimatedBead and AbacusStaticBead for test compatibility.

Test IDs follow pattern: bead-place-{placeValue}-{type}[-pos-{position}]
Examples: bead-place-0-heaven, bead-place-0-earth-pos-0

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-04 13:24:04 -06:00
semantic-release-bot
e852afddc5 chore(abacus-react): release v2.8.1 [skip ci]
## [2.8.1](https://github.com/antialias/soroban-abacus-flashcards/compare/abacus-react-v2.8.0...abacus-react-v2.8.1) (2025-11-04)

### Bug Fixes

* **abacus-react:** fix animations by preventing component remounting ([be7d4c4](be7d4c4713))
* **abacus-react:** restore original AbacusReact measurements and positioning ([88c0baa](88c0baaad9))
2025-11-04 19:10:18 +00:00
Thomas Hallock
645140648a chore(abacus-react): remove debug logging and backup file 2025-11-04 13:09:01 -06:00
Thomas Hallock
be7d4c4713 fix(abacus-react): fix animations by preventing component remounting
The issue was that WrappedBeadComponent was causing all beads to remount
on every render, preventing React Spring animations from working. Even
though the wrapper was memoized with useCallback, any dependency change
caused React to see it as a completely new component type, unmounting all
old beads and mounting new ones at their new positions (instant jump instead
of animation).

Solution: Refactor to use calculateExtraBeadProps pattern instead of wrapper
- Pass AbacusAnimatedBead directly as BeadComponent (stable reference)
- Add calculateExtraBeadProps function to AbacusSVGRenderer interface
- This function computes animation props (enableAnimation, physicsConfig, etc.)
  without changing the component type
- Result: Beads update props instead of remounting, allowing animations to work

Key changes:
- AbacusSVGRenderer: Accept calculateExtraBeadProps prop
- AbacusSVGRenderer: Call calculateExtraBeadProps for each bead, spread result
- AbacusReact: Replace WrappedBeadComponent with calculateExtraBeadProps callback
- AbacusReact: Pass AbacusAnimatedBead directly (not wrapped)
- AbacusSVGRenderer: Change BeadComponent type to React.ComponentType<any>
- AbacusSVGRenderer: Use stable keys: bead-pv{placeValue}-{type}-{position}

Debugging logs added temporarily to verify fix works.
2025-11-04 13:09:01 -06:00
Thomas Hallock
88c0baaad9 fix(abacus-react): restore original AbacusReact measurements and positioning
This restores the exact dimension calculations and bead positioning
formulas from the original useAbacusDimensions hook and inline positioning
logic, ensuring correct visual layout and maintaining animations.

Changes:
- Fix barY calculation: use heavenEarthGap directly (30px), not +labelSpace
- Restore original Typst positioning formulas for all beads:
  * Heaven inactive: heavenEarthGap - inactiveGap - beadSize/2
  * Earth positioning now accounts for earthActive count correctly
- Pass empty columnLabels array to calculateStandardDimensions from
  AbacusReact since it renders labels separately at y=-20
- Add columnState parameter to calculateBeadPosition() for accurate
  inactive earth bead positioning
- Update AbacusSVGRenderer to pass column state when calculating positions

This fixes the issue where beads appeared at wrong positions after the
refactor due to incorrect dimension calculations.

Related: AbacusStatic continues to work correctly with labelSpace since
it renders labels within the SVG coordinate space.
2025-11-04 13:09:01 -06:00
semantic-release-bot
20ab40b2df chore(abacus-react): release v2.8.0 [skip ci]
# [2.8.0](https://github.com/antialias/soroban-abacus-flashcards/compare/abacus-react-v2.7.1...abacus-react-v2.8.0) (2025-11-04)

### Bug Fixes

* **docker:** add scripts, abacus-react, and tsx for production calendar generation ([33eb90e](33eb90e316))
* **web:** generate styled-system artifacts during build ([293390a](293390ae35))
* **web:** move react-dom/server import to API route to satisfy Next.js ([00a8bc3](00a8bc3e5e))
* **web:** prevent abacus overlap in composite calendar ([448f93c](448f93c1e2)), closes [#f0f0f0](https://github.com/antialias/soroban-abacus-flashcards/issues/f0f0f0)
* **web:** use dynamic import for react-dom/server in API route ([4f93c7d](4f93c7d996))
* **web:** use nested SVG elements to prevent coordinate space conflicts ([f9cbee8](f9cbee8fcd))

### Features

* **abacus-react:** add shared dimension calculator for consistent sizing ([e5ba772](e5ba772fde))
* **web:** add Typst-based preview endpoint with React Suspense ([599a758](599a758471))
* **web:** add year abacus to calendar header and make grid bolder ([867c7ee](867c7ee172)), closes [#333](https://github.com/antialias/soroban-abacus-flashcards/issues/333)
* **web:** optimize monthly calendar for single-page layout ([b277a89](b277a89415))
* **web:** redesign monthly calendar as single composite SVG ([8ce8038](8ce8038bae))
2025-11-04 16:44:44 +00:00
Thomas Hallock
e5ba772fde feat(abacus-react): add shared dimension calculator for consistent sizing
- Add calculateAbacusDimensions utility to AbacusUtils
- Refactor AbacusStatic to use shared dimension calculator
- Update calendar composite generator to use shared utility
- Export calculateAbacusDimensions from index and static entry points
- Ensures consistent sizing between preview and PDF generation

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-04 10:43:21 -06:00
semantic-release-bot
203f110b65 chore(abacus-react): release v2.7.1 [skip ci]
## [2.7.1](https://github.com/antialias/soroban-abacus-flashcards/compare/abacus-react-v2.7.0...abacus-react-v2.7.1) (2025-11-04)

### Bug Fixes

* add xmlns to AbacusStatic for Typst SVG parsing ([98cd019](98cd019d4a))
* **web:** use AbacusStatic for calendar SVG generation ([08c6a41](08c6a419e2))
2025-11-04 02:11:27 +00:00
Thomas Hallock
98cd019d4a fix: add xmlns to AbacusStatic for Typst SVG parsing
- Add xmlns="http://www.w3.org/2000/svg" to AbacusStatic root svg element
- Fixes "failed to parse SVG (missing root node)" Typst error
- React's renderToStaticMarkup doesn't add xmlns by default
- Required for standalone SVG files used outside HTML context
- Added debug logging to calendar generation route

Root cause: Typst's SVG parser requires explicit XML namespace declaration.
React assumes SVGs are embedded in HTML where xmlns is optional.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-03 20:10:22 -06:00
semantic-release-bot
a9664bdcb4 chore(abacus-react): release v2.7.0 [skip ci]
# [2.7.0](https://github.com/antialias/soroban-abacus-flashcards/compare/abacus-react-v2.6.0...abacus-react-v2.7.0) (2025-11-04)

### Bug Fixes

* **web:** add dynamic export to rithmomachia page ([329e623](329e623212))
* **web:** fix Typst PDF generation path resolution ([7ce1287](7ce1287525))

### Features

* **abacus-react:** add separate /static export path for React Server Components ([ed69f6b](ed69f6b917))
* **web:** add test page for AbacusStatic RSC compatibility ([903dea2](903dea2584))
* **web:** improve calendar abacus preview styling ([8439727](8439727b15))
2025-11-04 00:52:55 +00:00
Thomas Hallock
72a4c2b80c docs(abacus-react): update README with /static import path for RSC
- Document @soroban/abacus-react/static import path
- Add note about requiring /static for React Server Components
- Update code examples to use correct import path

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-03 18:51:46 -06:00
Thomas Hallock
ed69f6b917 feat(abacus-react): add separate /static export path for React Server Components
- Create src/static.ts entry point with only server-compatible exports
- Configure Vite to build separate static.es.js and static.cjs.js bundles
- Add @soroban/abacus-react/static export path in package.json
- Enables RSC usage without importing client-side hooks/animations

Fixes build errors when importing AbacusStatic in Next.js App Router pages
without "use client" directive.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-03 18:51:46 -06:00
semantic-release-bot
9d322301ef chore(abacus-react): release v2.6.0 [skip ci]
# [2.6.0](https://github.com/antialias/soroban-abacus-flashcards/compare/abacus-react-v2.5.0...abacus-react-v2.6.0) (2025-11-04)

### Bug Fixes

* **abacus-react:** correct column highlighting offset in AbacusStatic ([0641eb7](0641eb719e))

### Features

* **abacus-react:** add AbacusStatic for React Server Components ([3b8e864](3b8e864cfa))
* **web:** add test page for AbacusStatic Server Component ([3588d5a](3588d5acde))
2025-11-04 00:31:11 +00:00
Thomas Hallock
0641eb719e fix(abacus-react): correct column highlighting offset in AbacusStatic
Column highlights were positioned incorrectly - missing the padding offset
that beads and rods include. The highlight rectangles appeared shifted to
the left of the actual columns.

Fixed by adding padding to the X position calculation, matching how beads
and column posts are positioned.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-03 18:30:03 -06:00
Thomas Hallock
74f2d97434 docs(abacus-react): export AbacusStatic and update README
Updates package exports to include:
- AbacusStatic component
- AbacusStaticConfig type

README additions:
- New "Static Display (Server Components)" section
- Comparison table: AbacusStatic vs AbacusReact
- Server Component usage examples
- Updated features list to highlight RSC support

Provides clear guidance on when to use each component based on
requirements (interactivity, animations, SSR/SSG).

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-03 18:29:16 -06:00
Thomas Hallock
4f9dc4666d docs(abacus-react): add Storybook stories for AbacusStatic
Comprehensive documentation and examples demonstrating:
- Default usage and different values
- All color schemes (place-value, monochrome, heaven-earth, alternating)
- All bead shapes (circle, diamond, square)
- Compact mode for inline displays
- Hide inactive beads
- Theme presets (light, dark, trophy)
- Column highlighting and labels
- Scaling options
- Server Component usage examples
- Preview card grids

Highlights that AbacusStatic shares logic with AbacusReact (no duplication).

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-03 18:29:16 -06:00
Thomas Hallock
3b8e864cfa feat(abacus-react): add AbacusStatic for React Server Components
Implements a pure, server-component-compatible static abacus renderer
that shares core business logic with AbacusReact without code duplication.

Key features:
- No "use client" directive - works in React Server Components
- No hooks, animations, or client-side JavaScript
- Shares utilities: numberToAbacusState, color scheme logic, positioning
- Supports all visual customization: color schemes, bead shapes, themes
- Full feature parity for static displays: compact mode, hide inactive,
  column highlighting & labels, custom styles

Implementation approach:
- AbacusStaticBead: Pure SVG bead component (no hooks/animations)
- AbacusStatic: Main component using shared AbacusUtils
- Dependency injection pattern: separate rendering paths for client vs server

Bundle impact: +4KB

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-03 18:29:16 -06:00
semantic-release-bot
7418adb959 chore(abacus-react): release v2.5.0 [skip ci]
# [2.5.0](https://github.com/antialias/soroban-abacus-flashcards/compare/abacus-react-v2.4.0...abacus-react-v2.5.0) (2025-11-03)

### Features

* **abacus-react:** add core utility functions for state management ([e65541c](e65541c100))
* **abacus-react:** add layout and educational props ([35bbcec](35bbcecb9e))
* **abacus-react:** add pre-defined theme presets ([cf1f950](cf1f950c7c))
* **abacus-react:** add React hooks for abacus calculations ([de038d2](de038d2afc))
* **abacus-react:** export new utilities, hooks, and themes ([ce4e44d](ce4e44d630))
2025-11-03 23:18:22 +00:00
Thomas Hallock
35d8734a3a docs(abacus-react): update documentation for new features
Update README.md with:
- Theme presets usage examples
- Compact mode examples
- Column highlighting and labels
- New hooks (useAbacusDiff, useAbacusState)
- Utility functions documentation
- Updated TypeScript imports

Add ENHANCEMENT_PLAN.md:
- Documents the analysis of apps/web customizations
- Implementation roadmap with completion status
- Impact metrics

Add INTEGRATION_SUMMARY.md:
- Summary of integrated features
- Code deduplication metrics (~260-300 lines eliminated)
- Files modified in both packages

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-03 17:17:17 -06:00
Thomas Hallock
6a1cec06a7 docs(abacus-react): add Storybook stories for new features
Add comprehensive Storybook stories demonstrating:
- All 6 theme presets (light, dark, trophy, translucent, solid, traditional)
- Compact mode for inline displays
- Frame visibility control
- Column highlighting and labels
- useAbacusDiff and useAbacusState hooks
- Utility functions
- Combined feature showcases

Stories are organized under "AbacusReact/Themes & Utilities".

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-03 17:17:17 -06:00
Thomas Hallock
ce4e44d630 feat(abacus-react): export new utilities, hooks, and themes
Update index.ts to export:
- ABACUS_THEMES and AbacusThemeName
- Utility functions (numberToAbacusState, calculateBeadDiff, etc.)
- React hooks (useAbacusDiff, useAbacusState)
- New types (BeadState, AbacusState, BeadDiffResult, etc.)

All new features are now available to consumers of the package.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-03 17:17:17 -06:00
Thomas Hallock
35bbcecb9e feat(abacus-react): add layout and educational props
Add new props to AbacusConfig:
- frameVisible: Show/hide column posts and reckoning bar
- compact: Compact layout for inline displays (implies frameVisible=false)
- highlightColumns: Highlight specific columns by index
- columnLabels: Optional educational labels for columns

These props simplify common use cases:
- Inline mini-abacus displays now use just compact={true}
- Column highlighting for tutorials without custom overlays
- Frame visibility control for different contexts

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-03 17:17:17 -06:00
Thomas Hallock
cf1f950c7c feat(abacus-react): add pre-defined theme presets
Add ABACUS_THEMES with 6 pre-defined themes:
- light: Solid white frame (light backgrounds)
- dark: Translucent white with glow (dark backgrounds)
- trophy: Golden frame (achievements/rewards)
- translucent: Nearly invisible (inline/minimal UI)
- solid: Black frame (high contrast/educational)
- traditional: Brown wooden (traditional soroban aesthetic)

Eliminates ~60 lines of duplicate theme style definitions in apps/web.

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

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