From 1c9bdd1d3c1af860a2320bbbe88016099037c38a Mon Sep 17 00:00:00 2001 From: luciano Date: Thu, 30 Jul 2026 17:51:15 +0200 Subject: [PATCH] Drag & drop reordering: playlist tracks and timed-scene elements Playlist reordering existed but was broken whenever a track was playing: the ~400ms progress re-render replaced the dragged node and cancelled the browser drag instantly. renderPlaylist now defers rebuilds until dragend, drops show an insertion marker (top half = before, bottom half = after), and internal drags no longer trigger the file-drop overlay. Scene editor: elements get a drag grip; since the list is always shown time-sorted, dropping an element between two others moves its appearance time between theirs (before the first = half its time, after the last = +5s). Grip-armed dragging keeps the sliders inside the cards working. Co-Authored-By: Claude Fable 5 --- src/control.js | 112 ++++++++++++++++++++++++++++++++++++++++++++++--- src/style.css | 8 ++++ 2 files changed, 115 insertions(+), 5 deletions(-) diff --git a/src/control.js b/src/control.js index ad8d824..a8b1541 100644 --- a/src/control.js +++ b/src/control.js @@ -669,6 +669,12 @@ function moveTrack(from, to) { } let dragFrom = -1; +let cueDragging = false; // a scene-editor element is being dragged +let plDirty = false; // a re-render was requested mid-drag +let dragMarkEl = null, dragMarkBelow = false; +function clearDropMarks() { + if (dragMarkEl) { dragMarkEl.classList.remove('drop-above', 'drop-below'); dragMarkEl = null; } +} // Build the