Commit Graph
386 Commits
Author SHA1 Message Date
yonlu d43ba7bd0c fix(quick-10): add migration 5 and fix entity cache for composite album key
- Migration 5 rebuilds release_groups with UNIQUE(name, album_artist_credit_id)
- Drops and recreates track_metadata VIEW during table rebuild
- Temporarily disables FK checks for safe table rebuild
- Entity cache now keys by album name + artist credit ID
- Update tests to use composite cache keys
2026-03-05 10:25:53 -05:00
yonlu 999ab967be fix(quick-10): update release_groups schema and queries for composite uniqueness
- Change UNIQUE(name) to UNIQUE(name, album_artist_credit_id) in schema
- Update UpsertReleaseGroup ON CONFLICT to match composite key
- Rename GetReleaseGroupByName to GetReleaseGroupByNameAndArtist with two params
- Regenerate sqlc code
2026-03-05 10:23:25 -05:00
yonlu dff625a568 docs(quick-9): complete fix queue panel scroll bar plan
- Add 9-SUMMARY.md with execution results
- Update STATE.md with quick task 9 entry
2026-03-05 09:41:18 -05:00
yonlu ebde5e5a8b fix(quick-9): set fixed height on queue track items for stable virtualizer scroll
- Add height: 49px and overflow: hidden to .track-item CSS
- Add overflow: hidden to .track-details CSS
- Fixed height ensures lit-virtualizer _scrollSize is stable from first render
- Prevents scrollbar lag on large queues (20k+ tracks) caused by dynamic item size averaging
2026-03-05 09:40:10 -05:00
yonlu 6ce0661fca chore: complete v1.0 Consolidation milestone
Archive milestone artifacts:
- milestones/v1.0-ROADMAP.md (full roadmap archive)
- milestones/v1.0-REQUIREMENTS.md (26/26 requirements complete)
- milestones/v1.0-phases/ (8 phase directories with plans, summaries, verifications)

Updated:
- PROJECT.md: full evolution review, all consolidation requirements validated
- ROADMAP.md: collapsed to milestone summary with archive link
- STATE.md: reset for next milestone
- MILESTONES.md: created with stats and accomplishments
- RETROSPECTIVE.md: created with lessons learned

Deleted:
- REQUIREMENTS.md (archived, fresh for next milestone)

8 phases, 17 plans, 34 tasks, 84 tests added, 6 days
2026-03-05 09:34:43 -05:00
yonlu 5ef45f91ed docs(phase-08): complete phase execution 2026-03-05 09:22:14 -05:00
yonlu 9943ae381c docs(08-04): complete visual consistency audit & design token application plan
- SUMMARY.md documents 15-component design token rollout
- STATE.md updated: all 8 phases complete, 26/26 requirements delivered
- ROADMAP.md updated: Phase 8 4/4 plans complete
- Includes hotfix documentation for repeat() virtualizer regression (72ef719)
2026-03-05 09:16:22 -05:00
yonlu 72ef719ba7 fix(08-02): revert repeat() inside lit-virtualizer, restore .renderItem + .keyFunction
repeat() as child content of lit-virtualizer bypasses virtualization,
rendering ALL items instead of only visible ones. This caused 2+ minute
loading times and UI freezing with large libraries.

The correct approach: use lit-virtualizer's native .renderItem and
.keyFunction properties which integrate with its scroll-based viewport
management.
2026-03-05 08:46:01 -05:00
yonlu 1303422e69 feat(08-04): apply design tokens to cover-grid, track-list, queue-panel, and detail components
- cover-grid dynamic text tiers use --yj-text-xs/sm/md/lg tokens
- track-list sort toolbar, row text, and fav icon use design tokens
- queue-panel header and track text use type scale tokens
- track-details, track-info, artist-details, genre-details use tokens
- designTokens imported and prepended to static styles in all 8 files
2026-03-04 23:30:29 -05:00
yonlu bc487cd715 docs(08-03): complete renderTrackRow optimization plan
- SUMMARY.md with classMap directive migration results
- STATE.md updated: 3/4 plans complete, decisions recorded
- ROADMAP.md updated with plan progress
2026-03-04 23:24:15 -05:00
yonlu aed90d7b17 feat(08-04): convert sidebar em-based spacing to px and apply icon/type tokens
- Sidebar: convert all em-based padding/gap to px values, icon sizes to --yj-icon-md
- Now-playing: cover placeholder icon to --yj-icon-lg, text sizes to type tokens
- Search-bar: search icon to --yj-icon-sm, input font to --yj-text-md
- Audio-player: convert em-based gap/padding/margin to px values
- Seek-bar: tooltip font to --yj-text-lg, margin from em to px
- Volume-control: padding/margin from em to px, thumb sizes from em to px
- All components import designTokens and include in static styles
2026-03-04 23:23:25 -05:00
yonlu 62f41c2491 perf(08-03): optimize column rendering and apply classMap to queue-panel renderTrackItem
- Hoist searchCtrl.term lookup outside per-column loop in renderTrackRow
- Search highlighting already short-circuits when search term is empty
- Import classMap in queue-panel.ts
- Replace array filter/join class construction with classMap in renderTrackItem
- Eliminates per-row array allocation in queue panel render hot path
2026-03-04 23:21:56 -05:00
yonlu ad210278fc perf(08-03): replace class string construction with classMap directive in renderTrackRow
- Import classMap from lit/directives/class-map.js
- Replace array filter/join class construction with classMap for track-row
- Convert fav-icon conditional class to classMap
- Convert cell alignment classes to classMap
- Eliminates per-row array allocation and string join in render hot path
2026-03-04 23:21:04 -05:00
yonlu e9410e5019 docs(08-02): complete virtualizer repeat() directive migration plan 2026-03-04 23:18:41 -05:00
yonlu 2ad301c297 docs(08-01): complete performance plumbing and design tokens plan 2026-03-04 23:17:00 -05:00
yonlu 1c3514da1d perf(08-02): migrate cover-grid, artists-view, and genres-view virtualizers to repeat() directive
- cover-grid: all 3 virtualizers (single, before-split, after-split) use repeat() with album.ID key
- artists-view uses repeat() with artist.ID key
- genres-view uses repeat() with genre.name key
- Removed gridKeyFunction (now inlined in repeat calls)
- Removed .renderItem and .keyFunction properties from all virtualizers
2026-03-04 23:16:55 -05:00
yonlu d2d7d8c6ce perf(08-02): migrate track-list and queue-panel virtualizers to repeat() directive
- track-list uses repeat() with FilePath key for efficient DOM reuse
- queue-panel uses repeat() with QueueTrack.id key
- Removed .renderItem property, kept .items for virtualization sizing
2026-03-04 23:15:09 -05:00
yonlu 1444a66bb2 feat(08-01): define design token CSS custom properties for icon sizes and type scale
- New tokens.css.ts exports designTokens with --yj-icon-sm/md/lg and --yj-text-xs/sm/md/lg/xl
- Values derived from existing pixel sizes scattered across codebase
- :host scoped for component-level adoption via static styles array
2026-03-04 23:14:43 -05:00
yonlu 3bf66ed125 perf(08-01): add queueMicrotask coalescing to library store and debounce search input
- Library store notify() coalesces multiple calls per microtask tick into one subscriber notification
- Search input debounces store propagation by 150ms while keeping instant visual feedback
- Empty search input clears immediately for responsive UX
2026-03-04 23:14:16 -05:00
yonlu 08793bf60d docs(08-frontend-performance-ux): create phase plan 2026-03-04 21:34:48 -05:00
yonlu 568a9aa090 docs(08): capture phase context 2026-03-04 21:26:58 -05:00
yonlu fbaa72da8f docs(phase-07): complete phase execution 2026-03-04 21:04:13 -05:00
yonlu 6f79c77b58 docs(07-01): complete queue persistence optimization plan
- SUMMARY.md with incremental persistence + Phase 2 dedup details
- STATE.md updated: Phase 7 complete (2/2 plans), decisions recorded
- ROADMAP.md updated: Phase 7 marked complete
- REQUIREMENTS.md: PERF-01, PERF-02 marked complete
2026-03-04 21:00:31 -05:00
yonlu ced58fe6a9 perf(07-01): eliminate redundant lookups in SetQueue Phase 2
- Add phase1Meta parameter to resolveRemainingTracks
- Filter out already-resolved paths before lookupTrackMetaBatch call
- Merge Phase 1 results into Phase 2 lookup map
- Pass batchMeta from SetQueue call site to resolveRemainingTracks
- For 1000-track queue with Phase 1 resolving 50, Phase 2 now queries 950 instead of 1000
2026-03-04 20:58:22 -05:00
yonlu cdd17db275 perf(07-01): add incremental persistence helpers for queue mutations
- Add persistAddTrack/persistAddTracks for O(1) append operations
- Add persistInsertTracks with variable-N position shift for insert-at operations
- Add persistRemoveTrack with single DELETE + position shift
- Wire AddTrack/AddTracks to use incremental INSERT (no full table rewrite)
- Wire InsertNext/InsertNextTracks/InsertTracksAt to use position shift + INSERT
- Wire RemoveTrack to use single DELETE + shift (no full table rewrite)
- RemoveTracks keeps full persistTracks rewrite (bulk operation per design)
- Preserve shuffle order regeneration in all mutation paths
2026-03-04 20:57:47 -05:00
yonlu cd98ad6dc8 perf(07-02): defer eagerFetch to after DOM ready for instant app shell
- Remove eagerFetch() call from LibraryStore constructor
- Add deferEagerFetch() that waits for DOMContentLoaded event
- App shell renders before backend data roundtrips begin
- All 4 data types (tracks, albums, artists, genres) still loaded eagerly
- invalidate() still calls eagerFetch() directly for post-scan refresh
2026-03-04 20:54:38 -05:00
yonlu 9f381e2a03 docs(07): create phase plan 2026-03-04 20:49:38 -05:00
yonlu 2ffcd6ea0e docs(07): capture phase context 2026-03-04 20:41:39 -05:00
yonlu c9626f4c9f docs(phase-06): complete phase execution 2026-03-04 19:38:35 -05:00
yonlu 0bd968ca19 docs(06-03): complete lookupChunk migration & SAFETY comments plan
- SUMMARY.md with execution results and self-check
- STATE.md updated: Phase 6 complete (3/3 plans), decisions recorded
- ROADMAP.md updated: Phase 6 marked Complete
- REQUIREMENTS.md: QUAL-03 and QUAL-04 marked complete
2026-03-04 19:36:00 -05:00
yonlu 7dfe003e63 docs(06-03): add SAFETY comments to all 12 hand-crafted SQL statements
- 7 SAFETY comments in search.go (FTS5 MATCH/INSERT/DELETE operations)
- 3 SAFETY comments in library.go (FTS5 INSERT/DELETE in commitNewAudioFile, updateAudioFileMetadata)
- 1 SAFETY comment in rescan.go (FTS5 DELETE in clearAllLibraryData)
- 1 SAFETY comment in persistence.go (variable-count multi-row INSERT)
- Cross-references link library.go/rescan.go back to search.go
- Two-part format: why sqlc can't handle it + what makes it safe
2026-03-04 19:33:55 -05:00
yonlu 2221a68459 feat(06-03): migrate lookupChunk to sqlc-generated LookupTrackMetaByPaths query
- Add LookupTrackMetaByPaths sqlc query using track_metadata VIEW with sqlc.slice()
- Replace hand-crafted fmt.Sprintf IN clause in lookupChunk with sqlc-generated call
- Preserve lookupTrackMetaBatch chunking at maxSQLiteVars (900)
- All queue tests pass with -race
2026-03-04 19:31:52 -05:00
yonlu 30579e950e docs(06-02): complete event codegen plan
- SUMMARY.md with codegen tool details and verification results
- STATE.md updated with position, decisions, session context
- ROADMAP.md progress: Phase 6 at 2/3 plans
- REQUIREMENTS.md: QUAL-02 marked complete
2026-03-04 19:25:57 -05:00
yonlu 48d1416e43 docs(06-01): complete track_metadata VIEW consolidation plan
- SUMMARY.md: 2 tasks, 4 files, 2min duration
- STATE.md: advance to Phase 6 plan 1/3
- ROADMAP.md: update progress for phases 3-6
- REQUIREMENTS.md: mark QUAL-01 complete
2026-03-04 19:25:53 -05:00
yonlu 9159b409dc refactor(06-01): consolidate search queries to use track_metadata VIEW
- SearchFTS uses JOIN track_metadata instead of 5-table inline JOIN
- SearchFTSByFilename uses JOIN track_metadata instead of 5-table inline JOIN
- SearchFTSTracks uses JOIN track_metadata instead of 6-table inline JOIN
- RebuildSearchIndex selects from track_metadata instead of inline JOIN
- All 15 database tests pass with -race
2026-03-04 19:23:11 -05:00
yonlu 3e9edd05e8 feat(06-02): create Go→TypeScript event constant codegen tool
- Add backend/events/cmd/genevents/main.go using go/ast for deterministic output
- Add //go:generate directive to backend/events/events.go
- Generate frontend/src/events.ts with all 21 constants including LibraryConfigChanged
- Atomic file writes via temp file + rename
- Comment groups preserved with trailing period stripping
2026-03-04 19:22:11 -05:00
yonlu 9c7e5a9634 feat(06-01): create track_metadata VIEW schema and migration 4
- Add track_metadata_view.sql for sqlc VIEW awareness
- Add migration4TrackMetadataView for existing databases
- sqlc generate produces TrackMetadatum model from VIEW
- migration2 inline JOIN preserved (runs before VIEW exists)
2026-03-04 19:21:58 -05:00
yonlu e8cca7c942 docs(06): create phase plan — 3 plans for SQL consolidation, event codegen, and SAFETY comments 2026-03-04 19:17:06 -05:00
yonlu 99484abf9e docs(phase-6): research SQL consolidation & code quality domain 2026-03-04 18:59:34 -05:00
yonlu a43257501a docs(06): capture phase context 2026-03-04 18:51:01 -05:00
yonlu 9298b4aead docs(phase-05): complete phase execution 2026-03-04 16:49:09 -05:00
yonlu 7804752d45 docs(05-01): complete FTS5 search tests plan
- SUMMARY.md: 15 tests, 9min duration, 2 deviations documented
- STATE.md: Phase 5 fully complete, 84 total tests
- REQUIREMENTS.md: TEST-03 marked complete
2026-03-04 16:45:25 -05:00
yonlu dd34569ac0 test(05-01): add FTS5 search tests for database package
- seedSearchData helper creates full entity graph (7 tracks, 4 artists, 7 albums)
- Pure helper tests: tokeniseForFTS, buildFTSQuery, stripExtForSearch
- FTS5 search tests: basic term, empty query, special characters (AC/DC),
  multi-word, diacritics (Beyonce→Beyoncé), ranking, filename search
- SearchFTSTracks verifies all 16 columns populated
- Index ops: insert, delete (documents contentless FTS5 limitation),
  rebuild, clear (documents contentless limitation)
- Migration test: user_version >= 3, UNIQUE index enforcement
- 15 tests, all passing with -race
2026-03-04 16:43:06 -05:00
yonlu efddad66df docs(05-02): complete library scan tests plan
- SUMMARY.md with 13 tests across entity cache, pure helpers, orphan cleanup
- STATE.md updated: Phase 5 in progress, decisions, metrics
- ROADMAP.md updated: plan progress for Phase 5
- REQUIREMENTS.md updated: TEST-06 marked complete
2026-03-04 16:40:26 -05:00
yonlu fa6c378e25 test(05-02): add entity cache and orphan cleanup tests with DB backing
- TestCachedUpsertArtistCredit: cache hit returns same ID on second call
- TestCachedLinkArtist: skips duplicate INSERT via linkedCredits cache
- TestCachedLinkArtist_MultiCredit: same artist linked to different credits
- TestCachedUpsertGenre: genre cache returns same ID on repeated calls
- TestResolveReleaseGroup: creates release group, updates cover art on cache hit
- TestResolveReleaseGroup_CacheHit: pre-populated cache returns cached ID
- TestOrphanDeletion: DeleteAudioFile removes row, documents contentless FTS5 limitation
- TestEntityCache_EmptyFields: empty artist name, empty album, AlbumArtist reuse
2026-03-04 16:37:48 -05:00
yonlu 6f96a9411f test(05-02): add pure helper tests for scan utility functions
- TestGetRecordingName: title present, fallback to filename sans extension
- TestToNullInt64: zero as null, positive/negative as valid
- TestToNullString: empty as null, non-empty as valid
- TestSplitGenres: empty/single/multiple genre splitting on || delimiter
- TestMapTrackRow: all 16 columns including string TrackLength, NullInt64 fields
2026-03-04 16:35:00 -05:00
yonlu 455e3f8e13 docs(05): create phase plan for database and library tests 2026-03-04 15:06:06 -05:00
yonlu 963a5b594b docs(05): capture phase context 2026-03-04 14:38:45 -05:00
yonlu 8a97e522cc docs(phase-04): complete phase execution 2026-03-03 17:08:07 -05:00
yonlu 7703297ebf docs(04-02): complete config and player tests plan
- SUMMARY: 27 test cases across 6 packages, all passing with -race
- STATE: Phase 4 complete, 14/26 requirements delivered
- ROADMAP: Phase 04 marked complete
- REQUIREMENTS: TEST-04, TEST-05 marked complete
2026-03-03 17:04:26 -05:00