test: pin presentation rehearsal branches

This commit is contained in:
lda
2026-07-12 01:03:23 +07:00 Verified
parent cd8bbbcc27
commit a5e955f702
2 changed files with 23 additions and 2 deletions
+4 -2
View File
@@ -321,16 +321,18 @@ export const useDemoTimeline = (
const primeReplayToStage = useCallback((stage: DemoEvent["stage"] | null) => {
if (stage === null || state.mode !== "replay") return;
const isRevisionBranch = state.events.some((event) => event.id === "revision-3-run-resume");
if (isRevisionBranch) return;
const recording = activeRecording.current;
if (!recording) return;
// The revision request updates the active recording before its reducer
// action is visible. Read this ref so a direct hash change cannot re-prime
// the canonical submitted branch during that render gap.
const appliedCount = appliedCountForStage(recording.events, stage);
if (appliedCount === 0) return;
// Presentation priming projects the reviewed recording to the current beat.
// It is not runtime execution and must never run while the live timeline is active.
resetRuntime();
activeRecording.current = recording;
projectTransientState(recording.events, appliedCount);
dispatch({
type: "prime_replay",