Composition length was grow-only (extendCompositionDurationIfNeeded
ratcheted data-duration up on drop/stretch but nothing shrank it), so
deleting the last/longest clip left trailing empty space. Add
setCompositionDurationToContent (grow OR shrink) and sync data-duration
to the furthest remaining clip end on delete. Empty timeline keeps its
declared length (no collapse to 0). Trim/move shrink are follow-ups.
Completes the free-form timeline model:
- normalizeToZones is now kind-based (visual lanes on top, audio at the
bottom); deleted resolveMainOriginTrack + its main-track concept.
- Audio clips get a distinct violet tint (is-audio) vs teal-accented
visual clips, so the audio zone reads as separate at a glance.
- New-track insertion line is suppressed at/below the first audio lane
(inserting a visual track only makes sense in the visual zone).
Field-testing showed the auto-magnetic main track fights how HyperFrames
projects are actually authored (scenes on separate lanes, sequenced by
time; 20+ real comps are ~80% temporal sequence + audio + z-index layers;
track index is sparse logical grouping the renderer ignores).
- Drag preview lands on the hovered lane at the snapped time; overlaps
allowed. Removes collision-push (fixes 'cannot put two clips on one
track') and the main-track no-overlap magnet.
- commitDraggedClipMove: drop the main-track ripple branch; plain moves
are single SDK-aware persists. Track-insert still batches atomically.
- Delete now-dead reflowMainTrack + tests. Keep the atomic batched persist.
Design + prior plan docs included.
Main-lane drops now reflow the whole lane end-to-end (gap-close +
insert-ripple) and persist atomically via onMoveElements; track inserts
batch the dragged clip + shifts into one call (retiring F2's N racing
persists). Plain overlay/audio moves keep the single SDK-aware path.
One read / patch-all / save-once / one batched GSAP shift / one reload /
single undo, grouped per source file. Fixes the per-clip persist race
(HANDOFF §7.1) where concurrent GSAP round-trips corrupted the file.
Single-clip moves keep the SDK-cutover-aware handler; this serves the
new multi-clip ripple/insert paths (extracted to a module to keep
useTimelineEditing under the filesize gate).
Rebase reconciliation: main #2090 made crop always-on and removed
cropMode/onCropModeChange from DomEditOverlay. The R4 shell refactor
predated that and still threaded those props through EditorShell ->
PreviewOverlays. Drop the dead chain; crop is always-on now.
The .is-dragging drop-shadow overrode the selected-clip white outline;
re-state both together. Add a solid background so audio clips (waveform
on a separate layer) aren't see-through while being dragged.
When content is shorter than the visible area, the ruler + empty track
lanes continue into the space instead of leaving dead black on the
right (CapCut-style). Only the rendered extent grows; clip positions
and durations are untouched.
resolveMainOriginTrack tie-broke on the mutated track index, so two
equal-duration videos on distinct tracks oscillated lanes on every
re-zone. Tie-break on the stable clip id instead (invariant across
normalizeToZones passes).
buildTrackInsert row 0 returned track -1 (negative index corrupts the
persisted source). Insert above the top by shifting every other clip
down one; the dragged clip takes the old top index.