Files
hyperframes/packages
Miguel Ángel c99cbbe44d fix(studio): a drag behind a refused edit is refused only when it would land on a clip (#8456)
* fix(studio): a refused delete no longer brings back another delete still saving

A refused delete, or a ripple shift that fails after its delete, now moves
back only the clips that delete shifted, on the timeline as it is now,
instead of restoring the timeline from before it.

* fix(studio): a refused delete also refuses the ripple shifts queued behind it

A delete's ripple shift saves absolute starts worked out with every earlier
pending delete applied. When one of those is refused, the shifts queued
behind it are refused too and leave their gap, so the saved file never
puts a clip on top of the restored one.

* fix(studio): a ripple shift queued behind a refused edit is refused before it writes

The timeline's edit queue now has one owner. It knows when an edit still
pending is refused, and a ripple shift (after a delete or a trim) queued
behind it is refused instead of saving starts that assumed that edit. The
trim ripple's rollback moves clips back by its own shift only. Drags,
single-clip timing and link edits are unchanged.

* fix(studio): a drag queued behind a refused edit is refused only if it would overlap

A drop is where the user put it, so a drag queued behind an edit that is
then refused still saves, unless it would now land on a clip in its lane,
such as the one a refused delete puts back. Then it is refused with the
same "Clips on the same track can't overlap." notice a refused drop
shows, and the clip returns to where it was. The lane overlap check is
shared with the insert-on-drop partner check.

* fix(studio): a trim behind a refused edit follows the drag rule, and both notices show as info

A trim queued behind an edit that is then refused is kept unless it now
overlaps a clip in its lane, the same rule as a drag. A refused drag or
trim shows "Clips on the same track can't overlap." in the same info tone
as a refused drop: the notice's owner now holds its words and its tone.

* fix(studio): a refused edit refuses trims behind it, per project, until every save settles

- A queued save stays tracked until it settles, so a later failure still
  refuses the ripple queued behind it.
- A trim's own resize is refused behind a refused edit too: its start and
  duration were read from the timeline that edit left.
- Each project gets its own queue.
- A refused trim shift reloads the preview, as a refused delete does.

* test(studio): the project-switch case keeps the old project's save pending

* fix(studio): a single-clip SDK timing save waits its turn in the edit queue

The SDK move and resize now run inside the queued edit, with the file-write
fallback in the same entry, so the earlier-refusal check guards both paths
and later edits see these saves.

* test(studio): give the clip-timing tests a 10 s timeline so every case can use the SDK path

* fix(studio): a single-clip drag behind a refused edit is refused only when it lands on a clip

* fix(studio): a queued timeline edit reads and writes only the project it was queued in

Each edit queue now carries the project it was made for and hands that id to
every queued edit, so the SDK readers, the file writes and the tween rewrite
never follow a project switch that happens while an edit waits.

* test(studio): hold the old project's save from the start in the project-switch case

* revert(studio): leave project isolation of queued edits to its own change

Takes out the per-project queue and the project binding of queued edits.
Main already lets a queued edit follow a project switch, through more
handles than the project id (preview, timeline store, history), so that
fix moves to one change that covers every handle.

* fix(studio): a queued single-clip SDK save reads the project it was made in

Main read the project as the save started, right away; queued, it read it
when its turn came. The move and resize now take the project when the
gesture queues them, for the SDK reader and the tween rewrite.

* fix(studio): a refused edit refuses only later edits of its own project

Each queued edit carries the project it was queued in, and the queue tracks
refusals per project, so a refusal left behind by a project the editor has
moved away from never refuses an edit in the one now open.

* test(studio): the switch matrix's stand-in SDK session finds no element, like an unknown target

* fix(studio): a refused drag takes back only its own shift

With Ripple on, a drag behind a refused delete was rolled back to its
rippled start, on top of the clip the delete put back. Both drag rollbacks
now move the clip from where it is by this drag's own shift, the rule the
delete and trim rollbacks follow. The overlap check no longer takes a lane
it never reads.

* test(studio): the drag-overlap test's earlier refused edit belongs to the hook's project

* refactor(studio): track-insert edits live beside the track-insert layout

buildTrackInsertEdits moves unchanged from the drag commit into
timelineDragLanding, next to layoutAfterTrackInsert, whose layout it turns
into edits. Both the drag and the canvas z-order mirror still call it.

* fix(studio): a drag behind a refusal in a project no longer shown is refused

The drag's overlap check reads the timeline on screen. Once the editor shows
another project, that timeline is not the drag's own, so the check could keep
a drag that lands on the clip its refused delete put back. A queue whose
project is not shown now refuses an edit behind a refusal outright, before any
policy reads live state.

* test(studio): the group-drag row carries the policy the move adapter gives it
2026-11-22 10:07:54 +00:00
..
2026-11-22 01:40:53 +00:00
2026-11-22 01:40:53 +00:00
2026-11-22 01:40:53 +00:00
2026-11-22 01:40:53 +00:00
2026-11-22 01:40:53 +00:00
2026-11-22 01:40:53 +00:00