From 17676de7a233215548ff3da13962acc8cb0ed04d Mon Sep 17 00:00:00 2001 From: skal Date: Thu, 12 Feb 2026 10:18:09 +0100 Subject: timeline editor: quantize grid, drag fixes, hotkeys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: - Sequence dragging with scroll offset - Double-click collapse/expand (DOM recreation issue) - Collapsed sequence dragging (removed stopPropagation) Features: - Quantize dropdown (Off, 1/32→1 beat) replaces snap-to-beat checkbox - Works in both beat and second display modes - Hotkeys: 0=Off, 1=1beat, 2=1/2, 3=1/4, 4=1/8, 5=1/16, 6=1/32 - Separate "Show Beats" toggle for display vs snap behavior Technical: - Track dragMoved state to avoid unnecessary DOM recreation - Preserve dblclick detection by deferring renderTimeline() - Quantization applies to sequences and effects uniformly handoff(Claude): timeline editor quantize + drag fixes complete --- tools/timeline_editor/README.md | 14 +++++---- tools/timeline_editor/index.html | 62 ++++++++++++++++++++++++++++------------ 2 files changed, 53 insertions(+), 23 deletions(-) (limited to 'tools/timeline_editor') diff --git a/tools/timeline_editor/README.md b/tools/timeline_editor/README.md index 4fcb2f4..cc13a41 100644 --- a/tools/timeline_editor/README.md +++ b/tools/timeline_editor/README.md @@ -14,7 +14,7 @@ Interactive web-based editor for `timeline.seq` files. - ⚙️ Stack-order based priority system - 🔍 Zoom (10%-200%) with mouse wheel + Ctrl/Cmd - 🎵 Audio waveform visualization (aligned to beats) -- 🎼 Snap-to-beat mode (enabled by default) +- 🎼 Quantize grid (Off, 1/32, 1/16, 1/8, 1/4, 1/2, 1 beat) - 🎛️ BPM slider (60-200 BPM) - 🔄 Re-order sequences by time - 🗑️ Delete sequences/effects @@ -37,10 +37,11 @@ Interactive web-based editor for `timeline.seq` files. - Watch sequences auto-expand/collapse during playback - Red playback indicators on both timeline and waveform show current position 5. **Edit:** - - Drag sequences/effects to reposition - - Double-click sequence header to collapse/expand + - Drag sequences/effects to reposition (works when collapsed or expanded) + - Double-click anywhere on sequence to collapse/expand - Click item to edit properties in side panel - Drag effect handles to resize + - **Quantize:** Use dropdown or hotkeys (0-6) to snap to grid 6. **Zoom:** Ctrl/Cmd + mouse wheel (zooms at cursor position) 7. **Save:** Click "💾 Save timeline.seq" @@ -102,7 +103,9 @@ open "tools/timeline_editor/index.html?seq=../../workspaces/main/timeline.seq" ## Keyboard Shortcuts - **Spacebar**: Play/pause audio playback +- **0-6**: Quantize grid (0=Off, 1=1beat, 2=1/2, 3=1/4, 4=1/8, 5=1/16, 6=1/32) - **Double-click timeline**: Seek to position (continues playing if active) +- **Double-click sequence**: Collapse/expand - **Ctrl/Cmd + Wheel**: Zoom in/out at cursor position ## Technical Notes @@ -113,10 +116,11 @@ open "tools/timeline_editor/index.html?seq=../../workspaces/main/timeline.seq" - BPM used for seconds conversion (tooltips, audio waveform alignment) - Priority determines render order (higher = on top) - Collapsed sequences show 35px title bar, expanded show full effect stack -- Time markers show beats by default (4-beat/bar increments) +- **Show Beats** toggle: Switch time markers between beats and seconds +- Time markers show 4-beat/bar increments (beats) or 1s increments (seconds) - **Waveform and time markers are sticky** at top during scroll/zoom - Vertical grid lines aid alignment -- Snap-to-beat enabled by default for musical alignment +- **Quantize grid**: Independent snap control (works in both beat and second display modes) - **Auto-expand/collapse**: Active sequence expands during playback, previous collapses - **Auto-scroll**: Timeline follows playback indicator (keeps it in middle third of viewport) - **Dual playback indicators**: Red bars on both timeline and waveform (synchronized) diff --git a/tools/timeline_editor/index.html b/tools/timeline_editor/index.html index 21bedd1..45c9f1f 100644 --- a/tools/timeline_editor/index.html +++ b/tools/timeline_editor/index.html @@ -66,7 +66,7 @@ 100% { box-shadow: 0 0 10px rgba(14, 99, 156, 0.5); border-color: var(--accent-blue); } } - .sequence-header { position: absolute; top: 0; left: 0; right: 0; padding: 8px; z-index: 5; cursor: pointer; user-select: none; } + .sequence-header { position: absolute; top: 0; left: 0; right: 0; padding: 8px; z-index: 5; cursor: move; user-select: none; } .sequence-header-name { font-size: 14px; font-weight: bold; color: #ffffff; } .sequence:not(.collapsed) .sequence-header-name { display: none; } .sequence-name { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 24px; font-weight: bold; color: #ffffff; text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.9), -1px -1px 4px rgba(0, 0, 0, 0.7); pointer-events: none; white-space: nowrap; opacity: 1; transition: opacity 0.3s ease; z-index: 10; } @@ -124,6 +124,17 @@ +