Commit Graph
491 Commits
Author SHA1 Message Date
yonlu 5995dfd01d feat(12-01): add queue compaction method and wire removal hooks
- Add CompactAfterLibraryRemoval on Queue: reloads surviving tracks from DB, resets currentIndex, unloads player if current track was removed, clears shuffle order
- Wire RemovalHooks in app.go OnStartup: StopPlayback → player.UnloadTrack, CompactQueue → queue.CompactAfterLibraryRemoval
- All existing tests pass with no regressions
2026-03-12 19:38:36 -04:00
yonlu bd44f8306c feat(12-01): implement library CRUD methods and orphan cleanup pipeline
- Add AddLibrary, RenameLibrary, RemoveLibrary, GetRemovalImpact methods
- RemoveLibrary follows exact order: phantom populate → delete audio_files → orphan cleanup → commit → FTS5 rebuild → cover art file cleanup → queue compact → events
- Add cancelLibraryScan and currentTrackBelongsToLibrary helpers
- Add RemovalHooks type and removalHooks field on Library struct
- Add LibraryAdded, LibraryRenamed, LibraryRemoved event constants
- Regenerate frontend events.ts with new CRUD events
- All hand-crafted SQL has SAFETY comments per project convention
- Dual artist_credit FK check (recordings + release_groups) for orphan cleanup
2026-03-12 19:37:07 -04:00
yonlu e97b849602 docs(12): create phase plan for library CRUD and data integrity 2026-03-12 17:48:46 -04:00
yonlu 721442d1cb docs(12): create phase plan 2026-03-12 17:46:08 -04:00
yonlu de5ee4c301 docs(12): research phase domain 2026-03-12 17:39:32 -04:00
yonlu 10f97047e8 docs(12): capture phase context 2026-03-12 13:53:20 -04:00
yonlu 12f10c5fac docs(phase-11): complete phase execution 2026-03-09 16:23:50 -04:00
yonlu ead68cfb5d docs(11-03): complete wire auto-scan and legacy cleanup plan
- SUMMARY.md documents auto-scan wiring and legacy code removal
- STATE.md updated: plan 3/3 complete, Phase 11 done, session continuity
- ROADMAP.md updated: Phase 11 complete (3/3 plans)
2026-03-09 16:19:59 -04:00
yonlu 1aaf53630d docs(11-02): complete frontend scan UI plan
- SUMMARY.md documents per-library progress display and queue-aware cancel dialog
- STATE.md updated: plan 2/3, session continuity, new decisions
- ROADMAP.md updated: phase 11 progress 2/3
- REQUIREMENTS.md: LSCAN-03 marked complete
2026-03-09 16:13:45 -04:00
yonlu d61f122b56 feat(11-02): update library-manager with per-library progress and Scan All button
- Add libraryId, libraryName, queuedCount to ScanProgress interface
- Show library name in progress label (Scanning: [Library Name])
- Show queue count below progress bar when libraries queued
- Add Scan All Libraries button (calls ScanAllLibraries binding)
- Subscribe to LibraryScanQueued/LibraryScanQueueDrained events
- Scan state properly tracks queue draining (doesn't reset early)
2026-03-09 16:11:23 -04:00
yonlu d01591d6cc feat(11-02): update config-page with per-library progress display and queue-aware cancel dialog
- Add libraryId, libraryName, queuedCount to ScanProgress interface
- Replace CancelScan import with CancelCurrentScan, CancelAllScans
- Add ScanAllLibraries import and Scan All Libraries button
- Show library name in progress label (Scanning: [Library Name])
- Show queue count below progress bar when libraries queued
- Cancel dialog shows scope choice (Cancel This Library / Cancel All) when queue > 0
- Subscribe to LibraryScanQueued and LibraryScanQueueDrained events
- Track scanQueuedCount state for queue-aware UI behavior
2026-03-09 16:09:22 -04:00
yonlu 9308848936 docs(11-01): complete per-library scan pipeline plan
- Create 11-01-SUMMARY.md with execution results
- Update STATE.md: advance to phase 11 plan 1/3
- Update ROADMAP.md: phase 11 at 1/3 plans complete
- Mark LSCAN-01, LSCAN-02, LSCAN-04 complete in REQUIREMENTS.md
2026-03-09 16:05:55 -04:00
yonlu 943db1cf27 feat(11-01): per-library scan pipeline with queue coordinator
Task 1: Schema, events, and progress types
- Add library_id to CreateAudioFile SQL INSERT and regenerate sqlc code
- Add LibraryScanQueued and LibraryScanQueueDrained event constants
- Regenerate TypeScript events via genevents
- Add LibraryID, LibraryName, QueuedCount to ScanProgress
- Add LibraryID, LibraryName to ScanMetrics
- Add libraryID field to importResult for threading through pipeline

Task 2: Scan queue coordinator and per-library scanning
- Create scan_queue.go with ScanLibrary(id), ScanAllLibraries()
- Add CancelCurrentScan(), CancelAllScans() for queue-aware cancellation
- FIFO scan queue with silent dedup (same library already scanning or queued)
- Refactor Scan() -> scanInternal(libraryID, libraryName, libraryPath)
- Replace GetAllAudioFiles with GetAudioFilesByLibrary for per-library loading
- Thread libraryID through DB writer to set CreateAudioFileParams.LibraryID
- drainQueue auto-starts next queued library or emits LibraryScanQueueDrained
- Pause freezes current scan AND queue
- Add GetScanQueueLength() and QueuedLibraryNames() for UI
- Mark CancelScan() and Scan() as deprecated
2026-03-09 16:02:54 -04:00
yonlu 68463f3549 docs(11): create phase plan for per-library scan pipeline 2026-03-09 15:44:07 -04:00
yonlu 025da10d98 docs(11): capture phase context 2026-03-09 15:18:01 -04:00
yonlu 75b2a349eb fix(10-01): move library_id index to migration 6 to fix existing DB startup
On existing databases, CREATE TABLE IF NOT EXISTS audio_files is a no-op
but the standalone CREATE INDEX on library_id would fail because the
column doesn't exist until migration 6 runs. The migration already
creates this index, so removing it from the schema file is correct.
2026-03-09 10:48:11 -04:00
yonlu 9ff850fe23 docs(phase-10): complete phase execution 2026-03-09 09:57:37 -04:00
yonlu 765204e8eb docs(10-02): complete sqlc queries & migration tests plan
- SUMMARY: Library CRUD queries, phantom-aware playlist queries, 5 migration tests
- STATE: Phase 10 complete (2/2 plans), ready for Phase 11
- ROADMAP: Phase 10 marked complete
- REQUIREMENTS: LIB-04, LIB-05 marked complete
2026-03-09 09:54:12 -04:00
yonlu bc151891b5 feat(10-02): add migration 6 integration tests and NewTestDBWithLibrary helper
- Add NewTestDBWithLibrary helper for tests needing a pre-created library
- TestMigration6FreshDB: verify all tables, columns, phantom cols, VIEW, and user_version
- TestMigration6LibraryQueries: verify CRUD operations and unique path constraint
- TestMigration6PhantomPlaylistTracks: verify SET NULL FK preserves phantom metadata
- TestMigration6AudioFilesLibraryFK: verify FK enforcement on library_id
- TestMigration6TrackMetadataViewHasLibraryID: verify VIEW includes library_id
2026-03-09 09:50:14 -04:00
yonlu 02548dd55e feat(10-02): add sqlc queries for libraries and update playlist queries for phantom support
- Create libraries.sql with 7 CRUD queries (create, get, get-by-path, list, update, delete, count)
- Update playlists.sql: AddPlaylistTrack now accepts 9 params including phantom metadata
- Update playlist queries to use LEFT JOIN for nullable audio_file_id
- Add GetTrackPhantomMetadata helper query for eager phantom population
- Add is_phantom computed column to metadata queries
- Add GetAudioFilesByLibrary and CountAudioFilesByLibrary queries
- Regenerate all sqlc code
2026-03-09 09:47:30 -04:00
yonlu 2c77368482 docs(10-01): complete schema & migration plan 2026-03-09 09:44:05 -04:00
yonlu 1179f56c36 feat(10-01): implement migration 6 and pre-migration backup
- Add backupDatabase() for timestamped .db file backup before migration
- Add migration6MultiLibrary() with all 14 steps: FK OFF, create libraries table,
  insert default library from TOML config, add library_id to audio_files, rebuild
  playlist_tracks with SET NULL FK and 6 phantom columns, backfill phantom metadata,
  recreate track_metadata VIEW with library_id, FK ON, clean TOML config
- Add readLibraryDirFromTOML() and removeLibraryDirFromTOML() helpers
- Update runMigrations signature to accept dbPath for backup
- Add sentinel library row in NewTestDB for FK constraint satisfaction
2026-03-09 09:41:08 -04:00
yonlu 535855b383 feat(10-01): update SQL schema files for multi-library fresh installs
- Create _libraries.sql with libraries table (name, path, created_at)
- Add library_id FK column and index to audio_files.sql
- Update playlist_tracks.sql with nullable audio_file_id, SET NULL FK, and 6 phantom columns
- Add af.library_id to track_metadata VIEW
- Regenerate sqlc code for updated schemas
- Fix playlist.go to use sql.NullInt64 for nullable audio_file_id
2026-03-09 09:36:47 -04:00
yonlu 6f44512ebc docs(10): create phase plan — schema & migration 2026-03-09 09:27:02 -04:00
yonlu 44f41785bb docs(10): capture phase context 2026-03-09 09:05:01 -04:00
yonlu 8ecb1de306 docs: create multi-library roadmap (4 phases, 23 requirements)
Phases 10-13 for v1.1 Multi-Library Support:
- Phase 10: Schema & Migration (libraries table, library_id FK, phantom columns)
- Phase 11: Per-Library Scan Pipeline (sequential coordination, per-library progress)
- Phase 12: Library CRUD & Data Integrity (add/rename/remove, orphan cleanup, FTS5)
- Phase 13: Library Views & Phantom Tracks (unified views, filtering, phantom display)
2026-03-08 12:12:50 -04:00
yonlu cdf8bff01a docs: restructure v1.1 milestone for multi-library support
- Rename milestone from 'Features & Extensibility' to 'Multi-Library Support'
- Replace old phases 10-14 (TAG/SMRT/GAP/MB/LAYOUT/PLUG) with 20 multi-library requirements (LIB/LSCAN/VIEW/PLAY/DATA)
- Move deferred features to Future Requirements
- Update research files with multi-library research (Stack, Features, Architecture, Pitfalls)
- Architecture: hybrid model (library_id on audio_files only), libraries in DB, sequential scanning, phantom tracks
2026-03-08 11:54:37 -04:00
yonlu 595b5e1529 docs(quick-18): add multi-column metadata display to playlist-details track list 2026-03-08 09:37:11 -04:00
yonlu cab0f082cf docs(quick-18): complete multi-column metadata display plan
- Add 18-SUMMARY.md with execution results
- Update STATE.md quick tasks table
2026-03-08 09:36:50 -04:00
yonlu ce23177228 feat(quick-18): replace track-info with multi-column grid layout in playlist-details
- Remove track-info component, add formatMilliseconds import
- Add 5-column grid (#, Title, Artist, Album, Duration) with header row
- Display 1-indexed playlist order numbers in # column
- Phantom tracks span full grid width with grid-column: 1 / -1
- Add column-specific CSS: tabular-nums, text truncation, alignment
2026-03-08 09:35:59 -04:00
yonlu 8570f76400 docs(quick-17): complete playlist subpage refactoring
- Summary documenting playlist-details creation and playlist-view simplification
- Updated STATE.md with quick task 17 completion
2026-03-07 22:11:28 -05:00
yonlu 955cd68be2 refactor(quick-17): simplify playlist-view to navigate instead of expand
- Plain click now navigates to playlist-details subpage instead of toggling expand/collapse
- Removed all inline track expansion: renderPlaylistBody, track-item rendering, chevron icons
- Removed SelectionController, ContextMenuController, PlayerController (track-level interactions moved to playlist-details)
- Removed track-info, track-details, phantom-resolver imports (all live in playlist-details now)
- Simplified search to filter by playlist name only (no inline track search)
- Kept: playlist list, context menu (rename/delete/set-default), Ctrl/Shift multi-select, drag-drop target, create/import, sort toolbar
2026-03-07 22:10:24 -05:00
yonlu dc5c7d6ca6 feat(quick-17): create playlist-details subpage component
- New playlist-details component with header (back button, playlist icon, title, track count)
- Full track list with all interactions: select, play, context menu, drag, phantom handling
- Drop target support for adding tracks from other views
- Search filtering for tracks within the detail view
- Navigation routing in index.ts for playlist-details view
- Added playlist-details to SEARCHABLE_VIEWS in search-store
2026-03-07 22:06:53 -05:00
yonlu 2bdabf0940 docs(quick-17): plan playlist view subpage refactor 2026-03-07 22:03:11 -05:00
yonlu 0bd8cefa00 fix(queue-panel): suppress virtualizer scroll corrections during scrollbar drag
lit-virtualizer's flow layout has a scroll error correction mechanism that
calls scrollTo() to fix sub-pixel estimation errors. On large lists (20k+),
even with fixed-height items, floating-point differences from
getBoundingClientRect() (e.g. 49.000003px vs 49px) accumulate across items
and trigger corrections that fight the native scrollbar drag gesture,
causing the thumb to desync from the mouse.

Detect scrollbar drag by checking if mousedown occurs in the scrollbar
gutter (clientX > element clientWidth), then monkey-patch the virtualizer's
_correctScrollError method to discard accumulated errors during drag
instead of calling scrollTo(). Items continue to render/recycle normally
since layout updates are not suppressed -- only the scroll position
corrections are skipped.
2026-03-07 11:14:54 -05:00
yonlu 288d9deae2 fix(queue-panel): set flow layout _itemSize to match actual track item height
The previous fix (fixed CSS height on .track-item) was insufficient because
lit-virtualizer's flow layout defaults to estimating items at 100px tall.
With 20k items, the difference between 100px estimate and 49px actual creates
a ~1M px scroll height that collapses as items get measured, triggering
scroll error corrections (programmatic scrollTo calls) that fight the native
scrollbar during drag.

Setting _itemSize to { height: 49 } via the flow() config ensures the initial
scroll size estimate matches reality, eliminating the scroll error corrections
that caused the scrollbar thumb to desync from the mouse when dragging down.
2026-03-07 10:49:06 -05:00
yonlu 01fe39cc04 docs(quick-16): add ctrl+a hotkey to multi-select views to select all items 2026-03-07 10:20:57 -05:00
yonlu 8576999ae3 now-playing component scrolls text when hovering 2026-03-07 10:20:51 -05:00
yonlu 043c74c8b3 docs(quick-16): complete Ctrl+A select-all hotkey implementation 2026-03-07 10:20:16 -05:00
yonlu 906ea28751 feat(16-01): wire shortcut:select-all listener in track-list, queue-panel, and playlist-view
- Add handleSelectAll bound handler calling selection.selectAll() in all three components
- Register/unregister event listeners in connectedCallback/disconnectedCallback
2026-03-07 10:19:07 -05:00
yonlu f5677628ef feat(16-01): add selectAll() to SelectionController and dispatch shortcut:select-all event
- Add selectAll() method to SelectionController that selects all items via host interface
- Change app.selectAll dispatch from document.execCommand('selectAll') to CustomEvent('shortcut:select-all')
2026-03-07 10:18:08 -05:00
yonlu 13321b531d docs(quick-16): plan Ctrl+A select-all for multi-select views 2026-03-07 10:16:58 -05:00
yonlu e503fb3b67 docs(phase-09): complete phase execution 2026-03-07 10:13:03 -05:00
yonlu 8c8dca31e5 docs(09-05): complete integration testing & verification plan
- Created 09-05-SUMMARY.md documenting build verification and human approval
- Updated STATE.md: Phase 9 complete (5/5 plans, 1 phase done)
- Updated ROADMAP.md: Phase 9 and all plans marked complete
- Documented volume data flow bug fix (bb3fd20) as deviation
2026-03-07 10:08:35 -05:00
yonlu bb3fd204f0 fix(09-05): emit VolumeChanged event and persist state in ChangeVolume and MuteToggle 2026-03-07 02:06:08 -05:00
yonlu 77328e95dc docs(09-04): complete keyboard shortcuts settings UI plan
- SUMMARY.md with task commits and deviation documentation
- STATE.md advanced to Plan 5 of 5 (80% complete)
- ROADMAP.md updated with 4/5 plans progress
- Requirements KEY-02 and KEY-03 marked complete
2026-03-06 22:00:38 -05:00
yonlu 0451fb3880 feat(09-04): add keyboard shortcuts section to config page with conflict detection
- Keyboard Shortcuts section with shortcuts grouped by Player, Navigation, App categories
- All 16 default shortcuts listed with human-readable labels
- shortcut-capture widget for each action enables record-style rebinding
- Conflict detection warns before overwriting existing bindings with Overwrite/Cancel
- Reset All to Defaults button calls store.resetAll()
- Panel-specific shortcuts display scope label (e.g. track-list)
- ShortcutsController provides reactive state updates
2026-03-06 21:58:13 -05:00
yonlu 0706f804a4 docs(09-03): complete scan control UI plan
- SUMMARY.md with scan control UI outcomes and deviations
- STATE.md updated to plan 4 of 5 (60% progress)
- ROADMAP.md updated with 3/5 plan progress
2026-03-06 21:57:47 -05:00
yonlu 391436927c feat(09-03): add scan control UI with pause/resume/cancel and confirmation dialog
- Pause/Resume buttons replace Soft Scan/Full Rescan during active scan
- Cancel button shows confirmation dialog with Keep/Discard/Continue options
- Register LibraryScanPaused/Resumed/Cancelled event handlers
- Status bar shows 'Scan paused.' with accent color when paused
- Add CancelScan/PauseScan/ResumeScan Wails binding stubs
- Cancel dialog overlay dismissible by clicking outside or Continue Scanning
- Add cancelled field to ScanMetrics TypeScript interface
2026-03-06 21:54:50 -05:00
yonlu 6bb266e234 docs(09-02): complete keyboard shortcuts config & service plan
- Create 09-02-SUMMARY.md with execution metrics and decisions
- Update STATE.md: advance to plan 3, record metrics
- Mark KEY-01, KEY-04, KEY-05 requirements complete
2026-03-06 21:51:21 -05:00