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>
This commit is contained in:
Thomas Hallock
2025-09-23 08:22:04 -05:00
parent bb1fcd7f47
commit aafee3a25a

View File

@@ -834,11 +834,20 @@ export function TutorialPlayer({
const mathTerm = expectedSteps[index]?.mathematicalTerm
const isCurrentStep = index === currentMultiStep
// Get the target value for this step to check if we need to show "Next Action"
const stepTargetValue = expectedSteps[index]?.targetValue
const hasChangesNeeded = currentValue !== stepTargetValue
// Hide "Next Action" when at the expected starting state for this step
const isAtExpectedStartingState = (() => {
if (index === 0) {
// First step: check if current value matches tutorial step start value
return currentValue === currentStep.startValue
} else {
// Subsequent steps: check if current value matches previous step's target
const previousStepTarget = expectedSteps[index - 1]?.targetValue
return currentValue === previousStepTarget
}
})()
const hasMeaningfulSummary = currentStepSummary && !currentStepSummary.includes('No changes needed')
const needsAction = isCurrentStep && hasChangesNeeded && hasMeaningfulSummary
const needsAction = isCurrentStep && !isAtExpectedStartingState && hasMeaningfulSummary
return (
<div key={index}>