Commit Graph

61 Commits

Author SHA1 Message Date
Thomas Hallock
79ea52af80 feat(tutorial): add hideNavigation prop to TutorialPlayer
Add `hideNavigation` prop to TutorialPlayer component that hides
the header and footer navigation controls, allowing the tutorial
content to be embedded cleanly without navigation chrome.

Perfect for single-step tutorial demos like the homepage.

Changes:
- Add hideNavigation prop to TutorialPlayerProps
- Wrap header section in conditional rendering
- Wrap navigation footer in conditional rendering
- Update homepage to use hideNavigation={true}
- Adjust minHeight when navigation is hidden

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-19 12:47:54 -05:00
Thomas Hallock
c883d9e4c1 fix(tutorial): resolve React hydration error in TutorialPlayer
Change <p> tag to <div> tag to fix HTML nesting violation. The
<p> tag was containing <DecompositionWithReasons> which renders
a <div>, causing a hydration error. In HTML, <p> cannot contain
block-level elements like <div>.

Fixed: apps/web/src/components/tutorial/TutorialPlayer.tsx:1386

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-19 12:41:33 -05:00
Thomas Hallock
f9af0f169e chore: biome formatting fixes 2025-10-11 07:17:38 -05: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
60d70cd2f2 style: apply Biome formatting to entire codebase
Run Biome formatter on all files to ensure consistent code style:
- Single quotes for JS/TS
- Double quotes for JSX
- 2-space indentation
- 100 character line width
- Semicolons as needed
- ES5 trailing commas

This is the result of running: npx @biomejs/biome format . --write

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-07 12:48:26 -05:00
Thomas Hallock
a387b030fa refactor: consolidate abacus display context management
- Remove duplicate AbacusDisplayContext in favor of centralized abacus-react provider
- Update all components to use useAbacusDisplay and useAbacusConfig hooks from @soroban/abacus-react
- Create ClientProviders component to centralize provider setup
- Simplify context management across the application

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-29 09:43:35 -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
bada2996e2 feat: implement two-level column highlighting in tutorial player
Update TutorialPlayer to use enhanced column mapping for proper two-level highlighting. Group highlights use rhsPlace (target column) while individual highlights use termPlace (specific term column).

- Group highlighting: getColumnFromTermIndex(termIndex, true) for rhsPlace
- Individual highlighting: getColumnFromTermIndex(termIndex, false) for termPlace
- Blue glow for group target column where complement operation net effect lands
- Orange glow for individual term column being hovered
- Enhanced debug logging to track column mapping behavior

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-26 11:39:12 -05:00
Thomas Hallock
ec030f00fd feat: implement clean background glow for term-to-column highlighting
- Replace obtrusive bead overlays with subtle backgroundGlow effect
- Remove conflicting column post highlighting to avoid double effects
- Use refined blur (4px) and opacity (0.25) for gentle visual feedback
- Maintain numeral highlighting for additional context
- Preserve full bead interactivity with non-interfering glow layer

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-26 11:04:35 -05:00
Thomas Hallock
37b5ae8623 feat: implement provenance system for pedagogical term tracking
Add comprehensive provenance tracking to link mathematical terms back to their source digits in addends. This enables enhanced tooltips that clearly show students which digit expansion corresponds to which part of the original problem.

Core changes:
- Add TermProvenance interface with source digit tracking (rhs, rhsDigit, rhsPlace, etc.)
- Add EquationAnchors interface for UI digit highlighting support
- Integrate provenance data through tutorial context instead of prop drilling
- Add buildEquationAnchors() for character position mapping
- Include groupId for complement operations that share source digits

This foundational system enables pedagogical tooltips to show "Add the tens digit — 2 tens (20) from addend 25" instead of generic "Direct Add — tens".

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-26 09:20:13 -05:00
Thomas Hallock
2c095162e8 feat: implement interactive pedagogical reasoning with compact tooltips
- Add DecompositionWithReasons component with interactive term groups
- Implement current step highlighting with amber glow animation
- Create compact tooltips with step-by-step breakdowns and expansion reasoning
- Remove visual noise: no default term styling, only current step and group hover
- Add unified hover targets spanning entire term groups with reasoning context
- Integrate with tutorial context for synchronized step progression

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-25 15:01:47 -05:00
Thomas Hallock
decd8a36ca fix: add robust fallback system for term highlighting in guidance
Implement 3-tier fallback highlighting system:
1. Use precise termPosition when available and validated
2. Smart search for mathematical term in decomposition string
3. Number-only fallback for edge cases

This fixes guidance panel and tooltip highlighting issues where
term positions from algorithm were occasionally off by a few characters
due to complex parenthesization formatting.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-24 22:05:11 -05:00
Thomas Hallock
9d0e8c7086 feat: hide redundant pedagogical expansions for simple problems
- Added isMeaningfulDecomposition flag to UnifiedInstructionSequence
- Implemented logic to detect when pedagogical expansions are redundant
- Hide expansions for simple problems like "0 + 1" that don't need decomposition
- Show expansions for complex problems like "99 + 1" that benefit from breakdown
- Updated UI to conditionally show pedagogical decomposition based on meaningfulness
- Added comprehensive tests to ensure correct detection of meaningful vs redundant cases

Examples:
- "0 + 1 = 1" - expansion hidden (redundant)
- "5 - 1 = 4" - expansion hidden (simple complement not worth showing)
- "99 + 1 = 100" - expansion shown (meaningful multi-step breakdown)
- Multi-term decompositions - always shown (inherently meaningful)

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-24 11:24:08 -05:00
Thomas Hallock
f9e42f6e92 fix: hide celebration tooltip when user moves away from target value
- Updated tooltip logic to only show celebration when step is completed AND current value equals target
- Introduced showCelebration variable to distinguish between celebration and instruction modes
- Celebration disappears immediately when user moves away from correct answer
- Prevents inappropriate "excellent work" message when user has moved to wrong value

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-24 11:12:42 -05:00
Thomas Hallock
fa153c6908 fix: resolve ReferenceError by moving ref declarations before usage
- Moved lastMovedBead ref declaration to top of component before useMemo
- Removed duplicate ref declarations later in file
- Fixed variable hoisting issue causing ReferenceError

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-24 11:10:19 -05:00
Thomas Hallock
91c5e58029 feat: improve celebration tooltip positioning to last moved bead
- Track last moved bead in useRef to remember user's final action
- Use last moved bead for celebration tooltip when step is completed and target value is reached
- Fall back to ones place heaven bead only when no last moved bead is available
- Reset last moved bead tracking when navigating between steps/multi-steps

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-24 11:09:51 -05:00
Thomas Hallock
d42dca2b4e fix: add optional chaining to prevent TypeScript error
- Fixed undefined currentStepBeads.some() error with optional chaining
- Added fallback to false when currentStepBeads is undefined

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-24 11:07:15 -05:00
Thomas Hallock
5082378ec3 fix: ensure celebration tooltip shows when steps complete
- Fixed tooltip visibility logic to show celebration tooltip when step is completed
- Added fallback bead position (ones place heaven bead) for completed steps without current step beads
- Updated useMemo dependencies to prevent stale tooltip state

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-24 11:07:00 -05:00
Thomas Hallock
b5d75120fd fix: keep tooltip visible when step completed to show celebration
- Modify tooltipOverlay logic to show when isStepCompleted is true
- Add fallback to use first bead from currentStepBeads when no arrows present
- Add isStepCompleted to useMemo dependency array
- Ensures celebration tooltip appears even when step instructions disappear
- Now users will see the green "🎉 Excellent work!" transformation

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-24 11:00:32 -05:00
Thomas Hallock
057f71e795 feat: transform tooltip into celebration when step completed
- Remove separate success notification components entirely
- Transform existing tooltip into celebration state when isStepCompleted
- Change background from blue to green gradient with enhanced shadow
- Replace instructional content with "🎉 Excellent work!" message
- Add celebrationPulse animation and scale(1.05) transform
- Update tooltip arrow color to match celebration theme
- Maintains same positioning rules and collision detection
- Perfect "in your face" feedback without blocking interaction

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-24 10:58:46 -05:00
Thomas Hallock
7278590a54 feat: make success notification prominent but non-blocking
- Position notification directly above abacus center where user is focused
- Use bouncy entrance animation to grab attention without being obnoxious
- Larger, more celebratory design with gradient and better typography
- Still auto-dismisses and has pointer-events:none for speed running
- "In your face" visibility while maintaining smooth user flow

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-24 10:54:52 -05:00
Thomas Hallock
ec40a8d3cb fix: position success toast near abacus instead of app nav
- Change position from 'fixed' to 'absolute' to be relative to tutorial container
- Move from top-right corner of viewport to top-right of abacus area
- Now appears where users are actually looking instead of distant app nav
- Toast notification is much more noticeable and contextually relevant

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-24 10:53:02 -05:00
Thomas Hallock
c12a4fc7f0 refactor: replace intrusive success popup with subtle toast notification
- Replace large center-screen modal with small top-right toast
- Change from blocking 320px modal to non-blocking compact notification
- Auto-dismiss after 3 seconds instead of requiring click
- Use pointer-events: none to avoid interfering with user interactions
- Simple "✓ Step completed!" message instead of elaborate celebration
- Maintains user flow for speed running while still providing feedback

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-24 10:52:20 -05:00
Thomas Hallock
ff12bab8ab feat: connect TutorialPlayer to universal AbacusDisplayContext
- Import useAbacusDisplay from AbacusDisplayContext
- Use abacusConfig.colorScheme instead of hard-coded "place-value"
- Add abacusConfig.beadShape and abacusConfig.hideInactiveBeads props
- Tutorial abacus now respects universal style controls in app nav

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-24 10:37:29 -05:00
Thomas Hallock
b5def407fd refactor: clean up debug logs from bead highlighting investigation
- Remove debug console logs from TutorialPlayer getCurrentStepBeads
- Remove debug logs from stepBeadHighlights useEffect
- Remove debug logs from AbacusReact getBeadStepHighlight function
- Restore normal legacy highlighting system functionality

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-24 10:31:09 -05:00
Thomas Hallock
fda1451f8b refactor: migrate TutorialPlayer to use unified TutorialContext state
- Replace local useReducer with TutorialContext hooks for single source of truth
- Update navigation functions to use context versions (goToStep, goToNextStep, etc.)
- Migrate multi-step actions to use context functions (advanceMultiStep, previousMultiStep)
- Wrap handleValueChange to track user interaction for step advancement logic
- Remove duplicate state management and consolidate into context pattern

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-24 09:30:09 -05:00
Thomas Hallock
3d9d69c6fb fix: enhance collision detection to include all active beads
- Check for beads against reckoning bar (heaven beads when value ≥ 5, earth beads when value % 5 > 0)
- Include beads with direction arrows in collision detection
- Ensure tooltip never covers any bead contributing to current value or with instructional arrows

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-24 08:44:10 -05:00
Thomas Hallock
e104033371 feat: implement smart tooltip positioning to avoid covering active beads
- Add collision detection to check for active beads in columns to the left
- Position tooltip to the left when safe, above heaven bead when collision detected
- Remove fixed left margin since tooltips can now position above when needed
- Ensure tooltip never covers beads with direction arrows or highlights

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-24 08:20:07 -05:00
Thomas Hallock
41dde87778 fix: prevent premature step completion for multi-step problems
- Only mark step as completed when all pedagogical multi-steps are finished
- Prevents "Excellent Work" popup from showing when users skip to final answer
- Maintains correct behavior for single-step problems

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-24 08:08:15 -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
8a9065dd9b refactor: remove duplicate guidance content for multi-step problems
- Hide action description for multi-step problems to avoid duplicating pedagogical decomposition
- Remove redundant bead diff summary from guidance pane (now shown only in tooltip)

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-24 08:02:31 -05:00
Thomas Hallock
306682632e feat: add click-to-dismiss functionality for success popup
- Add isSuccessPopupDismissed state that resets on step changes
- Make success overlay clickable with pointer events enabled
- Add hover effects and cursor pointer for better UX

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-24 08:01:56 -05:00
Thomas Hallock
43f02eb539 feat: replace inline success message with stunning floating overlay
Replace the inline success message that caused abacus layout shift with a
beautiful fixed-position glassmorphism overlay featuring:

- Fixed center positioning to prevent layout shift
- Glassmorphism design with backdrop blur and gradients
- Smooth animations (pulse in, bounce emoji, shimmer effect)
- Non-interactive (pointerEvents: none) to avoid UI conflicts
- Celebration design with emoji and elegant typography

This eliminates the UX problem where completing steps moved the abacus,
while providing fantastic visual feedback for user achievements.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-23 19:20:38 -05:00
Thomas Hallock
44256277a1 fix: add tooltip targeting logic to only show on beads with arrows
Add findTopmostBeadWithArrows helper function that filters beads to only
include those with actual direction indicators, preventing tooltips from
appearing on irrelevant beads without highlighting.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-23 18:47:58 -05:00
Thomas Hallock
f954c91a87 refactor: migrate TutorialPlayer to React Context pattern
Replace prop drilling with centralized state management using React Context.
TutorialPlayer now uses TutorialProvider wrapper with custom hooks for
clean access to state, actions, and computed values while preserving
all existing functionality.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-23 12:10:24 -05:00
Thomas Hallock
c2209883ef style: implement slicker guidance box with glassmorphism design
- Enhanced main guidance container with gradient backgrounds and glassmorphism effects
- Added layered shadows, backdrop blur, and subtle gradient overlays
- Improved typography for heading, decomposition text, and instructions
- Enhanced mathematical term highlighting with gradient backgrounds and modern shadows
- Maintained same screen footprint while creating more visually appealing interface
- Applied contemporary design principles for engaging yet non-distracting presentation

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-23 08:59:25 -05:00
Thomas Hallock
43e046ae6c fix: make lightbulb emoji inline with help text
- Move 💡 emoji from separate paragraph to inline with suggestion text
- Add proper spacing with margin-right
- Create cleaner, more natural hint presentation

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-23 08:55:54 -05:00
Thomas Hallock
a6920918cc refactor: unify guidance section with cleaner headings
- Add single 'Guidance' heading for entire tutorial help section
- Remove redundant 'Problem Breakdown:' and 'Current Step:' sub-headings
- Replace 'Next Action:' with intuitive lightbulb emoji (💡)
- Create cohesive guidance experience with less visual noise
- Maintain all functionality while improving information hierarchy

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-23 08:54:19 -05:00
Thomas Hallock
9cc3a0ea9b fix: stabilize smart help detection with timer-based state
- Replace unstable render-time calculations with useState timer
- Add useEffect to manage 8-second help timer lifecycle
- Reset help state when advancing to new multi-step
- Fix issue where help only appeared momentarily during bead transitions
- Simplify logic: help shows after 8 seconds if user needs to act
- Provide stable, persistent help display until step completion

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-23 08:50:24 -05:00
Thomas Hallock
933b94856d feat: implement smart help detection for Next Action display
- Add multiStepStartTime tracking to monitor user progress
- Hide Next Action by default to reduce interface clutter
- Show help only when user appears confused or stalled:
  - After 10 seconds on current step (general confusion)
  - After 5 seconds if user has wrong value (specific confusion)
- Reset timer when advancing to next multi-step
- Provides contextual assistance without overwhelming users

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-23 08:46:59 -05:00
Thomas Hallock
589674347c refactor: remove redundant step numbering and term display
- Remove step number from current instruction display
- Remove mathematical term repetition in current step
- Pedagogical breakdown with highlighting provides sufficient context
- Cleaner, more focused interface without redundant information

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-23 08:44:44 -05:00
Thomas Hallock
477809c4f0 refactor: simplify tutorial UI by showing only current step
- Replace step-by-step list with single current step display
- Hide non-current steps to reduce visual clutter
- Inline highlighting in pedagogical breakdown provides sufficient progress indication
- Cleaner interface focuses user attention on current action
- Maintains all functionality while reducing cognitive load

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-23 08:43:06 -05:00
Thomas Hallock
538d356f03 feat: implement precise inline highlighting of pedagogical terms
- Add termPosition field to ExpectedStep interface
- Update renderHighlightedDecomposition to use precise string positions
- Replace problematic indexOf approach with exact position data
- Integrate position information from unified step generator
- Fix issue with repeated mathematical terms in decomposition
- Improve pedagogical feedback by highlighting current term precisely

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-23 08:39:49 -05:00
Thomas Hallock
aafee3a25a feat: hide Next Action when at expected starting state for current step
Implement precise logic to avoid redundant Next Action display:

- First step (index 0): Hide if currentValue === tutorial step startValue
- Subsequent steps: Hide if currentValue === previous step's targetValue

This ensures users see step instructions without redundant bead movement
guidance when they're at the natural starting point for each step, while
still providing helpful guidance when they're mid-action or off-track.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-23 08:22:04 -05:00
Thomas Hallock
bb1fcd7f47 improve: better filtering for redundant Next Action display
Enhanced the logic to hide "Next Action" in more cases:
- Check if currentValue matches stepTargetValue (existing)
- Check if summary contains "No changes needed" (new)
- Only show when there are actual meaningful changes to display

This should reduce redundant information while maintaining helpful guidance
when users genuinely need specific bead movement instructions.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-23 08:18:10 -05:00
Thomas Hallock
ed3d89667e feat: hide Next Action when current state matches step target
Only display the bead diff summary ("Next Action") when the current abacus
value differs from the target value for the current step. This eliminates
redundant information and provides a cleaner user experience.

Logic:
- Compare currentValue with expectedSteps[currentMultiStep].targetValue
- Show "Next Action" only when values don't match
- Automatically hides when user completes the step action
- Maintains pedagogical term display regardless of completion state

This creates a more intelligent UI that shows guidance only when needed.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-23 08:15:12 -05:00
Thomas Hallock
cf1d6b8d35 refactor: position bead diff summary directly under current step
Move the "Next Action" bead movement feedback from the bottom of the step list
to appear directly underneath the current active step. This creates better
visual grouping and clearer association between the step and its required actions.

Changes:
- Wrapped each step in a div to allow inline content
- Positioned bead diff summary with proper left margin alignment
- Removed duplicate "Next Action" section at bottom
- Maintains all existing styling and functionality

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-23 08:12:31 -05:00
Thomas Hallock
408eb58792 feat: display pedagogical terms inline with current tutorial step
Show mathematical terms (e.g., "10", "(5 - 1)", "-6") as badges next to the current
step in the Step-by-Step Instructions list. This provides clear context about the
mathematical reasoning behind each step.

Features:
- Added ExpectedStep interface with mathematicalTerm field
- Blue-styled badge appears only for the current active step
- Integrates pedagogical decomposition directly into the UI
- Properly typed with TypeScript for maintainability

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-23 08:09:38 -05:00
Thomas Hallock
4807bc2fd9 feat: add real-time bead movement feedback to tutorial UI
Surface the bead diff summary as "Next Action" hints in the Step-by-Step Instructions panel.
Provides real-time pedagogical feedback like "remove heaven bead in tens column, then add 4 earth beads in ones column"
to help users understand exactly what bead movements are needed for each step.

Features:
- Dynamic bead diff summary calculation for current step
- Styled feedback panel with blue color scheme
- Only shows when there are actual bead movements needed
- Updates in real-time as user progresses through multi-step sequences

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-23 08:00:31 -05:00
Thomas Hallock
96fda6b919 fix: resolve stepIndex mismatch preventing arrows in multi-step sequences
The bead diff calculation was hardcoding stepIndex to 0, but AbacusReact's
getBeadStepHighlight function only shows arrows when stepIndex matches currentStep.
This caused arrows to only appear for the first multi-step instruction.

Fixed by setting stepIndex to currentMultiStep to match the AbacusReact filtering logic.
Also removed debugging console logs used to isolate this issue.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-23 07:57:31 -05:00