Commit Graph
112 Commits
Author SHA1 Message Date
vicrodh ba8f6f9de4 fix(local-library): apply single scroll to artists and tracks tabs 2026-01-24 19:21:04 -06:00
vicrodh 3cb826481a fix(local-library): remove double scroll in albums view
Disable outer scroll on .library-view when virtualized album list is active.
The VirtualizedAlbumList component handles scrolling internally.
2026-01-24 19:18:31 -06:00
vicrodh 04915f05a3 style(local-library): reduce horizontal gap between album cards by 6px 2026-01-24 19:15:31 -06:00
vicrodh c80c8c8ea4 feat(local-library): add track list headers and fix button alignment
- Add track list header row with columns: #, Title, Duration, Quality
- Include spacers for local indicator and menu columns
- Add margin-top to album-actions for better visual spacing
- Add align-items: center to album-actions for button alignment
2026-01-24 19:05:00 -06:00
vicrodh bdb49f65bb Fix PlaylistDetailView track list header column alignment
Update header to use flexbox layout matching AlbumDetailView pattern.
Add missing column classes: col-title, col-album, col-quality, col-icon, col-spacer.
2026-01-24 17:05:08 -06:00
vicrodh 848322681d refactor: replace hardcoded rgba white with theme-aware alpha variables
Add --alpha-* CSS variables (4-95%) to app.css that adapt to theme:
- Dark themes: white-based rgba
- Light themes: black-based rgba (auto-inverts for proper contrast)

Mass-replaced 100+ instances of rgba(255,255,255,...) across 23 files
with var(--alpha-*) for consistent theming support.

This fixes borders, overlays, and UI elements being invisible or
having poor contrast in light themes.
2026-01-24 11:35:54 -06:00
vicrodh b296d3091b fix: remove horizontal scroll caused by jump-nav overflow
The jump-nav sticky header uses negative margins to extend beyond
the container padding. The right margin was -16px (or -32px in Settings)
but the container only has 8px (or 24px) of right padding, causing
8px of horizontal overflow.

Fixed by matching the negative right margin to the actual padding:
- ArtistDetailView: -16px → -8px, width calc(100%+40px) → calc(100%+32px)
- FavoritesView: -16px → -8px, width calc(100%+40px) → calc(100%+32px)
- LocalLibraryView: -16px → -8px, width calc(100%+40px) → calc(100%+32px)
- SettingsView: -32px → -24px, width calc(100%+64px) → calc(100%+56px)
2026-01-24 00:40:37 -06:00
vicrodh 1185d307f5 style: opaque nav bars with subtle shadow
- Remove transparency from all sticky nav bars (fully opaque)
- Remove backdrop-filter blur (not needed with opaque bg)
- Add subtle box-shadow (4px) for content-fades-beneath effect
- Applied to Artist, Favorites, LocalLibrary, Settings views
2026-01-23 18:23:30 -06:00
vicrodh 75aeb9592f fix: remove main-content padding-left for edge-to-edge nav bars
- Removed padding-left: 20px from main-content
- Toggle button and jump-nav don't collide (different vertical positions)
- Updated all view nav bars with corrected margin/width calculations
- Nav bars now truly flush with sidebar edge
2026-01-23 18:21:49 -06:00
vicrodh 7c14a6835e fix: extend sticky nav bars edge-to-edge with sidebar
- ArtistDetailView: jump-nav now flush with sidebar (margin -44px left)
- FavoritesView: favorites-nav flush with sidebar
- LocalLibraryView: jump-nav flush with sidebar
- SettingsView: settings-nav flush with sidebar
- All navs compensate for both main-content and view padding
- Radio animation: faster floating messages (1.2s), infinite loop
2026-01-23 18:17:34 -06:00
vicrodh 5f30747ef5 style: add glass effect to LocalLibrary and Settings nav bars
- LocalLibraryView: fix jump-nav margins and add glass effect
- SettingsView: fix settings-nav margins and add glass effect
- Both: proper width calculations for full-width coverage
- Both: backdrop-filter blur for modern glass appearance
2026-01-23 17:17:11 -06:00
vicrodh 5eb1b392e8 fix(queue): add album_id and artist_id to all view queue builders
Complete propagation in all view components:
- HomeView: buildContinueQueueTracks
- FavoritesView: buildFavoritesQueueTracks
- SearchView: buildSearchQueueTracks
- LocalLibraryView: setQueueForLocalTracks (local=true, null IDs)
- ArtistDetailView: buildTopTracksQueue
2026-01-23 03:57:36 -06:00
vicrodh fcf1397cc0 fix: apply canonical names to album and track grouping by artist
Use canonical names (from Qobuz/Discogs) when grouping albums and
tracks by artist to merge variants like "Alice in Chains" and
"Alice In Chains" into a single group.

- groupAlbumsOptimized uses canonical names for artist key
- groupAlbums uses canonical names for sorting and grouping
- groupTracks uses canonical names for artist sorting and grouping
2026-01-23 02:17:47 -06:00
vicrodh dbde6378a9 fix: track alpha index navigation and horizontal scroll
- Use VirtualizedTrackList's scrollToGroup method instead of DOM queries
- Add overflow: hidden to track-sections and virtualized-container
- Fix navigation not working with virtualized lists
2026-01-23 02:16:04 -06:00
vicrodh 4c6473ac3a fix: prevent duplicate group keys from slugify collisions
Use encodeURIComponent instead of slugify for group IDs to preserve
case sensitivity. This prevents collisions like "Aki" and "AKI" both
becoming "aki" which caused each_key_duplicate errors.
2026-01-23 02:10:50 -06:00
vicrodh d9fa302b3e perf: always use virtualization for all library tabs
- Remove non-virtualized fallbacks for albums, artists, and tracks
- Virtualization now based on max(albums, tracks) count
- Standardize BUFFER_ITEMS to 5 across all virtualized components
- Reduces code by ~280 lines of duplicate rendering logic
- Ensures consistent performance regardless of library size
2026-01-23 01:59:12 -06:00
vicrodh 9504294907 fix: remove track limit completely from library search
- Backend now supports limit=0 meaning "no limit"
- Frontend passes limit=0 to fetch all tracks
- Search now works across entire library regardless of size
- Virtualization handles rendering efficiently
2026-01-23 01:53:37 -06:00
vicrodh 3dc2e94002 fix: album grid gap and remove 1000 track cap
- Remove max-width constraint on album cards to fill grid cells
- Increase GRID_ROW_HEIGHT to 270px for better row spacing
- Remove 1000 track limit (now 100000) for large libraries
2026-01-23 01:50:32 -06:00
vicrodh 66d6ffb6ed feat: add canonical artist name normalization
- Add canonical_name column to artist_images table (migration)
- Store canonical names from Qobuz when fetching artist images
- Display canonical names (properly capitalized) in artist views
- Group and sort artists by canonical name when available
- Source priority: Qobuz -> Discogs -> Metadata

This ensures "Alice in chains" displays as "Alice In Chains" based on
Qobuz's authoritative naming.
2026-01-23 01:35:55 -06:00
vicrodh 223cf481f1 fix: prevent API flooding in artist image fetching
- Add guard to prevent concurrent executions
- Make requests sequential (1 per second) instead of parallel batches
- Limit to 50 artists per session
- Disable Discogs fallback (caused rate limiting issues)
- Add abort flag on component destroy
- Update state less frequently (every 5 artists)
2026-01-23 01:27:45 -06:00
vicrodh eec512a3f9 fix: address UI and performance issues in LocalLibrary
- Fix asset protocol scope for thumbnails in tauri.conf.json
- Homologate artist view controls to match album controls pattern
- Make artist grouping optional with dropdown (Off, A-Z)
- Change grid/list to single toggle button for artists
- Allow 3 lines for artist names in grid view
- Fix album card width to prevent title overflow
- Add throttling to artist image fetch to avoid rate limiting
2026-01-23 01:20:55 -06:00
vicrodh 16817b72b8 feat(thumbnails): integrate thumbnail service in LocalLibrary 2026-01-23 01:09:51 -06:00
vicrodh 12011577d7 feat(artists): add virtualized list view component 2026-01-23 01:02:13 -06:00
vicrodh a3ecbe6617 feat(artists): add virtualization with grouping, alpha index, and list view 2026-01-23 01:00:58 -06:00
vicrodh 496255744a fix(virtualization): add proper height for virtualized track list container 2026-01-23 00:38:03 -06:00
vicrodh 73f36d5e23 perf(library): memoize track grouping computation 2026-01-23 00:36:38 -06:00
vicrodh bb2cb56f5a feat(library): add virtualized track list component 2026-01-23 00:35:17 -06:00
vicrodh af4c51daae perf(library): integrate virtualized artist grid 2026-01-23 00:31:58 -06:00
vicrodh c8b3531ef1 perf(library): memoize album filtering and grouping
- Create derived state `filteredAndGroupedAlbums` that caches results
- Add `matchesAlbumSearchFast` inline function to reduce overhead
- Add `groupAlbumsOptimized` that avoids unnecessary array copies
- Sort albums within groups instead of pre-sorting entire array
- Remove inline computation in template, use memoized results

This prevents repeated filtering and grouping on every render cycle.

Part of #13 - LocalLibrary performance optimization
2026-01-23 00:23:30 -06:00
vicrodh ae1f892e02 perf(library): add debounce for artist search (150ms) 2026-01-23 00:22:04 -06:00
vicrodh da653d48fc perf(library): add debounce for album search and memoize artwork URLs
- Add 150ms debounce for album search to prevent filtering on every
  keystroke (matches track search behavior)
- Memoize getArtworkUrl() with Map cache to avoid repeated
  convertFileSrc() calls for the same artwork path
- Clear debounce timer and state when search is closed

Part of #13 - LocalLibrary performance optimization
2026-01-23 00:15:16 -06:00
vicrodh ff91eaf204 fix(library): update virtualization state when albums load 2026-01-23 00:04:04 -06:00
vicrodh a74cc28f1e feat(library): add virtualized album list component
Implement VirtualizedAlbumList.svelte for rendering large album
collections efficiently:

- Only renders items visible in viewport + buffer
- Supports both grid and list view modes
- Handles grouped albums with headers
- Alpha index integration for quick navigation
- Absolute positioning with calculated heights
- ResizeObserver for dynamic container sizing

Integration with LocalLibraryView:
- Import and use virtualization store settings
- Conditionally render virtualized vs standard list
- Performance mode activates when album count exceeds threshold
- Subscribe to performance settings changes

CSS additions:
- Virtualized container with proper height calculation
- Smooth scrolling support

Part of #13 - LocalLibrary performance optimization
2026-01-23 00:03:44 -06:00
vicrodh 9ca22f52ac Disable playlist management in offline mode
- Add shouldHidePlaylistFeatures() helper function
- Hide 'Add to playlist' button in TrackMenu when offline
- Add informational banner in Local Library view
- Users can still play tracks in offline mode
- Implements Option 2 from OFFLINE_PLAYLIST_FEATURE_OPTIONS.md
2026-01-20 15:20:02 -06:00
vicrodh 5cd18b425a Load folders in offline mode using library_get_folders
- Use library_get_folders instead of library_get_folders_with_metadata when offline
- Prevents is_network_path blocking DB when cable disconnected
- Mark network folders as inaccessible, local folders as accessible
- Allows viewing folder list in settings panel while offline
2026-01-20 08:01:34 -06:00
vicrodh 8b4b3e6a7f Skip loadFolders when offline to prevent database lock
- Add debug logging to loadArtists and loadTracks
- Only execute loadFolders when not offline
- Prevents is_network_path blocking DB when cable disconnected
2026-01-20 07:47:49 -06:00
vicrodh e13e5e70e9 Fix infinite spinner in offline mode by serializing database operations
- Make onMount await loadLibraryData before starting loadFolders
- Add 5-second timeout to loadFolders using Promise.race
- Make folder loading non-critical to prevent UI blocking
- Prevents database lock deadlock when is_network_path blocks offline
2026-01-20 02:38:32 -06:00
vicrodh 2b4b59fc93 Add extensive debug logging to LocalLibraryView offline mode
Added detailed console logs to track execution flow:
- shouldExcludeNetworkFolders: logs offline state, reason, settings
- loadLibraryData: logs each step including invoke calls and responses
- Error handling with try/catch in shouldExcludeNetworkFolders

This will help identify where the infinite spinner occurs in offline mode.
User reports DB may be blocking in offline - investigating.
2026-01-20 02:23:46 -06:00
vicrodh 36f8b9a6a4 Implement unified search in sticky nav for all tabs and fix top gap
- Changed search to work for all tabs (Albums, Artists, Tracks) in sticky nav
- Search input dynamically changes placeholder based on active tab
- Removed duplicate search inputs from Albums and Artists sections
- Fixed gap between page top and sticky nav by removing padding-top from .library-view
- Search opens/closes with toggle, clears on close, focuses on open
- Each tab maintains its own search state (albumSearch, artistSearch, trackSearch)

Search behavior:
- Albums tab: searches albums and artists
- Artists tab: searches artists only
- Tracks tab: searches tracks, albums, artists with debounce

UI now clean with single search location in sticky nav for all tabs.
2026-01-20 02:11:11 -06:00
vicrodh e5b4f68338 Fix sticky nav gap and remove redundant tab counters
- Fixed gap between page top and sticky nav by adding negative margin-top
  Changed margin from '0 -24px 16px' to '-24px -24px 16px'
- Removed tab counters (Albums (12), Artists (5), Tracks (252)) as they
  are redundant with the counters already displayed in page content

Sticky nav now sits flush at the top with no gap when scrolling.
2026-01-20 02:07:44 -06:00
vicrodh f48d857e0f Implement sticky navigation bar with integrated search in LocalLibraryView
- Changed tab buttons to text links with underline style (matching ArtistDetailView)
- Made navigation bar sticky with proper z-index and negative margin
- Integrated track search into sticky nav bar (closed by default)
- Search opens with toggle button, closes with X or Escape key
- Removed duplicate search input from tracks section
- Added slideInFromRight animation for search appearance

Navigation now:
- Sticks to top when scrolling (position: sticky; top: 0; z-index: 4)
- Uses minimal text links instead of button-style tabs
- Active tab shown with accent-colored underline
- Track search accessible from any tab via sticky nav
2026-01-20 02:05:47 -06:00
vicrodh 5b0fb1a72d Fix track counter fallback to use filtered albums instead of total stats
Changed the fallback case (Tracks view without search) to calculate from
filtered albums instead of using stats.track_count.

Now when both filters are active (network folders + downloads hidden):
- Shows 0 tracks correctly instead of total count
- Counter always reflects actual filtered content across all tabs
2026-01-20 01:54:27 -06:00
vicrodh 225455bd50 Fix filteredTrackCount to always reflect filtered data in Albums/Artists views
Removed the length check conditions for albums and artists views so the
counter always calculates from the filtered data, even when the result is 0.

Now when network folders or downloads are hidden:
- Albums view: Shows 0 tracks if no albums are visible
- Artists view: Shows 0 tracks if no artists are visible
- Tracks view: Shows actual filtered track count

This ensures the counter is always reactive to filter changes.
2026-01-20 01:53:19 -06:00
vicrodh 8dcfeb7f70 Fix undefined currentView variable in filteredTrackCount
Changed currentView to activeTab in the reactive counter logic. The variable
currentView doesn't exist - the correct variable is activeTab which tracks
the current selected tab (albums/artists/tracks).

This was causing LocalLibraryView to fail to mount/render.
2026-01-20 01:49:11 -06:00
vicrodh c66059d9c5 Fix Svelte 5 derived syntax for filteredTrackCount
Changed from $derived(() => {}) to $derived.by(() => {}) which is the correct
syntax for complex derived values in Svelte 5. The previous syntax caused the
function to be rendered as text in the UI instead of being evaluated.

Fixes UI displaying function code instead of track count number.
2026-01-20 01:40:52 -06:00
vicrodh 2270d80139 Add source/qobuz_track_id to LocalTrack model and implement filtering for Artists/Tracks
- Added source and qobuz_track_id fields to LocalTrack model for proper filtering
- Updated all database row mapping functions to include new fields
- Implemented network folder and download filtering for library_get_artists command
- Implemented network folder and download filtering for library_search (Tracks) command
- Made tab counters (Albums, Artists, Tracks) reactive to filtered content
- Counters now update based on current filtered data instead of total stats

Fixes offline mode filtering for Artists and Tracks tabs. When offline or when
downloads are hidden, Artists/Tracks now properly filter out inaccessible content,
matching the behavior already implemented for Albums.
2026-01-20 01:26:27 -06:00
vicrodh 4876293ec2 Add network folder visibility control for manual offline mode
Implemented configurable network folder visibility when in manual offline mode.

Problem:
- Previously, ALL offline modes hid network folders
- Users in manual offline mode (privacy/metered internet) may still
  have local network access and want to see network-mounted music

Solution:
- Added showNetworkFoldersInManualOffline setting (already existed in backend)
- Implemented smart filtering logic in LocalLibraryView:
  - Offline real (no_network): Always hide network folders
  - Offline manual: Hide ONLY if user disabled the setting
  - Online: Show everything
- Added toggle in Settings > Offline Mode section

Use cases:
1. Privacy: Manual offline mode but keep local network music visible
2. Metered internet: Don't stream from Qobuz but access NAS/network shares
3. Real offline: No network at all, hide everything network-based

Settings location: Settings > Offline Mode > "Show Network Folders"
Description: "Display music from network folders when in manual
offline mode (privacy/metered connection)"

Files changed:
- src/lib/components/views/LocalLibraryView.svelte
- src/lib/components/views/SettingsView.svelte
2026-01-20 00:57:06 -06:00
vicrodh 6073cb96c1 Fix Qobuz downloads behavior and network filtering in offline mode
Problem 1: "Show in Local Library" setting was being ignored
- Qobuz downloads appeared in library even when setting was disabled
- Root cause: Scanner was overwriting Qobuz downloads with INSERT OR REPLACE
- This lost the 'source = qobuz_download' marker needed for filtering

Problem 2: Network music visible in offline mode
- Music from network folders remained visible when offline
- User expected network content to be completely hidden offline
- Only local disk music should appear

Solution 1: Protect Qobuz downloads from scanner
- Added is_qobuz_download_by_path() to check if file is already a download
- Modified insert_track() to skip files with source = 'qobuz_download'
- Now downloads and scanned music coexist as separate "joins" in DB

Solution 2: Filter network folders when offline
- Added get_network_folder_paths() to get list of network folder paths
- Modified library_get_albums to accept excludeNetworkFolders parameter
- When offline, filter out albums whose tracks are in network folders
- Frontend passes excludeNetworkFolders: isOffline to backend
- Added reactive effect to reload library when offline state changes

This implements the "join between tables" approach - Qobuz downloads
don't interfere with scanned music, and network content is properly
hidden when offline without being deleted.

Files changed:
- src-tauri/src/library/database.rs
- src-tauri/src/library/commands.rs
- src/lib/components/views/LocalLibraryView.svelte
2026-01-20 00:42:47 -06:00
vicrodh b450accb56 Fix LocalLibrary infinite loading in offline mode
Problem: When app is in offline mode, LocalLibrary gets stuck in
infinite loading screen and becomes unusable.

Root cause: loadFolders() was calling checkFolderAccessibility()
for each network folder. The backend command library_check_folder_accessible
uses blocking std::fs::read_dir which can hang for 20-30 seconds per
unreachable network path.

Solution:
Frontend (LocalLibraryView.svelte):
- Skip network folder accessibility checks when offline
- Assume network folders are inaccessible in offline mode
- Only check accessibility when online

Backend (library/commands.rs):
- Add 2-second timeout to library_check_folder_accessible
- Use tokio::task::spawn_blocking to avoid blocking async runtime
- Log timeout warnings for unreachable network paths

This allows LocalLibrary to load instantly when offline, showing
only local disk content as intended.

Files changed:
- src/lib/components/views/LocalLibraryView.svelte
- src-tauri/src/library/commands.rs
2026-01-20 00:27:28 -06:00
vicrodh 51cfcd1c32 Fix LocalLibrary not respecting 'Show in Local Library' setting
Problem: When user toggled the "Show Qobuz Downloads in Local Library"
setting in Settings, LocalLibraryView didn't refresh, so downloaded
tracks continued to appear even when the setting was disabled.

Root cause: LocalLibraryView only loaded data onMount and had no
mechanism to detect when download settings changed.

Solution:
- Created downloadSettingsStore with version tracking
- SettingsView notifies store when setting changes
- LocalLibraryView subscribes via $effect() and reloads data

Backend was already correctly filtering by the setting - this was
purely a frontend reactivity issue.

Files changed:
- src/lib/stores/downloadSettingsStore.ts (new)
- src/lib/components/views/SettingsView.svelte
- src/lib/components/views/LocalLibraryView.svelte
2026-01-20 00:26:29 -06:00