kasuti: shared replay URL lands on empty board, no confetti

Hydration now pre-arms celebratedRef so the completion effect skips
both the confetti and the replayIdx=stitches.length snap. The viewer
lands on an empty fabric with the full tour queued up and drives
playback from the replay controls — no spoiler, and no party popper
on someone else's accomplishment.

https://claude.ai/code/session_01KNdXjQczMCRGMK7K3Qderw
This commit is contained in:
Claude 2026-04-22 11:49:56 +00:00
parent 0378978b1f
commit 39d173ab75
No known key found for this signature in database

View file

@ -1095,6 +1095,10 @@ const KasutiEmbroidery: React.FC = () => {
setCurrentVertex(from);
setActiveSide(rebuilt.length % 2 === 0 ? 'front' : 'back');
setStitches(rebuilt);
// Pre-arm the celebration flag so the completion effect leaves replayIdx
// at 0 and doesn't fire confetti — URL arrivals should land on an empty
// board and press play themselves to watch the tour get stitched in.
celebratedRef.current = true;
setCompleted(true);
hydratedRef.current = true;
}, []);