Skip to content

Keep rendered fill frames in chronological order - #20

Merged
mmkal merged 14 commits into
mainfrom
fix/video-mode-future-fill-frame-leak
Aug 4, 2026
Merged

Keep rendered fill frames in chronological order#20
mmkal merged 14 commits into
mainfrom
fix/video-mode-future-fill-frame-leak

Conversation

@mmkal

@mmkal mmkal commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Rendered fills now stay chronological at both sides of the synthetic reveal:

  • a future field can’t appear over an earlier page
  • the completed value can’t flash before its letter-by-letter reveal
  • a sparse screencast boundary can’t show an isolated field crop over black
before: earlier page + future field -> completed value -> reveal
after:  earlier page -> empty field -> reveal -> completed value

The renderer now limits pre-action stabilization to the measured recorder offset at the fill boundary, plus three native frames for compositor/concat variance. The cut is rounded to the source-frame grid. It leaves the unrelated raw gap untouched and uses the exact full-page action screenshot only for the short boundary slice.

Two separate public-behavior frame regressions protect the ordering in each direction. The completed-value case also requires every visible field to retain its current page, covering sparse raw recordings.

Validation

  • 104 passed, 3 provider-gated skips
  • both ordering regressions: 20/20 together with two workers
  • all 11 scrolling, resizing, gradient, cursor, and text-reveal fill cases
  • typecheck
  • build
  • publint
  • native 25fps boundary frames inspected

Before vs after

Left: the old whole-gap stabilization. Right: the frame-scoped fix.

fill-ordering-before-after.mp4

The old render pastes the future blue Title field over the red sign-in page. The fixed render keeps the sign-in page intact, then holds the empty field until its progressive reveal.

Codex session: 019fc6f7-2b26-73b3-9f9b-18b59e8bdda5


Note

Medium Risk
Changes FFmpeg piece splitting, boundary-frame compositing, and fill stabilization timing in the video renderer—complex post-processing logic with frame-level regressions but no auth or data handling.

Overview
Rendered fill ordering is tightened so synthetic progressive reveals never leak completed text or future field crops onto the wrong page state.

Pre-action stabilization is no longer applied across entire raw gaps before a fill. The renderer splits the gap at a frame-aligned boundary using the measured timeline offset plus three native frame padding (VIDEO_MODE_FILL_PRE_ACTION_FRAME_PADDING). Short boundary slices use the full-page action screenshot as the whole frame instead of compositing an isolated input crop over black when screencast packets are sparse. FFmpeg highlight still inputs are looped without per-highlight duration caps; each consumer trims to its rendered piece.

Tests: The earlier-page/future-input regression is unskipped; a new regression rejects completed fill text before progressive reveal and isolated field crops without the editor page. The todo demo spec drops a redundant No todos yet wait. The text-cursor test uses trimStart: "never" and scans the full rendered video for cursor-then-reveal timing.

Reviewed by Cursor Bugbot for commit c318d5e. Bugbot is set up for automated code reviews on this repo. Configure here.

@pkg-pr-new

pkg-pr-new Bot commented Aug 3, 2026

Copy link
Copy Markdown

Open in StackBlitz

pnpm add https://pkg.pr.new/middlewright@20

commit: c318d5e

@mmkal
mmkal marked this pull request as ready for review August 3, 2026 21:14

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 59c8de0. Configure here.

Comment thread src/plugins/video-mode.ts
@mmkal mmkal changed the title Stop future fill frames leaking into earlier video Keep rendered fill frames in chronological order Aug 4, 2026
@mmkal
mmkal merged commit 6f7c4e6 into main Aug 4, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant