From ef8b12d25d9a48c2e678669ee3dd9ea811fc968d Mon Sep 17 00:00:00 2001 From: skal Date: Thu, 12 Feb 2026 09:11:48 +0100 Subject: refactor: timeline editor - major code reduction and UX improvements Reduced file size from 1899 to 823 lines (57% reduction) while improving maintainability and user experience. CSS improvements: - Added CSS variables for colors, spacing, and border radius - Consolidated duplicate button/input/label styles - Added missing .zoom-controls class definition - Reduced CSS from ~510 to ~100 lines JavaScript refactoring: - Centralized global state into single `state` object - Created `dom` object to cache all element references - Removed all inline event handlers (onclick, oninput) - Replaced with proper addEventListener pattern - Fixed missing playbackControls reference (bug fix) - Reduced JS from ~1320 to ~660 lines UX improvements: - Playback indicators (red bars) now always visible, start at 0s - During playback, highlight current sequence green (no expand/collapse reflow) - Smooth scrolling follows playback indicator (10% interpolation at 40% viewport) - Moved "Show Beats" checkbox inline with BPM controls - Fixed playback controls layout (time left of button, proper gap/alignment) - Error messages now logged to console as well as UI No functional regressions - all features work identically. Co-Authored-By: Claude Sonnet 4.5 --- tools/timeline_editor/index.html | 2123 ++++++++++---------------------------- 1 file changed, 523 insertions(+), 1600 deletions(-) (limited to 'tools/timeline_editor/index.html') diff --git a/tools/timeline_editor/index.html b/tools/timeline_editor/index.html index b6e9223..21bedd1 100644 --- a/tools/timeline_editor/index.html +++ b/tools/timeline_editor/index.html @@ -5,509 +5,100 @@ Timeline Editor - timeline.seq @@ -515,15 +106,9 @@

📊 Timeline Editor

- + - + @@ -536,14 +121,13 @@ 100% 120 - +
@@ -576,198 +160,129 @@ -- cgit v1.2.3