Skip to content

feat(webv2): video conditioning media — keyframes, initial video, and trim - #128

Merged
lstein merged 10 commits into
mainfrom
feat/video-panel-05-media
Aug 22, 2026
Merged

lstein merged 10 commits into
mainfrom
feat/video-panel-05-media

Conversation

@lstein

@lstein lstein commented Aug 20, 2026

Copy link
Copy Markdown
Collaborator

PR 5 of the Video generation panel stack — stacked on #127. All five conditioning modes now work from the panel.

What this adds

Initial Video Frames — first- and last-frame fields (gallery drag, file upload with account-scope-guarded async, clear), rendered per the capability matrix: both for I2V-A14B and MiniMax H3, first-only for TI2V-5B, neither for T2V-A14B.

Initial Video — gallery/upload intake building the source-clip record (frame count estimated from duration × fps — the records store no exact count), start/end trim sliders with a live frame preview (one long-lived muted <video> seeked via currentTime, the frame-scrubber trick — no per-drag-tick refetches), and a 2-frame minimum trim enforced in the setters, the defaults, and validation (the crossfade join consumes a 2-frame tail; a 1-frame trim would fail mid-encode).

Estimate-proof trim compilation — a trim end at or near the estimated ceiling compiles as a negative index, which the backend resolves against the clip's real frame count, so "keep to the end" can never land past it on a VFR upload whose estimate overshoots (the bundled templates' end_frame: -2 robustness, preserved). Mid-clip picks stay positive.

Mutual exclusion — as designed in the stack's kickoff: first frame ⊻ initial video (each setter clears the other; whichever is set disables the other's field with an explanation), while a last frame combines with either — FLF2V interpolation with a first frame, the extension's destination with a source video.

Dimension/FPS locking — conditioning media disables the aspect preset and orientation swap, and the derived-size readout names its source ("from the first frame"); Wan's FPS control disables in extend mode and the duration readout switches to the source clip's rate (the extension inherits it).

Housekeeping — deleted gallery images/videos reconcile out of the panel (patching only the cleared slots), the optimistic-rollback registry covers the three media slots, and a media value the current model can't consume (persisted from another model, or restored by a rollback) renders as a visible clear-stub instead of blocking invoke invisibly.

Smoke-test follow-ups (added during review)

  • The frames section is now titled "Start & End Images" (was "Initial Video Frames").
  • Trim bound thumbnails — the Initial Video section shows two small always-visible previews of the start and end frames of the kept range (same one-element seek trick), so both ends stay in view while either slider moves.
  • Preview drag parity for videos — the preview widget's video frame gets a corner grip handle carrying the same gallery-item drag payload as gallery thumbnails, so a previewed video can be dragged into video-accepting inputs just like a previewed image. The <video controls> surface itself can't be the handle (drag activation would fight the native seek bar), and the grip is deliberately unfocusable: a focusable activator would let the KeyboardSensor start an invisible Enter/Space drag that Tab then drops on the closest-center droppable — a defect the follow-up's own adversarial review caught, fixed, and pinned with a browser-test assertion.

Verification

  • Adversarial fresh-context review executed against the commit; all five confirmed findings fixed with regression tests (estimate-overshoot trim failure, sub-2-frame trims — including the default on ultra-short clips, invisible policy-hidden media blocking invoke, wrong duration readout in extend mode, whole-settings rewrite in the deletion reconciler). One race-gated finding is accepted and documented: a failed gallery deletion's rollback can restore a first frame alongside a later-set initial video; normalization resolves it first-frame-wins, and the clear-stub/setters recover.
  • 117 video-feature tests; full webv2 suite 477 files / 6328 tests; tsc / oxlint / format clean; browser perf baseline regenerated.

🤖 Generated with Claude Code

lstein and others added 2 commits August 20, 2026 22:34
… trim

Adds the conditioning inputs to the Video panel (PR 5 of the stack):

- Initial Video Frames: first- and last-frame fields (gallery drag,
  file upload, clear), shown per the capability matrix — both for
  I2V-A14B and MiniMax H3, first-only for TI2V-5B, neither for T2V.
- Initial Video: gallery/upload video intake with start/end trim
  sliders and a live frame preview (a muted <video> seeked to the
  active trim bound, the workflow scrubber's trick). The default trim
  drops the source's final frame, matching the bundled extend
  templates' end_frame: -2 seam handling.
- The mutual exclusion lives in the setters: a first frame clears the
  initial video and vice versa; whichever is set disables the other's
  field with an explanation. A last frame combines with either — FLF2V
  interpolation with a first frame, the extension's destination with a
  source video.
- Dimensions lock while conditioning media is present: the aspect
  preset and orientation swap disable and the derived-size readout
  names its source; Wan's FPS control disables in extend mode (the
  extension inherits the source clip's rate).
- Deleted gallery media reconciles out of the panel (images and
  videos), and the optimistic-rollback registry covers the three new
  media slots.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…edia

Capture this branch's editor/launchpad footprint on top of the re-based
parent baseline; platform-ui barrel importer budget raised to the actual
count (158).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@lstein
lstein force-pushed the feat/video-panel-05-media branch from c75cc30 to b8c17bd Compare August 21, 2026 02:37
lstein and others added 8 commits August 20, 2026 23:00
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The preview's video surface gets a corner grip handle carrying the same
gallery-item drag payload as gallery thumbnails, closing the image/video
drag parity gap (the video element itself cannot be the handle without
breaking native seek-bar scrubbing).

Review hardening: the grip is deliberately unfocusable — a focusable
activator would let the shell's KeyboardSensor start an invisible
Enter/Space drag that Tab then drops on the closest-center droppable
(silently replacing e.g. a configured initial video). The source-clip
memo comparator now also compares fps, which the new bound thumbnails
consume for seek times.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JYSJ8DZR42nUUhZagaga2z
Top-center instead of a corner: every corner belongs to some browser's
own video overlays (fullscreen, picture-in-picture).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JYSJ8DZR42nUUhZagaga2z
… media

- Compile tail-window trim STARTS as negative indices too: a keep-the-tail
  trim start stayed a positive estimate-based index and landed out of range
  exactly when the end's negative conversion saved it.
- Skip a rollback restore of firstFrameImage/sourceVideo when the rival
  exclusive slot was claimed while the delete was in flight — the restore
  was the one write path that could recreate the forbidden pair, which
  normalization then masked into a silently wrong generation mode.
- Run the deleted-media sweep against RAW widget slots: normalizing first
  let a masked reference survive deletion as a dangling media name.
- Validate the source clip's frame rate (1-120) for Wan extension up front:
  an out-of-range clip enqueued, ran the whole denoise, then died assigning
  fps to wan_l2v.
- Record fps and the source-clip trim bounds in Wan video metadata so
  parameter recall can restore them (recall reads them in the 08 branch).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LUjUcPHzQCoL7dqgsVzi63
Base automatically changed from feat/video-panel-04-panel to main August 22, 2026 17:26
@lstein
lstein merged commit 76dbd71 into main Aug 22, 2026
19 checks passed
@lstein
lstein deleted the feat/video-panel-05-media branch August 22, 2026 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant