Repository navigation
feat: sortable asset panel with droppable timeline lanes - #77
Merged
Merged
Conversation
… lanes Panel clip cells and audio rows become useSortable items (per-family groups, keyboard plugin kept) so they reorder within the panel and remain the drag sources the droppable lanes accept. OptimisticSortingPlugin is deliberately omitted: it shuffles sibling DOM nodes whenever a drag-out sweeps across the grid and only restores them on *canceled* drags, so state stays the single source of order and reorders commit once on drop — resolved by asset id (live-reload safe) and persisted through updateEdl (undo + edl.json). Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.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.
Summary
useSortable, per-family groupspanel-clips/panel-audio, keyboard plugin kept) — drag over a sibling to reorder, drag onto the timeline to insert. Timeline lanes stay plain Droppable targets.OptimisticSortingPluginis deliberately omitted after reading its source: it physically reorders sibling DOM nodes whenever the pointer crosses a cell (which the drag-out-to-timeline gesture always does) and only restores those mutations on canceled drags — a successful lane drop would leave the grid visually shuffled against React state. Without it, React state is the single source of order and there is exactly one commit point (dragend on a same-group sibling).updateEdl, so panel order persists toedl.jsonand participates in undo.reorderAssetsre-fills only the moved family's slots in the interleavededl.assetsarray (audio positions untouched when reordering clips, and vice versa), with arrayMove semantics and unit tests.trackId(timeline handler returns). Cross-family drops are rejected viatype/accept(clips accept video/image, audio rows accept audio).@dnd-kit/domadded as an explicit app dependency (previously reached transitively) for theSortableKeyboardPluginimport; hovered reorder targets get an accent outline.Test plan
npm run typecheck && npm test && npm run buildgreen (150 tests, 4 new forreorderAssets)Renderer-only change — HMR covers it, no dev restart needed.
Made with Cursor