video-mode: snap a sliver of selector lead-in forward to the first highlight (main CI flake) - #41
Open
mmkal wants to merge 1 commit into
Open
video-mode: snap a sliver of selector lead-in forward to the first highlight (main CI flake)#41mmkal wants to merge 1 commit into
mmkal wants to merge 1 commit into
Conversation
…ghlight #40 clamped a selector trim start that landed AFTER a highlight. CI kept flaking on the mirror case: a start a sliver (36-92ms measured) BEFORE the first highlight. That sliver is raw footage from the recording's very first frames, and on a slow runner the screencast starts so late that those frames already show the action's result - the rendered video opened on the filled, expanded textarea one frame before the reveal's empty still (confirmed from the CI run's own raw/rendered artifacts: the 2.0s raw video has text at t=0.04s). A lead-in shorter than the fill stabilization window (max(0, timelineOffset) + 3 frames) is not worth keeping; open on the first highlight instead. Longer lead-ins are untouched. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
commit: |
mmkal
marked this pull request as ready for review
August 26, 2026 23:06
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #40, which fixed the after case. Main still flakes on
reveals an expanding textarea one line at a time at its final geometry(1/2 on main's latest run, 3/3 on #39) with the mirror case.Diagnosed from the CI run's own artifacts (
gh run download): the selector trim start lands a sliver before the first highlight (36ms / 92ms / 54ms across the three attempts), so the render opens with ~1 frame of raw footage before the waitFor hold. On a slow runner the screencast starts so late that its very first frames already show the fill's result — the CI raw video is 2.0s long with text present at t=0.04s — so that opening frame is the filled, expanded textarea, one frame before the reveal's empty still:First six rendered frames from the failing CI run — frame 0 is the filled, expanded textarea; frames 1-5 are the hold with the empty textarea:
A lead-in shorter than the existing fill stabilization window (
max(0, timelineOffset) + 3 frames) isn't worth keeping and can't be trusted on a lagging recorder, so the start now snaps forward to the first highlight. Longer lead-ins are untouched; #40's after-case clamp stays.Runner-timing-specific like #40 — this PR's CI run is the verification. Blocks #39.
🤖 Generated with Claude Code
Session:
b7f6f792-6606-44be-9ec3-207eb762c4b6Note
Medium Risk
Changes rendered video trim boundaries for selector-based starts on slow runners; scoped to short lead-ins but affects pixel-accurate video assertions if they depend on exact first frames.
Overview
Extends selector trim start correction in
video-moderender finalization: after the existing clamp when trim start lands after a highlight (#40), it now handles the mirror case when trim start sits a short sliver before the first highlight.If
sourceRange.startis within the fill stabilization window (max(0, timelineOffset) + 3 frame durations), it snaps forward tofirstHighlightStartinstead of keeping ~1 frame of raw screencast. That avoids opening on lagging-recorder frames that already show post-fill UI (e.g. expanded textarea) before a fill-reveal hold.Longer lead-ins are unchanged; only sub-tolerance gaps are adjusted.
Reviewed by Cursor Bugbot for commit 52054c5. Bugbot is set up for automated code reviews on this repo. Configure here.