Commit Graph
100 Commits
Author SHA1 Message Date
yonlu 4235b4a4d5 feat(17-01): add WriteTrackTagsByPath and ImageFilePicker backend methods
- WriteTrackTagsByPath resolves filePath to trackID via GetAudioFileByPath
- ImageFilePicker opens native file dialog filtered to JPEG/PNG
- Added Wails TypeScript bindings for both new methods
2026-03-17 21:03:17 -04:00
yonlu 290f236a1b docs(17): fix files_modified in 17-02-PLAN 2026-03-17 18:37:14 -04:00
yonlu 4f7c800fb6 docs(17): create phase plan for single track edit 2026-03-17 18:35:28 -04:00
yonlu 9951a362ea docs(17): capture phase context 2026-03-17 18:25:13 -04:00
yonlu 4dc8724d03 docs(phase-16): complete phase execution 2026-03-17 11:02:48 -04:00
yonlu bdbcd54e92 docs(16-03): complete WriteTrackTags pipeline plan
- SUMMARY.md with pipeline architecture, 5 tests, 7 files
- STATE.md: Phase 16 complete (3/3), decisions, session
- ROADMAP.md: Phase 16 marked complete
- REQUIREMENTS.md: SYNC-01/02/03/04 and WRITE-06 marked complete
2026-03-17 10:58:13 -04:00
yonlu 64322f9353 feat(16-03): WriteTrackTags pipeline with player safety, scan mutex, events, and app wiring
- TagWriter struct with WriteTrackTags entry point orchestrating full pipeline
- PlayerStopper interface + playerAdapter for import-cycle-free player safety
- PipelineLocker interface + pipelineMu on Library for scan/write mutual exclusion
- TrackMetadataChanged event constant + auto-generated TypeScript events
- TagWriter wired into app.go as Wails binding with SetContext in OnStartup
- 5 pipeline integration tests: player safety, scan mutex, orphan cleanup, genre relink, full DB sync
- Lint fixes: static error, else-if, wsl cuddle, golines
2026-03-17 10:55:10 -04:00
yonlu 2966079625 feat(16-03): implement DB sync module for tag write pipeline
- syncDatabase runs entity relink + FTS5 + orphan cleanup in single tx
- Handles artist, album, genre changes with upsert-and-relink pattern
- FTS5 delete + insert within transaction for search index consistency
- Orphan cleanup for artist_credits, release_groups, and genres
- All hand-crafted SQL has SAFETY comments per codebase convention
2026-03-17 10:48:03 -04:00
yonlu 6cfb991602 docs(16-01): complete tagwriter foundation + MP3 writer plan
- Create 16-01-SUMMARY.md with execution results
- Update STATE.md with Plan 01 progress and decisions
- Update ROADMAP.md plan progress (2/3 plans complete)
- Mark WRITE-01 requirement complete
2026-03-17 10:44:10 -04:00
yonlu 6bd65a6f43 docs(16-02): complete FLAC tag writer plan
- Create 16-02-SUMMARY.md with execution results
- Update STATE.md with Phase 16 progress and decisions
- Update ROADMAP.md plan progress
- Mark WRITE-02 and WRITE-04 requirements complete
2026-03-17 10:35:38 -04:00
yonlu a677a44d49 test(16-02): add FLAC writer round-trip tests with 7 test functions
- TestWriteFlacTags_TextFields: round-trip 9 text fields via metadata.ExtractTags
- TestWriteFlacTags_CoverArt: JPEG embed and read-back verification
- TestWriteFlacTags_ClearCoverArt: embed then clear art, verify removal
- TestWriteFlacTags_PartialUpdate: update 2 of 8 fields, verify others preserved
- TestWriteFlacTags_PreservesStreamInfo: verify StreamInfo block survives tag writes
- TestWriteFlacTags_ReplaceComment: write twice, verify no duplicate Vorbis Comments
- TestWriteFlacTags_AtomicSafety: verify corrupt/invalid writes leave original intact
- Create shared helpers_test.go with testLogger, tinyJPEG, assertEqual, etc.
2026-03-17 10:32:46 -04:00
yonlu 3642cbe0d5 feat(16-02): add go-flac dependencies and implement FLAC tag writer
- Add go-flac/go-flac/v2, flacvorbis/v2, flacpicture/v2 dependencies
- Create tagwriter.go with TagChanges type, field constants, format detection, MIME detection
- Create flac.go with writeFlacTags using Vorbis Comments + PICTURE blocks + AtomicWrite
- Implement replaceVorbisComment helper for case-insensitive field replacement
- Handle cover art add/replace/clear via PICTURE metadata blocks
2026-03-17 10:32:28 -04:00
yonlu 4463d3e3e1 docs(16): create phase plan — tag writing & database sync 2026-03-17 10:07:30 -04:00
yonlu 0da3448949 docs(16): research phase domain 2026-03-17 09:56:10 -04:00
yonlu 7d0d68a915 docs(16): capture phase context 2026-03-17 09:34:26 -04:00
yonlu 4e8449b400 docs(phase-15): complete phase execution and verification 2026-03-16 18:21:14 -04:00
yonlu 6a1cd44b25 docs(15-02): complete atomic write utility plan
- SUMMARY.md with 2 task commits, 2 auto-fixed lint deviations
- STATE.md: Phase 15 complete (2/2 plans), ready for Phase 16
- ROADMAP.md: Phase 15 marked complete
- REQUIREMENTS.md: SCHEMA-02, WRITE-05 marked complete
2026-03-16 18:16:22 -04:00
yonlu 4876d21fc5 docs(15-01): complete FTS5 migration plan
- Create 15-01-SUMMARY.md
- Update STATE.md with position, decisions, metrics
- Update ROADMAP.md plan progress
- Mark SCHEMA-01 requirement complete
2026-03-16 18:15:26 -04:00
yonlu 0cdfe48e2e test(15-02): add comprehensive tests for AtomicWrite
- TestAtomicWrite_Success: overwrite with permission preservation
- TestAtomicWrite_NewFile: create new file with 0644 default
- TestAtomicWrite_CallbackError: rollback on callback failure
- TestAtomicWrite_OrphanCleanup: clean orphaned .yj-tmp files
- TestAtomicWrite_SameDirectoryTempFile: verify same-dir constraint
- TestAtomicWrite_PermissionPreservation: table-driven 644/755/600
- TestAtomicWrite_SyncAndClose: 1MiB write with size verification
2026-03-16 18:13:35 -04:00
yonlu 56cd7e38a5 test(15-01): add FTS5 row deletion and update cycle tests
- TestDeleteSearchIndex: table-driven test for delete existing/non-existent rowid
- TestSearchIndexUpdateCycle: verifies delete+reinsert produces no ghost entries
- TestClearSearchIndexPreservesSchema: verifies drop/recreate preserves contentless_delete=1
- Update TestInsertAndDeleteSearchIndex to expect successful delete
2026-03-16 18:12:06 -04:00
yonlu 4d64b5dcfe feat(15-02): create backend/fileutil package with AtomicWrite
- Callback API: AtomicWrite(logger, targetPath, func(tmp *os.File) error)
- Deterministic .yj-tmp suffix for orphan cleanup
- Permission preservation (stat target, chmod temp before rename)
- Cross-device rejection via ErrCrossDevice sentinel
- Orphan cleanup on startup of each write operation
- Sync for durability before rename
2026-03-16 18:11:41 -04:00
yonlu cb5155b890 feat(15-01): migrate FTS5 search_index to contentless_delete=1
- Add contentless_delete=1 to search_index.sql schema file
- Update ClearSearchIndex CREATE statement to match schema
- Replace DeleteSearchIndex no-op with real DELETE WHERE rowid
- Add migration 8: drop/recreate/repopulate FTS5 table
- Update library.go comment about FTS entry lifecycle
2026-03-16 18:10:57 -04:00
yonlu 73d9be8e26 docs(15): capture phase context 2026-03-16 17:19:34 -04:00
yonlu c158d6825c docs: create milestone v1.2 roadmap (5 phases) 2026-03-16 16:44:11 -04:00
yonlu 3cf016aec9 docs: define milestone v1.2 requirements 2026-03-16 16:38:07 -04:00
yonlu a6752c8295 docs: complete tag editing project research 2026-03-16 16:29:49 -04:00
yonlu 909958c03a docs: start milestone v1.2 Tag Editing 2026-03-16 16:15:49 -04:00
yonlu 98842a7e14 chore: complete v1.1 milestone 2026-03-16 16:08:27 -04:00
yonlu 8f8af48a12 docs: update retrospective for v1.1 2026-03-16 16:08:19 -04:00
yonlu 86024d59bf docs(phase-13): complete phase execution 2026-03-16 13:08:17 -04:00
yonlu 0a5877c177 docs(13-02): complete library filter UI & phantom resolution plan
- SUMMARY.md updated with checkpoint approval and all bugfix commits
- STATE.md updated with Phase 13 completion and new decisions
- ROADMAP.md plan checkboxes and milestone status updated
- REQUIREMENTS.md coverage updated: 31/31 v1.1 requirements complete
2026-03-16 13:03:35 -04:00
yonlu 9f595b7ac1 fix(13-02): resolve phantom playlist tracks using M3U8 paths after scan
- Add ScanHooks callback struct to library package (follows RemovalHooks pattern)
- Move phantom resolution from library to playlist service via hook
- New ResolvePhantomTracksAfterScan reads M3U8 files and resolves paths
  against current audio_files using multi-root resolution
- Handles pre-existing phantoms (match by M3U8 position) and new ones
  (match by phantom_file_path)
- Delete old resolvePhantomTracks method that required phantom_file_path
- Wire ScanHooks in app.go OnStartup
2026-03-16 12:47:42 -04:00
yonlu 93262b9ae0 fix(13-02): auto-resolve phantom playlist tracks after library scan
- Add phantom_file_path column to playlist_tracks (migration 7)
- Store original file_path during RemoveLibrary phantom metadata population
- After each successful scan, UPDATE phantom tracks whose phantom_file_path
  now matches an audio_files row, re-linking them and clearing phantom metadata
- Update schema file, sqlc generated code, and database test for new column
2026-03-16 12:29:06 -04:00
yonlu f05d2bb603 fix(13-02): defer virtualizer event delegation until element exists
- Event delegation handlers were attached in firstUpdated(), but the
  virtualizer is conditionally rendered (hidden when tracks empty/loading)
- On first render, tracks are [] so virtualizer doesn't exist, and
  firstUpdated() never fires again — delegation was never attached
- Move delegation to a guarded helper called from both firstUpdated()
  and updated(), so it attaches as soon as the virtualizer appears
- Fixes click, multi-select, context menu, double-click, and drag in
  both track-list and queue-panel components
2026-03-16 11:23:35 -04:00
yonlu 70e3814985 docs(13-02): complete library filter UI plan
- SUMMARY.md with library filter implementation details
- STATE.md updated: Phase 13 complete (2/2 plans)
- ROADMAP.md updated with plan progress
- REQUIREMENTS.md: PLAY-01, PLAY-02, PLAY-03 marked complete
2026-03-16 09:44:29 -04:00
yonlu 42b8cf9f52 feat(13-02): add library filter dropdown and wire all views to respect active filter
- Add selectedLibraryId state + ByLibrary conditional calls to library-store
- Add library filter pass-through methods to library-controller
- Create library-filter dropdown component in top bar
- Wire genre-details, cover-grid, artists-view, genres-view to use ByLibrary queries
- Update album-selection helper to respect library filter
- Regenerate Wails bindings for new ByLibrary methods
- Search remains client-side (automatically filtered by loaded data)
- Playlists remain unfiltered (use separate playlist store)
2026-03-16 09:41:27 -04:00
yonlu 5f7de5060a feat(13-01): add library-filtered Go query methods and FTS search
- GetAllTracksByLibrary, GetAllAlbumsByLibrary, GetAllArtistsByLibrary
- GetAlbumsByArtistByLibrary, GetAllGenresWithCountsByLibrary
- GetTracksByGenreByLibrary, GetAlbumTracksByLibrary
- SearchTracksByLibrary wraps SearchFTSTracksByLibrary on DB
- SearchFTSTracksByLibrary filters FTS results by library_id
2026-03-16 09:29:08 -04:00
yonlu 5cc58ce66a feat(13-01): add library-filtered sqlc queries for all browse views
- GetAllTracksWithFullMetadataByLibrary for tracks filtered by library
- GetAudioFilesByReleaseGroupByLibrary for album tracks in a library
- GetAllAlbumsWithDetailsByLibrary for albums with tracks in a library
- GetAlbumsByArtistByLibrary for artist albums in a library
- GetAlbumArtistsByLibrary for artists with albums in a library
- GetAllGenresWithCountsByLibrary for genre counts within a library
- GetTracksByGenreByLibrary for genre tracks within a library
2026-03-16 09:26:42 -04:00
yonlu 66ba5ad1a6 docs(13): create phase plan — library views and phantom tracks 2026-03-16 08:46:05 -04:00
yonlu 963487f892 docs(13): capture phase context 2026-03-16 02:40:44 -04:00
yonlu a586e13a3a docs(quick-19): fix phantom playlist tracks 2026-03-16 01:10:40 -04:00
yonlu e358b57ddf docs(quick-19): complete fix phantom playlist tracks plan
- Add 19-SUMMARY.md with execution results
- Update STATE.md quick tasks table
2026-03-16 01:10:05 -04:00
yonlu a902850471 test(quick-19): add multi-root path resolution tests
- Add TestResolveM3UPath with 7 cases: abs, relative, second root, no match, empty roots, nil knownPaths
- Add TestToRelativePathMultiRoot with 5 cases: first root, second root, no root, empty roots, empty string
- Add TestRemoveM3UEntriesMultiRoot: entries from different roots removed correctly
- Add TestFindM3UEntryMultiRoot: entry relative to second root found
- Add TestReplaceM3UEntryPathsMultiRoot: replacement under second root applied
2026-03-16 01:08:48 -04:00
yonlu 9144dedc27 fix(quick-19): multi-root path resolution for playlist M3U8 tracks
- Replace getLibraryRoot() with getAllLibraryRoots() returning all library paths
- Add resolveM3UPath() for multi-root resolution with knownPaths lookup
- Add toRelativePathMultiRoot() to save relative paths using correct root
- Update removeM3UEntries, replaceM3UEntryPaths, findM3UEntry for []string roots
- Update all 8 call sites in playlist.go for multi-root resolution
- Update existing test signatures for new []string parameter types
- Fix pre-existing golines formatting in scan_queue.go
2026-03-16 01:07:45 -04:00
yonlu 08216752b2 docs(phase-12): complete phase execution 2026-03-15 10:29:12 -04:00
yonlu 07277a4bcc docs(12-02): complete frontend library management UI plan
- Created 12-02-SUMMARY.md documenting 25 commits of library UI work
- Updated STATE.md: Phase 12 complete (2/2 plans)
- Updated ROADMAP.md: Phase 12 marked complete
- Updated REQUIREMENTS.md: LIB-06 marked complete (20/31 requirements done)
2026-03-15 10:24:55 -04:00
yonlu a4eac394ce perf: inline SVGs, memoize grid slices, batch store notifications
- Replace wa-icon shadow DOM with inline SVG in queue-panel (xmark)
  and album-dropdown (fav icons) to eliminate per-item shadow roots
- Memoize getBeforeEntries/getAfterEntries in cover-grid to prevent
  .slice() creating new array refs that trigger virtualizer relayout
- Remove transition: scale and border-radius from album cards to
  avoid per-frame repaints and anti-aliased path clipping
- Add queueMicrotask batching to player-store and favorites-store
  notify() to coalesce rapid-fire updates into single renders
2026-03-15 09:29:40 -04:00
yonlu 54df917ffd fix: preserve scroll position in cached grid views
display:none discards scrollTop in WebKitGTK, so navigating away
from album/artist/genre grids and back reset scroll to top.

Replace inline style.display toggling with a CSS class that uses
visibility:hidden + height:0 + overflow:hidden. This collapses
the element visually while keeping the DOM alive with its scroll
state intact. contain:strict on hidden views ensures zero layout
cost while collapsed.
2026-03-15 09:11:36 -04:00
yonlu 199c91013f perf: reduce software rendering overhead for NVIDIA+Wayland
Targeted optimizations for the DMABuf-disabled rendering path where
every frame is software-composited:

- Replace infinite CSS scroll-text animation with transition-based
  cycle that only repaints during active scroll, not during pauses
- Remove CSS mask-image on scrolling text (mask + animation was the
  single most expensive continuous repaint)
- Replace wa-icon in track rows with inline SVG — eliminates 30-50
  shadow DOM trees (each with SVG fetch/parse) during scroll
- Remove hover transitions on album cards, artist cards, genre cards,
  fav icons, queue remove buttons — each transition was causing
  per-frame software repaints
- Use visibility:hidden instead of opacity:0 for queue remove button
  (binary switch vs per-frame alpha blend)
- Add decoding=async to now-playing cover art images (prevents
  main-thread blocking during image decode on track change)
- Add contain:strict to fixed-height track rows (33px) and queue
  items (49px) — browser skips size contribution calculations
2026-03-15 09:00:59 -04:00
yonlu 3bf7852e1d docs(phase-14): complete phase execution 2026-03-15 08:11:59 -04:00
yonlu 915591aea9 perf: auto-detect NVIDIA+Wayland for DMABuf workaround
Instead of disabling DMABuf for all users (hurting AMD/Intel/X11
performance), detect NVIDIA GPU + Wayland session at startup and
only apply WEBKIT_DISABLE_DMABUF_RENDERER=1 for that combo.

Detection checks /proc/driver/nvidia/version first (fast, no
subprocess), falls back to scanning /proc/modules for nvidia.

GPU policy remains Always for everyone — the DMABuf workaround
only affects buffer sharing between WebKitGTK and the display
server, not GPU-accelerated CSS/layout/paint.
2026-03-14 15:15:53 -04:00
yonlu 3b2e189e7d fix(14-perf): fix scroll jumping and input latency
Root causes addressed:
- track-list had no _itemSize hint for flow layout — virtualizer
  defaulted to 100px, measured actual ~33px rows, then called
  _correctScrollError/scrollTo on every scroll causing visible jumps
- will-change:transform on virtualizer elements caused nested GPU
  layers (virtualizer positions children with transforms internally)
  adding compositor overhead instead of helping
- content-visibility:auto on album cards conflicted with virtualizer's
  own DOM recycling, causing redundant layout recalculation
- track-list visibilityChanged handler wrote to store synchronously
  on every event (per-item during scroll) without any throttling
- IIFE closure in renderTrackRow created a new function per row per render

Fixes applied:
- Add _itemSize:{height:33} + fixed height:33px on .track-row (matches
  queue-panel pattern that already worked smoothly)
- Add overflow-anchor:none on track-list virtualizer
- Remove will-change:transform from all 6 scroll containers
- Remove content-visibility:auto from album cards
- RAF-throttle visibilityChanged scroll position saves
- Replace IIFE with direct cols.map() in template
2026-03-14 14:46:38 -04:00
yonlu 4b7d35d7ec fix(14-01): downgrade main-panel from contain:strict to layout+style+paint
contain:strict includes size containment which caused a timing issue
where the flex-based main-panel height wasn't resolved before the
virtualizer measured its container, resulting in track-list rendering
at ~20% height on first load until something triggered a relayout.
2026-03-14 14:29:19 -04:00
yonlu b514772547 docs(14-03): complete render & store optimization plan
- Created 14-03-SUMMARY.md with event delegation and store batching results
- Updated STATE.md with plan progress, decisions, and session continuity
- Updated ROADMAP.md with Phase 14 plan progress
2026-03-14 13:56:46 -04:00
yonlu 74473d4386 docs(14-04): complete scroll optimization & profiling guide plan
- SUMMARY.md with task commits, decisions, and metrics
- STATE.md updated with plan progress and session continuity
- ROADMAP.md updated with Phase 14 plan progress
2026-03-14 13:54:36 -04:00
yonlu d0c05dc1d4 perf(14-03): add notification batching to queue store and granular change tracking to library store
- Queue store now uses queueMicrotask batching (matching library store pattern)
- Library store adds changeGeneration counter incremented only on actual data changes
- LibraryController checks changeGeneration before requestUpdate, skipping loading-only transitions
- Reduces unnecessary component re-renders during data loading cycles
2026-03-14 13:53:59 -04:00
yonlu 1ec8f82ef8 docs(14-04): create performance profiling guide
- Backend profiling with pprof: profile types, flame graph reading, common hotspots
- Frontend profiling with Chrome DevTools: Performance panel, Memory panel
- Diagnostic workflows for scrolling jank, slow navigation, memory growth
- References scripts/profile.sh for quick access to all profile types
2026-03-14 13:52:43 -04:00
yonlu 2f7ed70304 perf(14-03): eliminate per-item closure allocation in scroll render paths
- Replace inline arrow closures in renderTrackRow with event delegation via data-index
- Replace inline arrow closures in renderTrackItem with event delegation via data-index
- Add delegated click/dblclick/contextmenu/dragstart handlers on virtualizer elements
- Remove button click in queue panel also delegated via closest('.remove-button')
- Zero new function objects created per renderItem call during scroll
2026-03-14 13:52:34 -04:00
yonlu 6ca0b3c5a8 perf(14-04): RAF-throttle scroll position saves and add overflow-anchor to queue panel
- Replace 100ms debounced scroll save in cover grid with requestAnimationFrame throttling
- Position now saves continuously during scrolling (~16ms) instead of only after stop
- Cancel pending RAF in teardown() to prevent leaks
- Add overflow-anchor: none CSS to queue panel lit-virtualizer
- Keep monkey-patch for lit-virtualizer _correctScrollError with expanded comment explaining why CSS alone is insufficient
2026-03-14 13:51:32 -04:00
yonlu ef18f59a9a docs(14-01): complete CSS containment & GPU scroll promotion plan
- SUMMARY.md with 2 tasks, 7 files, 3 min duration
- STATE.md updated with plan position, metrics, decisions
- ROADMAP.md updated with plan progress (2/4)
2026-03-14 13:48:36 -04:00
yonlu f9cb346751 docs(14-02): complete view caching navigation plan
- Created 14-02-SUMMARY.md with execution results
- Updated STATE.md with Phase 14 position and decisions
- Updated ROADMAP.md progress for Phase 14 (1/4 plans)
2026-03-14 13:46:41 -04:00
yonlu ac8a52e110 perf(14-01): add GPU promotion and containment to all scroll containers
- contain: layout style on :host of all 6 scroll-heavy components
- contain: paint + will-change: transform on all scroll containers for GPU compositing
- content-visibility: auto + contain-intrinsic-size on .album-card for off-screen skip
- cover-grid, track-list, queue-panel, artists-view, genres-view, playlist-view
2026-03-14 13:46:08 -04:00
yonlu ad9104374a perf(14-02): replace innerHTML navigation with view caching system
- Primary views (tracks, albums, artists, genres, playlists, settings) created once and kept in DOM
- Navigation toggles display:none/display:'' instead of destroying/recreating components
- viewCache Map bounded to 6 entries — no memory leaks
- Detail views (artist-details, playlist-details, genre-details) remain ephemeral
- Scroll positions naturally preserved by keeping DOM alive
- No virtualizer reinit, no data refetch, no image reload on navigation
2026-03-14 13:44:37 -04:00
yonlu efa06f7edf perf(14-01): add CSS containment to app shell layout boundaries
- contain: layout style on .content-area to isolate main+queue from header/sidebar
- contain: strict on .main-panel for maximum layout isolation
- contain: layout style paint on .main-panel > * for paint containment per view
- contain: layout style paint on sidebar to isolate from main panel
- contain: layout style on .bottom-bar to isolate footer from content reflows
2026-03-14 13:44:22 -04:00
yonlu a8b5274775 docs(14-performance-optimization): create phase plan with 4 plans in 2 waves 2026-03-14 13:31:20 -04:00
yonlu 12c678284c feat(12-02): make config sections collapsible with chevron dropdown
Sections start collapsed showing only heading, description, and a
chevron icon. Click to expand and reveal the fields. The open property
allows sections to start expanded if needed.
2026-03-14 12:57:35 -04:00
yonlu 649e516aa3 fix(12-02): keep Add Library button visible during scan
Add Library is now outside the scanning/not-scanning conditional so
it's always accessible, even while a scan is in progress.
2026-03-14 12:42:15 -04:00
yonlu df824c6989 feat(12-02): show scan progress bar inline in library list entry
Progress bar now renders below the library row being scanned, with
a small status label (phase + percent) after the library name. Removed
the separate status-bar progress display.
2026-03-14 12:30:00 -04:00
yonlu 771345dd9d fix(12-02): move Add Library button inline with scan buttons
Add Library now sits in the same row as Scan and Full Rescan, sharing
the same btn-primary style and size. Removed the standalone button
below the library list.
2026-03-14 12:13:11 -04:00
yonlu ba3f840a28 fix(12-02): move scan buttons above library list, default to none selected
Scan and Full Rescan buttons now sit above the library list for easier
access. Libraries start unchecked — both buttons are disabled until at
least one library is selected.
2026-03-14 12:11:12 -04:00
yonlu ac8cbb3296 fix(12-02): serialize ScanWarning.Err as string instead of error interface
Go's error interface has no exported fields, so json.Marshal produced
{} for the error message. Converting to string at the addWarning call
site preserves the actual error text in the JSON payload.
2026-03-14 12:06:02 -04:00
yonlu 21ea71e257 perf(12-02): increase scan batch size from 50 to 300
Amortizes SQLite fsync cost over 6x fewer transactions. Cuts ~80
fsyncs for a 25K-track library — significant on HDD.
2026-03-14 11:33:03 -04:00
yonlu b093fbb10a fix(12-02): invalidate library store cache on LibraryRemoved event
Track list, albums, artists, and genres views now refresh immediately
after a library is removed instead of showing stale cached data.
2026-03-14 10:46:15 -04:00
yonlu 30f4461e69 perf(12-02): skip FTS5 rebuild during library removal
Contentless FTS5 cannot delete individual rows, but stale entries are
filtered out by the JOIN against track_metadata in search queries.
The index is rebuilt on the next full rescan. Removes ~10s of overhead
for a 25K-track library removal.
2026-03-14 10:24:49 -04:00
yonlu 890284ddb1 fix(12-02): delete artist_credit_artist before artist_credit in removal pipeline
artist_credit_artist.credit_id references artist_credit.id, so the
child table must be cleaned before the parent. Same FK ordering fix
as the earlier recording_genres/recordings swap.
2026-03-14 10:15:37 -04:00
yonlu 1f872aa005 fix(12-02): refresh library track counts after scan completes
loadLibraries() now runs on ScanComplete and ScanQueueDrained so newly
added libraries show their track count without navigating away.
2026-03-14 10:01:35 -04:00
yonlu b648307ac5 docs(12-02): record deferred bulk phantom matching improvement in STATE.md 2026-03-13 22:22:37 -04:00
yonlu 717e249c36 fix(12-02): resolve phantom tracks caused by empty library root after TOML cleanup
getLibraryRoot() returned "" after DirectoryPath was removed from
config.toml during multi-library migration. M3U8 relative paths could
not be resolved to absolute paths, causing every playlist track to
appear as phantom. Now falls back to the first library path from the
database when the legacy config field is empty.
2026-03-13 14:06:21 -04:00
yonlu 1ad099a9d3 fix(12-02): soft scan claims orphaned library_id=0 tracks on startup
Tracks from the pre-multi-library schema have library_id=0 and aren't
counted by CountAudioFilesByLibrary, causing a permanent count mismatch
that triggers a full scan on every launch. SoftScanAllLibraries now
claims matching orphans before comparing counts.
2026-03-13 13:59:18 -04:00
yonlu 92c4d23a9a fix(12-02): soft scan on launch — only scan libraries with changed file counts
SoftScanAllLibraries compares audio file count on disk vs DB track count
per library. Unchanged libraries are silently skipped (no progress bar,
no events). Only libraries where files were added or removed since the
last scan get queued for a full scan.
2026-03-13 13:53:46 -04:00
yonlu 1d735c3a5f fix(12-02): reorder orphan cleanup to delete FK children before recordings
recording_genres and release_group_recordings reference recordings.id,
so they must be deleted BEFORE the recordings table is cleaned.
Also extends toast duration to 8s for readability.
2026-03-13 13:38:39 -04:00
yonlu cf004986c9 fix(12-02): wait for scan to stop before library removal, surface errors in UI
RemoveLibrary now polls until the cancelled scan goroutine finishes
before proceeding with the removal transaction. Also show removal
errors as toast messages instead of only logging to console, and
explicitly reload library list after successful removal.
2026-03-13 11:17:37 -04:00
yonlu f60b6b5255 fix(12-02): claim orphaned tracks when adding library with matching path
Tracks from pre-multi-library schema have library_id=0 (default).
When AddLibrary creates a new library row, UPDATE orphaned tracks
whose file_path falls under the library's directory to use the new
library_id. This prevents the scan from hitting UNIQUE constraints
on every file and ensures track counts are correct immediately.
2026-03-13 10:50:34 -04:00
yonlu 13a42aea22 feat(12-02): selectable library list with checkbox scan targeting
- Add checkboxes to library list with select-all header
- Soft Scan operates on selected libraries (queues each individually)
- Full Rescan stays global (nukes all data, rescans all libraries)
- Remove redundant 'Scan All Libraries' button
- Fix FullRescan Go backend to scan all libraries after wipe, not just first
2026-03-13 10:33:15 -04:00
yonlu b36e472212 fix(12-02): count failed saves as skipped so scan progress bar advances
Files that fail to save (e.g. UNIQUE constraint from pre-existing
tracks with a different library_id) were not counted in any progress
counter, leaving the progress bar stuck at 0%. Now increments skipped
so processed = added + skipped + updated reflects all files visited.
2026-03-13 09:31:28 -04:00
yonlu 9272b060bf fix(12-02): dismiss inline rename on click outside 2026-03-13 09:24:32 -04:00
yonlu cf18c39dbd fix(12-02): downgrade per-file save error to Debug, add warning count to scan summary 2026-03-13 09:17:38 -04:00
yonlu 05598224e4 fix(12-02): replace removed Scan() import with ScanAllLibraries()
Scan() wrapper was deleted in Phase 11 but config-page.ts and
library-manager.ts still imported it. Use ScanAllLibraries() for
soft scan since multi-library model scans all libraries.
2026-03-13 08:27:47 -04:00
yonlu e199712a56 feat(12-02): remove Libraries sidebar nav item and view routing
- Remove 'libraries' from View type union in app-sidebar.ts
- Remove Libraries nav item from sidebar navigation list
- Remove case 'libraries' view routing in index.ts
- Remove library-manager component import from index.ts
2026-03-12 19:51:41 -04:00
yonlu ffc5d9639c feat(12-02): replace config-page library section with full library management UI
- Add library list with name, path, track count per library
- Add Library button opens folder picker, auto-creates library
- Inline rename with Enter/Escape via overflow menu
- Removal confirmation dialog with real impact counts (tracks, playlists, queue)
- Toast notification with removal summary after library removal
- Add GetAllLibrariesWithTrackCounts + Info type to backend Library struct
- Add Wails binding stubs for AddLibrary, RenameLibrary, RemoveLibrary, GetRemovalImpact
- Add Info, RemovalImpact, RemovalSummary types to models.ts
- Remove old single-directory library config UI (GetLibraryDirectory/SetLibraryDirectory)
2026-03-12 19:50:59 -04:00
yonlu 27c773b3d0 docs(12-01): complete library CRUD backend plan
- SUMMARY.md with 2 task commits, 6 files, 6 requirements completed
- STATE.md advanced to Phase 12 Plan 1/2, added Phase 12 decisions
- ROADMAP.md marked 12-01 complete (1/2 plans)
- REQUIREMENTS.md marked LIB-01, LIB-02, LIB-03, DATA-02, DATA-03, PLAY-04 complete
2026-03-12 19:42:41 -04:00
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