Commit Graph

49 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
github-actions[bot] 8ea7771139 🎨 Update template examples and crop mark gallery
Auto-generated fresh SVG examples and unified gallery from latest templates.
Includes comprehensive crop mark demonstrations with before/after comparisons.

Files updated:
- packages/templates/gallery-unified.html

🤖 Generated with GitHub Actions

Co-Authored-By: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-11-02 02:34:47 +00:00
github-actions[bot] 6b63804a74 🎨 Update template examples and crop mark gallery
Auto-generated fresh SVG examples and unified gallery from latest templates.
Includes comprehensive crop mark demonstrations with before/after comparisons.

Files updated:
- packages/templates/examples/example-123-1.svg
- packages/templates/examples/example-5-1.svg
- packages/templates/examples/example-single-card-1.svg
- packages/templates/gallery-unified.html
- packages/templates/gallery/basic-5.svg
- packages/templates/gallery/circles-42.svg
- packages/templates/gallery/colorful-123.svg
- packages/templates/gallery/compact-999.svg
- packages/templates/gallery/crop-hidden-inactive-555.svg
- packages/templates/gallery/crop-large-scale-0.svg
- packages/templates/gallery/crop-mixed-geometry-321.svg
- packages/templates/gallery/crop-quad-9999.svg
- packages/templates/gallery/crop-single-1.svg
- packages/templates/gallery/debug-crop-marks-456.svg
- packages/templates/gallery/debug-crop-marks-89.svg
- packages/templates/gallery/educational-1234.svg
- packages/templates/gallery/large-7.svg

🤖 Generated with GitHub Actions

Co-Authored-By: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-10-26 02:33:04 +00:00
github-actions[bot] 1973c3c5ca 🎨 Update template examples and crop mark gallery
Auto-generated fresh SVG examples and unified gallery from latest templates.
Includes comprehensive crop mark demonstrations with before/after comparisons.

Files updated:
- packages/templates/gallery-unified.html

🤖 Generated with GitHub Actions

Co-Authored-By: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-10-19 02:34:31 +00:00
github-actions[bot] 76163a0846 🎨 Update template examples and crop mark gallery
Auto-generated fresh SVG examples and unified gallery from latest templates.
Includes comprehensive crop mark demonstrations with before/after comparisons.

Files updated:
- packages/templates/gallery-unified.html

🤖 Generated with GitHub Actions

Co-Authored-By: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-10-12 02:30:55 +00:00
Thomas Hallock bda5bc6c0e fix: prevent database imports from being bundled into client code
**Problem:**
- player-ownership.ts imported drizzle-orm and @/db at top level
- When RoomMemoryPairsProvider imported client-safe utilities, Webpack bundled ALL imports including database code
- This caused hydration error: "The 'original' argument must be of type Function"
- Node.js util.promisify was being called in browser context

**Solution:**
1. Created player-ownership.client.ts with ONLY client-safe utilities
   - No database imports
   - Safe to import from 'use client' components
   - Contains: buildPlayerOwnershipFromRoomData(), buildPlayerMetadata(), helper functions

2. Updated player-ownership.ts to re-export client utilities and add server-only functions
   - Re-exports everything from .client.ts
   - Adds buildPlayerOwnershipMap() (async, database-backed)
   - Safe to import from server components/API routes

3. Updated RoomMemoryPairsProvider to import from .client.ts

**Result:**
- No more hydration errors on /arcade/room
- Client bundle doesn't include database code
- Server code can still use both client and server utilities

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-10 11:40:46 -05:00
Thomas Hallock 31df87d3fc fix: restore workspace dependencies and fix TypeScript errors
- Restore @soroban/core and @soroban/client dependencies in apps/web
- Correct workspace configuration to include all existing packages
- Disable problematic example-server.ts to fix TypeScript build
- Update Dockerfile to copy all required package.json files

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-27 09:08:46 -05:00
Thomas Hallock 570eac17f1 chore: update Claude Code permissions for pedagogical tests
Add permissions for running core pedagogical tests to support
the new segment validation testing workflow.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-25 11:04:33 -05:00
Thomas Hallock 016acfd320 refactor: remove obsolete pedagogical algorithm tests and apply surgical improvements
- Remove pedagogicalAlgorithmTests.test.ts with outdated bead-movement-first expectations
- Add comprehensive micro-invariant tests for critical behaviors
- Remove dead parenthesized term parser code (never used)
- Add extra places validation in state consistency checks
- Clean up unused variables and improve code hygiene
- Update testing documentation to reflect current approach

The algorithm now has focused, fast validation (43 tests in 11ms) with
explicit invariant checking that catches bugs immediately rather than
relying on brittle snapshot comparisons.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-25 09:13:45 -05:00
Thomas Hallock c11162cab2 refactor: remove multi-place gating from five-complement pedagogy
- Always show five-complement pedagogy as separate steps regardless of operation complexity
- Update test expectations to match new pedagogical behavior
- Multi-place operations like 34→78 now show (50-10)+(5-1) instead of direct addition
- Ensures pedagogical consistency across all operation types

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-25 07:17:35 -05:00
Thomas Hallock 2e3223da90 feat: implement comprehensive bead diff tooltips with pedagogical decomposition
- Add PedagogicalDecompositionDisplay component with tooltip and guidance variants
- Create Radix tooltip overlay system targeting specific beads with direction arrows
- Show pedagogical decomposition with current term highlighted in both tooltip and guidance pane
- Position tooltip to left of abacus with 60px left margin to prevent clipping
- Add hover opacity effects (85% default, 100% on hover) for subtle tooltip presence
- Include lightbulb emoji and action summary in tooltip for clear guidance

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-24 08:04:09 -05:00
Thomas Hallock 13888334d6 chore: remove Claude local settings from version control
- Remove .claude/settings.local.json from git tracking
- This file is already in .gitignore and should remain local-only
- Contains user-specific Claude Code configurations

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-22 14:57:47 -05:00
Thomas Hallock ab99053d74 fix: enable multi-bead highlighting in tutorial system
- Fix highlighting logic bug where multiple beads in same column would overwrite each other
- Migrate TutorialStep interface from columnIndex to placeValue system
- Update tutorial data to use place values (0=ones, 1=tens, etc.)
- Fix bead validation logic to use place values instead of legacy columnIndex
- Enable proper multi-step tutorial highlighting for complement operations

Tutorial steps like "3 + 4 = 5 - 1" now correctly highlight both the heaven bead
(add 5) and earth bead (remove 1) simultaneously.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-21 17:56:00 -05:00
Thomas Hallock ca1ab32510 chore: update generated CSS and configuration files
- Added CSS for new abacus test page and updated existing styled-system files
- Updated Claude settings to include test command permissions
- Generated files from PandaCSS build process

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-20 10:36:58 -05:00
Thomas Hallock 9edb7fc55c chore: update generated CSS and configuration files
Update styled-system CSS chunks and Claude configuration to reflect
component and styling changes from previous feature additions.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-19 18:26:31 -05:00
Thomas Hallock b375a104a5 feat: add input-based flashcard template with parameter parsing
Add flashcards-input.typ wrapper that accepts parameters via Typst's --input system,
enabling CLI usage with configurable options for numbers, layout, styling, and paper settings.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-19 18:26:00 -05:00
Thomas Hallock 684e62463d feat: implement interactive place value editing with NumberFlow animations
- Add SVG-based place value displays perfectly aligned with abacus columns
- Implement keyboard navigation: digits advance right, Tab/Backspace/Shift+Tab move focus
- Integrate @number-flow/react for smooth animated number transitions
- Support wraparound navigation at column boundaries
- Add visual feedback with blue highlighting for active editing state
- Enable seamless two-way binding between place values and bead positions

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-18 14:21:52 -05:00
Thomas Hallock ff42bcf653 feat: implement CSS-based hidden inactive beads with smooth opacity transitions
- Add CSS opacity system for hidden inactive beads accessibility
- Remove DOM exclusion logic - render all beads, use CSS for visibility
- Implement three-state opacity system:
  * Default: inactive beads opacity 0 (hidden)
  * Abacus hover: inactive beads opacity 0.5 (semi-transparent)
  * Individual bead hover: opacity 1 (fully visible)
- Add smooth 0.2s ease-in-out transitions for all opacity changes
- Create comprehensive test story with side-by-side comparison
- Maintain full click/gesture functionality for revealed beads
- Clean CSS-only implementation with no JavaScript hover management

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-18 10:42:48 -05:00
Thomas Hallock 3c28c694fc fix: restore click functionality alongside directional gestures
Enable both click and gesture interactions to work together seamlessly:
- Click interactions fully restored - beads toggle with neighbor logic
- Gesture interactions preserved - directional dragging still works
- Smart conflict prevention - prevents double-toggling when switching modes
- 100ms grace period after gestures to avoid accidental click triggers
- Dual interaction support - users can mix clicking and dragging freely

Users now have the best of both worlds: precise click control AND
intuitive gesture interactions, with intelligent conflict resolution
to prevent any double-toggling issues.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-18 10:18:08 -05:00
Thomas Hallock 7c104f37b5 feat: implement intuitive directional gesture system for abacus beads
Replace traditional drag-and-drop with natural gesture directions:
- Heaven beads: drag down toward bar to activate, up to deactivate
- Earth beads: drag up toward bar to activate, down to deactivate
- Support for gesture direction reversals during single interaction
- Independent bead behavior - each responds only to its own gesture
- Click functionality preserved when gestures are disabled
- Enhanced Storybook stories with dedicated gesture testing example

The gesture system tracks cursor movement direction and toggles beads
based on natural abacus movement patterns, creating an intuitive and
satisfying user experience that mirrors real soroban operation.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-18 10:14:37 -05:00
Thomas Hallock 86cbbc8c18 feat: implement realistic abacus drag mechanics
- Constrain bead dragging to vertical movement only (beads slide on rods)
- Add intelligent drag-to-toggle behavior based on direction and bead type
- Heaven beads: drag toward/away from reckoning bar toggles state
- Earth beads: drag toward bar activates, away deactivates
- Require significant drag distance to prevent accidental toggles
- Always snap back to proper position after drag release
- Mirrors real abacus physics and user expectations

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-18 08:29:32 -05:00
Thomas Hallock 1303c930f2 perf: speed up bead animations for fast abacus calculations
- Replace slow config.gentle with fast, snappy animation config
- Use tension: 400, friction: 30, mass: 0.8 for quick bead movement
- Apply fast animation to both position changes and drag snap-back
- Maintains smooth animation while enabling rapid abacus work
- Reflects the speed-focused nature of abacus as a calculation tool

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-18 08:27:12 -05:00
Thomas Hallock 97690d6b59 fix: correct diamond bead column alignment to match Typst positioning
- Implement shape-specific X-offset calculation for proper bead centering
- Diamond beads now use size * 0.7 offset (matching Typst dx: x - bead-size * 0.7)
- Square and circle beads continue using size / 2 offset
- Fix applies to both static and animated positioning
- Ensures pixel-perfect alignment with Typst template output

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-18 08:25:57 -05:00
Thomas Hallock 10a3c7b342 docs: add comprehensive Storybook documentation and examples
- Add 15+ interactive stories covering all abacus configurations
- Include API documentation with controls for all component properties
- Add usage examples and component breakdowns
- Create gallery overview and individual component stories
- Enable interactive testing of animations, drag, and click functionality

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-18 08:18:34 -05:00
Thomas Hallock 1bcfd22f17 feat: create interactive gallery replicating original Typst design
- Add comprehensive gallery component matching original gallery layout
- Implement tabbed interface with Basic, Advanced, and Debug examples
- Include live statistics tracking and reset functionality
- Support all 13 original gallery configurations with full interactivity
- Add responsive styling matching original design aesthetic

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-18 08:18:26 -05:00
Thomas Hallock 528cac50a8 feat: implement React abacus component with independent heaven/earth beads
- Add fully interactive React abacus matching Typst template behavior
- Implement independent heaven and earth bead state management
- Add physical bead movement with realistic positioning logic
- Support React Spring animations and @use-gesture drag interactions
- Include multiple color schemes and bead shapes
- Provide hooks for dimensions and state management
- Enable true soroban behavior where beads operate independently

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-18 08:18:15 -05:00
Thomas Hallock e5df064500 add: Storybook configuration for React abacus component development
- Add complete Storybook 7.6.0 setup with TypeScript support
- Configure React Spring and use-gesture dependencies
- Add dev dependencies for interactive component development
- Enable hot reloading and component documentation

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-18 08:18:07 -05:00
Thomas Hallock 132d0b0bda regenerate: gallery SVGs with enhanced crop processor
All gallery examples regenerated using improved SVG processor that supports
both CLI and Node.js format crop marks for better compatibility.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-17 14:07:18 -05:00
Thomas Hallock dac0b10c44 update: gallery HTML with improved styling and new generated content
- Improve SVG display with better proportions (max-height: 400px)
- Update gallery statistics and generation timestamp
- Include new SVG content generated with enhanced processor

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-17 14:07:13 -05:00
Thomas Hallock c57025f821 add: new gallery:node script for Node.js-based gallery generation
Enables generating gallery using Node.js SVG processor instead of CLI version.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-17 14:07:07 -05:00
Thomas Hallock d3d3f011ed enhance: improve SVG crop processor to support both CLI and Node.js formats
- Add support for Node.js format crop marks with explicit direction links
- Maintain backward compatibility with CLI format using path elements
- Improve parsing logic to handle both transform accumulation methods

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-17 14:07:01 -05:00
Thomas Hallock 826e86d73c fix: update unified gallery to use correct crop examples
Update build-unified-gallery.js to use the actual crop examples that are
generated by build-gallery.js instead of mismatched hardcoded examples.

This ensures that all crop examples in the unified gallery properly show
before/after viewport cropping comparisons with working crop mark detection.

Now shows comprehensive demonstrations for:
- crop-single-1: Single digit with optimized viewBox
- crop-quad-9999: Four-digit number with crop boundaries
- crop-large-scale-0: Zero representation with large scale
- crop-hidden-inactive-555: Clean layout with hidden inactive beads
- crop-mixed-geometry-321: Circle beads with heaven-earth colors

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-16 15:58:08 -05:00
Thomas Hallock 2015d05e8f docs: add comprehensive SVG post-processor documentation
Add detailed documentation for the official SVG post-processing system:

- Quick start examples with code snippets showing processSVG usage
- Before/after SVG optimization demonstrations (270×210px → 58×136px)
- Complete API reference with TypeScript interfaces
- Browser usage examples with File API and drag-drop
- Interactive bead processing examples (bead:// links → data attributes)
- Error handling patterns with SVGCropError
- Performance benefits: 67% average file size reduction

Positions the SVG post-processor as THE recommended approach for
processing Typst-generated soroban SVGs with comprehensive feature
coverage including crop marks, bead annotations, and viewBox optimization.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-16 15:57:53 -05:00
Thomas Hallock bee866ab5c feat: export SVG processing functions from main module
Export all SVG post-processing functions (processSVG, processSVGFile,
extractCropMarks, extractBeadAnnotations, SVGCropError) from the main
@soroban/templates module for easy access.

Includes comprehensive TypeScript definitions with complete interfaces
for ProcessResult, CropResult, BeadData, and ProcessOptions.

This makes the SVG post-processor the official recommended approach
for processing Typst-generated soroban SVGs.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-16 15:57:40 -05:00
Thomas Hallock 59f4022afb feat: add SVG post-processor to package exports
Add svg-crop-processor.js to published package files to make the comprehensive
SVG post-processing functionality available to external consumers.

The processor provides:
- Crop mark detection and viewBox optimization (60-80% size reduction)
- Interactive bead annotation extraction (bead:// links to data attributes)
- Automatic width/height adjustment for proper aspect ratios
- Browser and Node.js compatibility with zero dependencies

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-16 15:57:28 -05:00
Thomas Hallock 79f38c13e7 fix: perfect crop mark detection and SVG dimension consistency
- Fix crop mark detection to use tiny 0.1pt markers instead of dashed lines
- Update SVG width/height attributes to match cropped viewBox dimensions
- Remove CSS max-width constraint to show actual size differences
- Improve horizontal/vertical cropping visualization in gallery
- Now both crop mark positioning and size reduction are clearly visible

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-16 12:57:21 -05:00
Thomas Hallock 397c86f287 refactor: improve crop mark visualization and fix gallery workflow
- Convert crop marks to dashed lines spanning full crop boundaries for better visualization
- Add invisible point markers for precise algorithmic viewBox detection
- Fix crop mark positioning to avoid confusion from line lengths in extraction
- Update package.json to use unified gallery system (build-unified-gallery.js)
- Create comprehensive tabbed gallery combining all examples in one interface

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-16 12:43:05 -05:00
Thomas Hallock 03230a2eab feat: implement proper SVG transform accumulation for crop mark viewBox calculation
- Fix extract-viewbox.js to properly walk up SVG hierarchy and accumulate all parent transforms
- Replace broken simple coordinate extraction with correct transform accumulation
- Add crop marks demonstration page showing before/after viewBox optimization
- Create demo-crop-comparison.js for visual proof of 79-95% size reduction
- Update build-gallery.js to include all 13 crop mark examples in static gallery
- Gallery now properly shows comprehensive crop marks showcase

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-16 12:21:06 -05:00
github-actions[bot] 992c9ca320 🎨 Update template example renderings
Auto-generated fresh SVG examples from latest templates.

Files updated:
- packages/templates/examples/example-123-1.svg
- packages/templates/examples/example-5-1.svg
- packages/templates/examples/example-single-card-1.svg

🤖 Generated with GitHub Actions

Co-Authored-By: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-09-16 16:40:13 +00:00
Thomas Hallock 8c7a5b1291 feat: enhance crop marks with edge-based positioning and comprehensive tests
- Move crop marks from corner-based to edge-based positioning (top, bottom, left, right)
- Position crop marks relative to actual bead boundaries within soroban coordinate system
- Add 6 new gallery examples showcasing crop marks with diverse configurations
- Create comprehensive unit test suite (test-crop-marks-unit.js) with 18 assertions
- Update README documentation with edge-based crop mark scheme
- Simplify gallery generation by removing redundant non-static version
- All tests pass: crop marks now correctly define SVG viewBox boundaries

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-16 11:40:03 -05:00
github-actions[bot] cc507ca89d 🎨 Update template example renderings
Auto-generated fresh SVG examples from latest templates.

Files updated:
- packages/templates/examples/example-123-1.svg
- packages/templates/examples/example-5-1.svg
- packages/templates/examples/example-single-card-1.svg

🤖 Generated with GitHub Actions

Co-Authored-By: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-09-16 15:37:11 +00:00
Thomas Hallock 776eb9df7f refactor: simplify gallery to only use static version
- Remove redundant gallery.html in favor of gallery-static.html only
- Consolidate npm scripts: `npm run gallery` now generates and opens static gallery
- Add crop marks examples to gallery with visible red boundaries
- Fix Typst syntax error in single-card.typ crop marks implementation

Static gallery provides better UX with embedded SVGs and no external dependencies.

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-16 10:36:54 -05:00
Thomas Hallock 7731f70b99 feat: add invisible crop marks for consistent SVG viewBox boundaries
Add crop marks system to both flashcards.typ and single-card.typ templates:
- Invisible rectangular marks at four corners plus center reference
- Optional debugging visibility with show-crop-marks: true
- Configurable crop-margin parameter for boundary spacing
- Link annotations for programmatic identification
- Comprehensive documentation with processing examples
- Post-processing script for automated viewBox calculation

Eliminates need for manual SVG cropping by providing precise boundaries
for automated viewBox handling and consistent template output.

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-16 10:29:32 -05:00
Thomas Hallock 505ff66bd5 feat: add static site generator for gallery with embedded SVGs
- Add build-gallery.js: Static site generator that embeds SVG content directly
- Creates gallery-static.html: Complete standalone gallery page
- No CORS issues - all SVGs embedded as inline content
- Clean, professional layout with hover effects and responsive grid
- Build stats showing embedded/missing SVGs with timestamps
- Add npm scripts: gallery:build, gallery:static, updated gallery:clean
- Perfect for sharing or hosting - single self-contained HTML file

Usage:
- npm run gallery:static    (generate SVGs + build static gallery)
- npm run gallery:build     (just build from existing SVGs)

This replaces the fetch()-based approach that had CORS issues.
The static generator creates a complete, shareable HTML file.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-16 10:16:11 -05:00
Thomas Hallock 87eb51d399 fix: gallery now loads actual Typst-generated SVGs instead of fake placeholders
- Remove custom JavaScript soroban drawing code (not needed)
- Gallery now loads real SVG files generated by generate-gallery.js
- Fix generateExample to use fetch() to load actual SVG files from gallery/
- Update button text from "Generate" to "Load SVG" for clarity
- Remove all fake bead generation functions (generateBeadElements, createBead, getBeadColor)
- Gallery now properly showcases actual template output using real Typst compilation

The generate-gallery.js script was already correctly using:
- Real flashcards.typ templates with #import "../flashcards.typ": draw-soroban
- Actual Typst CLI compilation with typst compile --format svg
- Proper configuration parameters passed to draw-soroban()

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-16 10:12:44 -05:00
Thomas Hallock efc5cc408d feat: add self-contained Storybook-like gallery for template visualization
- Add gallery.html: Pure HTML/JS gallery interface with no build requirements
- Add generate-gallery.js: Node.js script to generate actual SVGs using Typst CLI
- Add GALLERY.md: Complete documentation for gallery usage
- Include 6 curated examples showcasing different configurations:
  • Basic number 5 with monochrome diamonds
  • Colorful 123 with place-value diamond beads
  • Circle beads 42 with heaven-earth colors
  • Large scale 7 for detail work (2.5x scale)
  • Compact 999 with hidden inactive beads
  • Educational 1234 showing empty columns
- Add npm scripts: gallery, gallery:open, gallery:clean
- Gallery lives entirely in packages/templates/ directory
- No TypeScript, no build process, opens directly in browser
- Perfect for rapid prototyping and design iteration

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-16 10:03:42 -05:00
Thomas Hallock d94baa1a80 fix: regenerate example SVGs with actual soroban renderings
- Remove text labels from example templates, show only soroban graphics
- Increase canvas sizes for better visibility (300x150pt, 400x200pt)
- Use larger base-size (1.8-2.0) for clearer bead visualization
- Regenerate all SVGs with proper soroban beads instead of text
- Fix example-5: now shows diamond beads with place-value colors
- Fix example-123: now shows circle beads with heaven-earth colors
- Fix example-single-card: properly renders number 42 as soroban

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-16 09:53:04 -05:00
Thomas Hallock 4108aa912d docs: add visual example renderings to README
- Add comprehensive "Example Renderings" section with SVG previews
- Generate example SVGs for numbers 5, 123, and single card (42)
- Include different bead shapes, color schemes, and template usage
- Update examples README with visual examples table
- Add instructions for generating custom renderings with typst CLI
- Show practical template configurations and their outputs

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-16 09:47:12 -05:00
Thomas Hallock bb869a0b11 feat: add comprehensive test suite and documentation
- Add Node.js test suite with 36 tests covering package structure, imports, and integration
- Add Python test suite with 44 tests covering package structure, imports, and validation
- Add comprehensive README with merged Quick Start section and troubleshooting
- Add practical examples for Node.js, Python, and TypeScript/Next.js usage
- Add automated CI test harness with cross-platform validation
- Update typst-test.js to use new templates package

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-16 09:40:10 -05:00