Warm the frame recorder before hiding the window at recording start
Template tests / tests (push) Successful in 1m52s
Template tests / tests (pull_request) Successful in 1m46s

The first screenshot of a session was late while every later one was fine.
Cause: on 'Start recording' the window hid first and the capture backend
started warming up after — creating worker, getUserMedia, first frame takes
~1s. A click in that gap found no buffered frame and took the post-click
fresh shot.

armRecording() now warms the recorder while the window is still visible and
only hides once frames are buffering (with a brief post-hide settle so the
first frame shows the user's screen, not the dismissed app window). Verified
end to end with a new self-test scenario that clicks 250ms after start: the
first click is now served a pre-click frame instead of a post-click shot.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Iisyourdad
2026-06-12 08:48:54 -05:00
parent 34cc358902
commit 0ab29e4ff0
4 changed files with 87 additions and 10 deletions
+4
View File
@@ -33,6 +33,10 @@ const DEFAULT_SETTINGS = {
// stream pixels lag slightly; a small lead keeps the saved screenshot
// clear of the click's onset. Raise it if screenshots still feel late.
clickLeadMs: 120,
// After the window hides at recording start, wait this long before the
// user is likely to click so the buffer holds frames of the now-visible
// screen rather than the just-dismissed app window.
postHideSettleMs: 150,
},
editor: {
focusedViewDefaultForNewSteps: false,