fix(studio): a timeline scrubs when its host omits sessionEpoch (#4742)

* fix(studio): a timeline scrubs when its host omits sessionEpoch

* fix(studio): drop the added comment for the comment ratchet
This commit is contained in:
Miguel Ángel
2026-09-30 02:02:46 +00:00
committed by GitHub
parent daa44fcd75
commit 7a1869d921
2 changed files with 9 additions and 1 deletions
@@ -108,4 +108,11 @@ describe("Timeline ruler origin", () => {
expect(origin).toBe("80px");
expect(published).toBe("80");
});
it("seeks on a press when the host omits sessionEpoch after a session began", async () => {
usePlayerStore.getState().beginTimelineSession("host-project");
expect(usePlayerStore.getState().timelineSessionEpoch).toBeGreaterThan(0);
const { time, tickTime } = await seekOnFirstTick({}, false);
expect(time).toBeCloseTo(tickTime, 1);
});
});
@@ -66,7 +66,7 @@ export function useTimelineProviderState({
showAudioEffects = true,
showKeyframes = true,
trackPadding,
sessionEpoch = 0,
sessionEpoch: sessionEpochProp,
previewIframeRef,
onZIndexReorder,
}: TimelineProps = {}): TimelineContextValue {
@@ -108,6 +108,7 @@ export function useTimelineProviderState({
const currentTime = usePlayerStore((s) => s.currentTime);
const beatDragging = usePlayerStore((s) => s.beatDragging);
const timelineSessionEpoch = usePlayerStore((s) => s.timelineSessionEpoch);
const sessionEpoch = sessionEpochProp ?? timelineSessionEpoch;
const setFocusedEaseSegment = usePlayerStore((s) => s.setFocusedEaseSegment);
const { zoomMode, manualZoomPercent, setZoomMode, setManualZoomPercent } = useTimelineZoom();
const playheadRef = useRef<HTMLDivElement>(null);