fix(lab): preserve explicit replay seeks

This commit is contained in:
DCCONSTRUCTIONS
2026-08-24 00:41:29 +03:00
parent 8877ee947f
commit 7400fe2fd7
2 changed files with 24 additions and 1 deletions
@@ -45,6 +45,13 @@ export function synchronizeRecordedEvidencePlayback(
observed: RecordedObservationPlayback,
range: RecordedEvidencePlaybackRange,
): RecordedObservationPlayback {
if (!current.playing) {
// A paused transport also covers every explicit operator seek. Native
// callbacks from the previously displayed frame remain stale until the
// controlled video effect has applied that target, so they cannot move the
// shared LAB clock at all while the operator state is paused.
return current;
}
const currentSeconds = clampRecordedEvidenceSeconds(observed.currentSeconds, range);
return {
...current,
@@ -403,7 +403,23 @@ test("recorded VIDEO clock cannot reverse an explicit operator pause", () => {
{ currentSeconds: 15.1, playing: true, rate: 1 },
range,
),
{ currentSeconds: 15.1, playing: false, rate: 2 },
{ currentSeconds: 15, playing: false, rate: 2 },
);
assert.deepEqual(
synchronizeRecordedEvidencePlayback(
{ currentSeconds: 10, playing: false, rate: 2 },
{ currentSeconds: 15.1, playing: true, rate: 1 },
range,
),
{ currentSeconds: 10, playing: false, rate: 2 },
);
assert.deepEqual(
synchronizeRecordedEvidencePlayback(
{ currentSeconds: 12, playing: true, rate: 2 },
{ currentSeconds: 15.1, playing: true, rate: 1 },
range,
),
{ currentSeconds: 15.1, playing: true, rate: 2 },
);
assert.deepEqual(
synchronizeRecordedEvidencePlayback(