Commit Graph
2519 Commits
Author SHA1 Message Date
ukimsanov 34ec0a3e84 fix(studio): persist normalized track indices on lane change (no more overlap)
Root cause of clips overlapping on one track: the editor placed clips in
NORMALIZED display-track space but persisted only the dragged clip's
index, so other clips' unchanged raw source indices collided on reload
(raw-vs-normalized). Fix (persist-on-edit): on a lane change / insert,
apply the move, re-normalizeToZones the whole set, and persist EVERY clip
atomically so the source matches the display. Inserts now use a fractional
track + normalize (replaces buildTrackInsert, now unused). Pure time-moves
still persist just the dragged clip.
2026-07-10 10:23:52 -07:00
ukimsanov 41b7c9053b fix(studio): allow dragging a clip past the current content end
The drag clamped a clip's start to (duration - clipDuration), so you
couldn't move it past the current content. Relax the clamp (both
resolveTimelineMove and the snap clamp) to the rendered timeline extent
(scrollWidth, kept >= viewport by the fill) — you can now drag into the
empty space past the content, and content-driven duration grows to fit
on commit.
2026-07-10 10:23:51 -07:00
ukimsanov 1f7c6a44d1 refactor(studio): extract resolveZoneDropPlacement — the whole drop decision, unit-tested
The drop-placement logic (no same-track overlap, zone clamp, relocate to
nearest free track, else create) was inline in the drag hook and untested.
Extract it into one pure function and cover every case with unit tests
(relocate up/down, all-occupied→create, sequential-share, zone-clamp both
ways, boundary insert + wrong-zone rejection, audio-track creation). The
hook now calls it, so the verified logic is the live logic. 39 collision
tests pass.
2026-07-10 10:23:51 -07:00
ukimsanov 39adf8efd8 feat(studio): no time-overlap per track — relocate to nearest free track, else create one
Per user intent: a clip can't be dropped ON TOP OF another on the same
track. Restore the collision-push (resolvePlacement) I'd removed, now
zone-aware:
- desired lane if free at the drop time → land there (sequential clips
  still share a track);
- else nearest free lane in the SAME kind-zone (prefer up);
- else auto-create a new track right below the aimed lane.
Deliberate boundary-insert still works (kind-gated). Cross-track overlap
stays allowed (that's layering).
2026-07-10 10:23:51 -07:00
ukimsanov 9455a719cc feat(studio): kind-zone-aware drag placement + insert
Verifying the drop cases surfaced a gap: the drag preview didn't respect
the visual/audio kind-zones, so a clip could appear to land in the wrong
zone mid-drag and snap back on re-zone, and audio-zone insert suppression
was too blunt (blocked creating new audio tracks).

- clampTrackToZone: a landing clip stays in its own zone (visual above the
  audio lanes, audio at/below) — no wrong-zone flash.
- isInsertAllowedForZone: new-track insert only in the clip's own zone, so
  audio clips CAN create audio tracks and visual inserts stay out of audio.
Both pure + unit-tested; wired into the drag preview.
2026-07-10 10:23:51 -07:00
ukimsanov d6d95656bc fix(studio): correctness sweep — live duration state, audio-row suppression, blocked-edit ref
From a fresh-eyes review of the DnD interaction paths:
- content-driven duration now reads live store elements (getState) instead
  of a closed-over snapshot, so fast sequential moves compute the right
  furthest-end (was a stale-closure hazard).
- audio-zone insert suppression compares in row-index space (position in
  trackOrder) instead of raw track values, which can shift.
- onBlockedEditAttempt routed through a ref (was a stale closure captured
  once at mount).
2026-07-10 10:23:51 -07:00
ukimsanov 553aa9f6ee feat(studio): content-driven duration on trim + move too
Extend the delete-shrink duration sync to the resize (trim) and move
fallback paths: after a trim/move, set data-duration to the furthest
clip end in the file (grows if extended past the end, shrinks if the
furthest clip is trimmed or moved left). Completes content-driven
duration for the live edit paths (SDK-cutover path is a follow-up).
2026-07-10 10:23:51 -07:00
ukimsanov ed6d92ce64 feat(studio): content-driven duration — shrink to content on delete
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.
2026-07-10 10:23:50 -07:00
ukimsanov 3e9672b0e0 feat(studio): kind-based zones, audio styling, visual-only track insert
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).
2026-07-10 10:23:50 -07:00
ukimsanov a95ac9dda5 feat(studio): free-form placement — drop the main-track magnet
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.
2026-07-10 10:23:50 -07:00
ukimsanov 827725ebb9 feat(studio): thread onMoveElements batched callback to the drag commit
Wires the atomic multi-clip handler end-to-end: useTimelineEditing →
EditorShell → useTimelineEditCallbacks → TimelineEditContext →
TimelinePane (per-edit expanded-clip rebase) → Timeline → resolver →
useTimelineClipDrag → commitDraggedClipMove. Enables the main-track
ripple + batched track-insert to actually fire.
2026-07-10 10:23:50 -07:00
ukimsanov 03eecb3b3c feat(studio): main-track ripple + batched insert in drag commit
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.
2026-07-10 10:23:50 -07:00
ukimsanov 004240572d feat(studio): handleTimelineElementsMove — atomic multi-clip persist
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).
2026-07-10 10:23:50 -07:00
ukimsanov c0ed66c6f4 feat(studio): shiftGsapPositionsBatch client helper 2026-07-10 10:23:50 -07:00
ukimsanov 1b07ab1d0c feat(studio-server): shift-positions-batch GSAP op (one write, N shifts) 2026-07-10 10:23:49 -07:00
ukimsanov 1a308c4229 feat(studio): reflowMainTrack — contiguous re-lay for main-track ripple 2026-07-10 10:23:49 -07:00
ukimsanov a04cbc7a3c fix(studio): drop crop-mode props from shell (align to main always-on crop)
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.
2026-07-10 10:23:49 -07:00
ukimsanov caf5fa3868 docs(research): audit handoff + batched-persist/ripple design 2026-07-10 10:23:49 -07:00
ukimsanov 1d86c23a64 fix(studio): keep clip selection outline + solid bg while dragging
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.
2026-07-10 10:23:49 -07:00
ukimsanov 02e5192b70 feat(studio): timeline fills viewport width when zoomed out
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.
2026-07-10 10:23:49 -07:00
ukimsanov f16940121f fix(studio): stable zone tie-break + valid top-insert track
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.
2026-07-10 10:23:49 -07:00
ukimsanov 1e551fa6e8 docs(research): full session handoff (R4 + R2 + R1 + Piece 4 partial; ripple blocked) 2026-07-10 10:23:49 -07:00
ukimsanov 9f4d16f4f6 refactor(studio): extract drag-commit module; defer main-track ripple (per-clip persist races) 2026-07-10 10:23:48 -07:00
ukimsanov cb5afc5ee2 feat(studio): main-track no-overlap magnet (snap flush, no stacking) 2026-07-10 10:23:48 -07:00
ukimsanov c2ffc24821 fix(studio): stable main-track resolution (role/longest-video) — idempotent zoning 2026-07-10 10:23:48 -07:00
ukimsanov b7ac593df6 feat(studio): enforced CapCut track zones (overlay/main/audio normalization) 2026-07-10 10:23:48 -07:00
ukimsanov 7c3af3dbd0 docs(research): standardized track model + main-track magnet design (analysis) 2026-07-10 10:23:48 -07:00
ukimsanov ed212ba8ee feat(studio): denser ruler minor ticks + frame-mode label sync 2026-07-10 10:23:48 -07:00
ukimsanov b811de1560 feat(studio): mid-lane track insert with insertion-line indicator 2026-07-10 10:23:48 -07:00
ukimsanov 705c7371aa feat(studio): collision-push drag to nearest free lane (prefer up) 2026-07-10 10:23:47 -07:00
ukimsanov 0f295a3780 docs(research): collision-push + track-insert design (R2 piece 2) 2026-07-10 10:23:47 -07:00
ukimsanov b0d3a6cab4 feat(studio): clip-sized drop placeholder at the landing spot 2026-07-10 10:23:47 -07:00
ukimsanov e9f3481197 docs(research): record magnetic-ghost revision (follow + highlight) 2026-07-10 10:23:47 -07:00
ukimsanov 5077efe036 feat(studio): ghost follows cursor with target-lane highlight (CapCut feel) 2026-07-10 10:23:47 -07:00
ukimsanov bf62b33b88 feat(studio): magnetic vertical drag ghost (snaps to track lanes) 2026-07-10 10:23:47 -07:00
ukimsanov 5b82ab5451 docs(research): magnetic vertical ghost design (R2 piece 1) 2026-07-10 10:23:46 -07:00
ukimsanov 2a5a350c23 feat(studio): full-width timeline layout; sidebars and preview above it 2026-07-10 10:23:46 -07:00
ukimsanov e5dd19a1d0 refactor(studio): extract PreviewOverlays and useTimelineEditCallbacks 2026-07-10 10:23:46 -07:00
ukimsanov 1b1a2ba009 refactor(studio): extract TimelinePane from NLELayout 2026-07-10 10:23:46 -07:00
ukimsanov bdc1583231 refactor(studio): extract PreviewPane from NLELayout 2026-07-10 10:23:46 -07:00
ukimsanov b9ed297164 refactor(studio): lift player and composition-stack state into NLEProvider 2026-07-10 10:23:46 -07:00
ukimsanov affbba3ecd docs(research): timeline layout implementation plan and editor ux research 2026-07-10 10:23:46 -07:00
ukimsanov 8c28480e19 docs(research): full-width timeline layout design (R4) 2026-07-10 10:23:45 -07:00
ukimsanov 3646b9fc64 docs(research): full session handoff for fresh-session continuation 2026-07-10 10:23:45 -07:00
ukimsanov 2c0858934f feat(studio): timeline zoom slider (log-scaled) replacing +/- buttons 2026-07-10 10:23:45 -07:00
ukimsanov 471c773ed5 feat(studio): timeline always visible (remove hide/show toggle + shortcut) 2026-07-10 10:23:45 -07:00
ukimsanov 131d6d9921 fix(studio): stamp id + data-hf-id on inserted blocks (fixes duplicate timeline clips) 2026-07-10 10:23:45 -07:00
ukimsanov 9bb7e05139 feat(studio): regular cursor over timeline clips; taller default timeline (smaller preview) 2026-07-10 10:23:45 -07:00
ukimsanov d3378b6f91 feat(studio): drops place at the playhead, CapCut-style (remove drag ghost overlay) 2026-07-10 10:23:44 -07:00
ukimsanov 0c2d0c9bd5 fix(studio): drops stay on the target track (no overlap-bump to a new track) 2026-07-10 10:23:44 -07:00