fix(x): product tour stuck on first step in dev (StrictMode double-mount) - #842
Open
YarnMeister wants to merge 1 commit into
Open
fix(x): product tour stuck on first step in dev (StrictMode double-mount)#842YarnMeister wants to merge 1 commit into
YarnMeister wants to merge 1 commit into
Conversation
In dev, StrictMode's double-invoked effects (mount -> cleanup -> mount) break the tour's step effect: settle() marks the step as entered via enteredStepRef before startTravel() begins, the StrictMode cleanup then cancels the travel rAF loop, and the second run sees the step already entered so it takes the resize branch — jumping the mascot to its destination without ever flipping `arrived`. The speech bubble (and its Next button) only render once `arrived` is true, so the tour dims the screen and dead-ends on step 1 with a motionless boat. Fix: roll the entered marker back in the effect cleanup when the run it belongs to started the entry but was torn down before arrival. Resize re-runs enter with `entering === false`, so the existing jump-and-keep- the-bubble behavior is unchanged. Production builds are unaffected (StrictMode double-invocation is dev-only), which is why packaged releases never showed this. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Running
npm run devand clicking Take a tour dims the screen and shows the water/spotlight, but the boat never rows anywhere and the speech bubble (with the Next button) never appears — the tour dead-ends on step 1 of 12. Packaged builds are unaffected.Root cause
The renderer mounts the app in
<StrictMode>(main.tsx), and React 19 double-invokes effects in dev (mount → cleanup → mount). The tour's step effect doesn't survive that round trip:entering = true→settle()setsenteredStepRef.current = stepIndexbeforestartTravel()begins the rAF travel loop.cancelled = true; cancelTravel()kills the loop.enteredStepRef.currentalready matches, soentering = false→ the effect takes the resize branch ("jump, keep the bubble up"), which moves the mascot to its destination and returns —setArrived(true)never fires.Since the bubble only renders when
arrivedis true, the tour is permanently stuck. Traced via CDP: mascot frozen at its computed destination transform, wakestrokeDashoffsetnever written, zero exceptions.Fix
Roll the entered marker back in the effect cleanups when the run that set it was torn down before arrival:
Resize-triggered re-runs execute with
entering === false, so the existing jump-without-re-rowing behavior is preserved.Verification
npm run typecheck:rendererandnpm run lintpass.🤖 Generated with Claude Code