feat(webv2): reference trims as start + sample length with steppers; 200-frame default - #204
Open
lstein wants to merge 3 commits into
Open
feat(webv2): reference trims as start + sample length with steppers; 200-frame default#204lstein wants to merge 3 commits into
lstein wants to merge 3 commits into
Conversation
…steppers Reference frames cost denoise VRAM on every step, so the useful sample of a reference video is a short window (a few seconds), not the whole clip - and picking a small interval with independent start/end sliders meant fighting both ends. - The video reference card's second row is now the SAMPLE LENGTH in frames (min 1, max = frames remaining after start) instead of the end frame. Moving the start slides the window at constant length until it hits the clip's end. The row's thumbnail still shows the resulting end frame, badged with that frame number since the number field beside it now shows the length. - Newly added video references default to a 200-frame window (~8s at 24 fps; DEFAULT_REFERENCE_SAMPLE_FRAMES in core/settings) instead of the whole clip. - All trim sliders - both reference rows and the Initial Video's start/end - gain increment/decrement steppers (SliderNumberField's existing showStepper) for single-frame nudging. Storage is unchanged: clips still persist startFrame/endFrame, so the request contract, normalization and recall are untouched; length is derived as end - start + 1. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…the math - The reference-extend anchor's end frame stays PINNED to the Initial Video cutpoint: its start slider adjusts only the lead-in, and its length control grows the window backward from the pinned end (ceiling: the available lead-in). The first cut let a start-slider round trip silently detach the anchor's window from the seam. - An ordinary window's slide now stops at the clip's end instead of shrinking, so a transient drag overshoot can no longer ratchet a 200-frame sample down to 1 frame. - The window math moved to core/settings (slideReferenceSampleWindow / resizeReferenceSampleWindow), is self-healing by construction (0 <= start <= end <= numFrames-1 even from corrupt persisted trims, which the first cut could make worse), and has 11 unit tests covering the wall stop, anchor pinning, corrupt-trim healing and single-frame clips. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
lstein
marked this pull request as ready for review
September 3, 2026 15:10
lstein
requested review from
JPPhoto,
Pfannkuchensack and
blessedcoolant
as code owners
September 3, 2026 15:10
The two controls carry different units - a frame INDEX and a frame COUNT
- so the thumbnail badges alone did not say which was which. Give each
row the shared uppercase FieldLabel: 'Start Frame' and 'Sample Length'.
The length label also carries the window's duration in seconds
('Sample Length · 8.3s'), since hitting a target sample duration is the
point of the control while its unit has to stay frames to match the trim
contract. Guarded on a positive finite fps; falls back to the bare
'Sample Length (Frames)' label otherwise, which remains the aria label
in both cases.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Why
Reference frames cost denoise VRAM on every step (the packed sequence grows with reference length), so the useful sample of a reference video is a few seconds — but picking a small interval with independent start/end sliders meant fighting both ends.
What
DEFAULT_REFERENCE_SAMPLE_FRAMES) instead of the whole clip.Storage is unchanged — clips persist
startFrame/endFrame, so the request contract, normalization, metadata recall and old generations are untouched; length is derived.Testing
core/settingsas pure functions with 11 new unit tests (constant-length slide, wall stop, anchor pinning both directions, corrupt-trim self-healing, single-frame clips).pnpm lint, unit suite (7436), browser suite (1036), and the architecture gate all pass.🤖 Generated with Claude Code