Repository navigation
video-mode: render a popup that is left open correctly - #45
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A popup the test leaves open (acts in it, then carries on in the opener) rendered over the opener's final state, turned solid black for a second, and the video ended on a black frame. - Cover detection only looks inside the screencast's own area. Playwright pads a viewport that doesn't scale evenly into the video (1280x900 into 800x562 leaves a 2px gray strip), so the every-pixel check never matched and calibration fell back to endpoint arithmetic, ~0.9s out. - The wall->raw offset may be negative (the recorder's first frame lands ~100ms after clock zero) and is the earlier of the cover and endpoint readings: each fails late in its own way, and late is what shows. - A popup still open slides away when the test goes back to its opener. The composite splices in a short freeze for the exit, since the opener's next action follows within milliseconds; self-closing popups exit the same way and the old highlight-shifting loop is gone. - The test's end is stamped before popup recorders settle, and a popup closed by teardown is recorded as never closed. - A popup never starts on the first frame, its footage from before time 0 is trimmed, the opener's frames around a popup's birth are dropped (Chrome's "Debugger paused in another tab"), and a popup's last highlighted state is held 150ms before its teardown cover. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ge in the popup composite CI showed what moving annotations earlier costs: the render starts that far into the test's clock, and the frame-exact specs sample rendered frames at clock-derived times. On the slow runner, where instant specs get ~80ms of footage before the cover, two failed outright. The main timeline goes back to its old rule (cover reading clamped at 0), except that the endpoint reading may pull it earlier and can no longer push it later. The popup composite, which re-times footage anyway, holds the opener's footage back by the part of the cover reading the main timeline ignored. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
commit: |
PR SummaryMedium Risk Overview Calibration: Left-open popups: Overlays end at popup close, first opener highlight after the popup’s last action, or footage end. Exit uses composite freezes ( Adds Reviewed by Cursor Bugbot for commit baac1e7. Bugbot is set up for automated code reviews on this repo. Configure here. |
A popup the test leaves open rendered wrongly: it sat over the opener's final state, turned solid black for about a second, and the video ended on a black frame.
Before (main,
spec/popup-video-left-open.spec.ts):popup-left-open-before.mp4
After:
popup-left-open-after.mp4
The popup now shows over the opener as it was at that moment, slides away when the test goes back to the opener, and the video ends on the opener's last state.
Cause
closedAtwere stamped after that.Changes
detectCalibrationCoverStartMscrops to the screencast's own area (viewport scaled into the video, 4px inset)footageLeadInMs: the composite holds the opener's footage back by the part of a negative cover reading the main timeline ignoredchildCompositeLayers: a popup closes at the first of its close event, the first opener highlight after its last one, or the end of its footageVideoModeFreeze,compositeTimeMs/compositeEndMs/compositeVideoTimeline;compositeChildOverlaysapplies freezes withsetptsstate.endedAt, stamped by the first finalizer; the popup finalizer no longer stampsclosedAtclosedAtdoc already said.CHILD_BIRTH_OPENER_HOLD_MS: opener frames around a popup's birth are droppedCHILD_FINAL_STATE_HOLD_MS(150ms, only if the test ends that soon after a popup highlight);projectChildHighlightgives every popup highlight a slice inside the overlay windowspec/popup-video-left-open.spec.tssigned-out app→popup over signed-out app→signed-out app→signed-in app), plus a popup still open at test end. On main both fail with"black"scenes.Worth a look
Self-closing popups now exit on a freeze too. The existing demo (
spec/popup-overlay-demo.spec.ts), main first, then this branch. Main's has black frames as the popup leaves:popup-demo-before.mp4
popup-demo-after.mp4
Verification
video-mode-ffmpeg.spec.ts4x over: 152 passed.spec/video-mode-ffmpeg.spec.ts"returns from an offscreen blur pan…" failed once in an earlier 3x full-suite run, and once on main in the same kind of run: the recording captured nothing but the cover. Not addressed here.Not done
Baseline (
spec/todo-app.spec.ts)Rendered, 20.52s, same length as main:
todo-app-rendered.mp4
Raw Playwright recording:
todo-app-raw.mp4
Coding agent session: "Fix video mode's popup compositing",
local_d2f641a1-e7f9-4d67-99c1-df2c2ee4f4aa(CLI51fbfdea-aef4-46e0-ac4d-8e7700eb7e15)🤖 Generated with Claude Code