- Remove await from onMount (not async)
- Use .then() chain for proper async handling
- Initialize activeTab from preferences on mount
- Fixes tab order not persisting
- Fixes custom icon not displaying
cx
Removed continuous sync that was overriding user tab clicks.
Now only syncs activeTab with currentTab on initial mount to respect
configured first tab, then allows normal tab navigation.
cp
- Extended navigationStore with FavoritesTab state tracking
- Added setFavoritesTab() to push tab changes to history
- Modified navigateTo() to support favorites sub-navigation
- Wired handleTabChange() to call setFavoritesTab()
- Synced activeTab with navigation store via currentTab prop
- Back button now returns to correct Favorites tab
cp
- Change top from 0 to -24px to account for container padding
- Ensures nav bar reaches top edge when scrolling
- clearCurrentSearch already collapses search correctly
cp
- Remove negative top margin from .favorites-nav (was -24px, now 0)
- Update clearCurrentSearch() to collapse search when cleared
- Add hover state to clear button for better UX
cp
- Create FavoritesEditModal with preset icon grid
- Add custom image upload button
- Add tab reorder UI with up/down buttons
- Integrate edit button in Favorites page header (top-right)
- Add i18n keys for EN and ES
- Wire modal save handler to backend
cc
- Added $effect to reload preferences each time SettingsView is visible
- Fixes autoplay mode not persisting when navigating away and back
- Settings view doesn't unmount, so onMount only runs once per session
cp
Added translations for:
- Autoplay behavior setting
- Continue within source / Play only selected track options
- Show context icon setting and tooltip
Both English and Spanish translations added.
Changed StackIcon tooltip to use native browser title (matches QualityBadge style).
Removed arrow indicator from context icon (cursor change is sufficient).
cp
Frontend:
- Add show_context_icon to PlaybackPreferences interface
- Add setShowContextIcon function to store
- StackIcon now subscribes to preferences and checks show_context_icon
- Icon hidden when setting is false (context still tracked)
UI (Settings → Playback):
- Add toggle: "Show track playing context in player"
- Tooltip with bilingual explanation (EN/ES)
- Default: enabled (true)
- Persists across restarts
Context tracking ALWAYS active regardless of icon visibility.
Phase 3.6 COMPLETE ✅
cp
Context creation:
- Creates 'home_list' context for Continue Listening section
- Uses 'continue_listening' as ID and 'Continue Listening' as label
- Tracks user's listening history in a context
- Stack icon will show "Playing from: Continue Listening"
Home view now fully integrated with context system.
cp
Context creation:
- Creates 'search' context when playing track from results
- Uses search query as ID and 'Search: {query}' as label
- Applies to both All tab (first 6) and Tracks tab (full list)
- Stack icon will show "Playing from: Search · {query}"
Search view now fully integrated with context system.
cp
Context creation:
- Creates 'favorites' context when playing track
- Uses 'favorites' as ID and 'Favorites' as label
- Uses filteredTracks for context (respects search/filter)
- Stack icon will show "Playing from: Favorites"
Favorites view now fully integrated with context system.
cp
Context creation:
- Creates 'artist_top' context when playing from Top Tracks
- Uses artist ID and name
- Passes track index from UI loop
- Stack icon will show "Playing from: Artist · {name}"
Artist view now fully integrated with context system.
cp
Context creation:
- Creates 'playlist' context when playing track
- Uses playlist ID and name
- Filters out local tracks (Qobuz tracks only in context)
- Finds track index in Qobuz tracks list
- Stack icon will show "Playing from: Playlist · {name}"
Playlist view now fully integrated with context system.
cp
CRITICAL LOGIC FIX:
The autoplay setting was misunderstood. Corrected behavior:
BEFORE (wrong):
- Setting controls whether context is created
- 'continue' = create context
- 'track_only' = clear context
AFTER (correct):
- Context is ALWAYS created when playing from a source (album/playlist)
- Stack icon ALWAYS appears
- Setting only affects what happens at END of track:
- 'continue' = play next track in context
- 'track_only' = stop after current track
Why this makes sense:
- You're playing from an album = that's the context
- Stack icon shows the origin (informative)
- Setting controls continuation behavior (not context existence)
Also:
- Added logging to handleAutoplayModeChange
- Will investigate why setting doesn't persist
cp
UI Fix:
- Add :has(.radio-group) rule to allow flexible height
- Set align-items: flex-start for radio group rows
- Prevents radio buttons from being squashed
Logging Enhancement:
- Log autoplay_mode preference value
- Log track index and total tracks
- Log when no album tracks found
- Will help diagnose why context isn't being created
cp
CRITICAL FIX: Context was being cleared instead of created.
Root cause:
- AlbumDetailView had internal handlers but used parent's onTrackPlay
- Parent's handleAlbumTrackPlay had no context logic
- Result: context always cleared (default behavior)
Solution:
- Moved context creation logic to handleAlbumTrackPlay in +page.svelte
- Checks autoplay_mode preference
- Creates context if 'continue', clears if 'track_only'
- Removed duplicate logic from AlbumDetailView (was never executed)
Now when clicking a track:
1. handleAlbumTrackPlay checks preference
2. Creates/clears context accordingly
3. Stack icon should appear/disappear correctly
Test with default setting ('continue'):
- Click any track → should see context creation logs
- Stack icon should appear immediately
cp
- Add radio buttons: Continue within source / Play only selected track
- Load preference on settings mount
- Save changes immediately via handleAutoplayModeChange
- Styled with hover states and proper spacing
cp
ALSA Direct is currently non-functional due to CPAL limitations:
- CPAL cannot enumerate or open hw:X,Y devices required for bit-perfect playback
- Only named devices (front:, iec958:, sysdefault:) work, but they all use ALSA plugins with resampling
- User's DAC cannot achieve bit-perfect playback (stuck at 44.1kHz regardless of track sample rate)
Changes:
- Filter out ALSA Direct from backend selector dropdown
- Auto-switch users from ALSA Direct to Auto on settings load
- Add comments indicating this is temporary until alsa-rs rewrite
This prevents user frustration with a broken backend while we evaluate implementing
direct ALSA support via alsa-rs (bypassing CPAL entirely).
UX Problem:
- 4 devices all showed "Cambridge Audio USB Audio 2.0"
- Selecting one would select all (Map key collision)
- User couldn't distinguish between hw:4,0, front:CARD=C20, iec958:CARD=C20
Solution:
- Detect duplicate display names in deviceOptions
- Append [device_id] to duplicates for uniqueness
- Example: "Cambridge Audio USB Audio 2.0 (Direct Hardware - Bit-perfect) [hw:4,0]"
Now User Sees:
- Cambridge Audio USB Audio 2.0 (Direct Hardware - Bit-perfect) [hw:4,0] ← TRUE bit-perfect
- Cambridge Audio USB Audio 2.0 [front:CARD=C20,DEV=0] ← Front output with plugins
- Cambridge Audio USB Audio 2.0 [iec958:CARD=C20,DEV=0] ← S/PDIF with plugins
- Cambridge Audio USB Audio 2.0 [sysdefault:CARD=C20] ← System default with dmix
Each option is now unique and selectable. The hw:4,0 option is clearly
marked as "Direct Hardware - Bit-perfect" for audiophiles.
Critical Fix - Use CPAL Device Names:
- CPAL enumerates devices → these IDs actually work for playback
- aplay -L provides friendly descriptions → update CPAL device descriptions
- Stop creating hw:X,Y devices that CPAL doesn't recognize
- Fixes: "Device not found → fallback to default → audio from laptop"
Flow:
1. enumerate_via_cpal() returns devices CPAL can actually use
2. enumerate_via_aplay() calls #1, then parses aplay -L for descriptions
3. Updates device.description with friendly names from aplay -L
4. Frontend shows: "Cambridge Audio USB Audio 2.0" not "front:CARD=C20,DEV=0"
Loading Overlay:
- Full-screen semi-transparent overlay during device enumeration
- Animated spinner (Loader2 icon)
- "Loading audio devices... / Parsing hardware information"
- Prevents user thinking app is frozen during 4-5 second aplay parse
For Bit-Perfect Playback:
- User should select devices like front:CARD=C20,DEV=0 (CPAL knows these)
- These are more direct than sysdefault:CARD= (which has dmix/plugins)
- Not as direct as hw:4,0 but CPAL can actually find them
PipeWire and PulseAudio backends unchanged - still working as before.
ALSA Device Filtering (45 → ~12 devices):
- Aggressively filter to show only useful devices for audiophiles
- Keep: default, sysdefault:CARD=, front:CARD=, hdmi:CARD=, iec958:CARD=
- Blacklist: surround* variants, usbstream:, pipewire, pulse, bare sysdefault
- Reduces 45 listed devices to ~12 actually useful ones
Add hw:CARD=XXX,DEV=0 Devices for Bit-Perfect Playback:
- Auto-generate hw: devices for each detected card
- hw: = direct hardware access without ALSA plugins (true bit-perfect)
- sysdefault:CARD= has dmix/resampling plugins (NOT bit-perfect)
- Description shows "(Direct Hardware - Bit-perfect)" to distinguish
- This fixes user's issue: DAC was stuck at 44.1kHz with sysdefault:CARD=C20
Loading Indicator:
- Show "Loading devices..." while parsing aplay -L output
- Fixes 4-5 second frozen UI on ALSA Direct backend selection
- isLoadingDevices state added to SettingsView
Stop Playback on Device Change:
- Call stop_playback() in handleBackendDeviceChange
- Prevents stuck/dead audio streams when changing output device
- Fixes: "After any config change, song in player stops working"
User can now:
1. Select hw:CARD=C20,DEV=0 for true bit-perfect to DAC
2. See loading indicator instead of frozen UI
3. Change device without breaking playback
4. Only see relevant devices (not 7 surround variants per card)
ALSA Backend Changes:
- Parse aplay -L output to get real hardware descriptions
- Description from hardware: "Cambridge Audio Cambridge Audio USB Audio 2.0, USB Audio"
- No more hardcoded CARD_NAMES for specific hardware
- Still uses CPAL to verify device exists and get max sample rate
- Blacklist filtering preserved (null, lavrate, samplerate, etc.)
Frontend Changes:
- Prefer device.description (from aplay -L) when available
- Falls back to getDevicePrettyName() translation only if no description
- ALSA Direct shows: "Cambridge Audio ... USB Audio, Front output / input"
- Not: "Cambridge Audio USB Front Output" (hardcoded translation)
Removed Hardcoding:
- Removed CS201 → "Cambridge Audio USB" (was specific to user's DAC)
- Removed C20 → "Cambridge Audio"
- Generic CARD_NAMES remain (NVidia, Intel HD Audio, etc.)
This makes device names work for ANY hardware, not just known cards.
Each backend should use native tools:
- ALSA: aplay -L
- PipeWire: pw-cli/pactl (future)
- PulseAudio: pactl (future)
ALSA Device Name Translation:
- Added missing patterns: front:CARD=, surround*:CARD=, iec958:CARD=
- Now shows "Cambridge Audio USB Front Output" instead of "front CS201 Output 0"
- Updated CARD_NAMES: CS201 → "Cambridge Audio USB", C20 → "Cambridge Audio"
- Surround patterns: 40→4.0, 41→4.1, 50→5.0, 51→5.1, 71→7.1
- S/PDIF (iec958) pattern added
Auto Mode Device Selection Fix (CRITICAL):
- Auto mode now only allows "System Default" (no specific device selection)
- Fixes device mismatch issue where PipeWire device names fail in ALSA
- Previous behavior caused:
* User selects DAC in Auto mode (PipeWire device name)
* Player uses legacy ALSA path
* Device not found → falls back to default
* 18+ second delay before playback starts
- Auto mode is now truly automatic - always uses System Default
This prevents cross-backend device name incompatibility. If user wants
to select specific device, they must choose PipeWire, ALSA Direct, or
PulseAudio backend explicitly.
Smart Toggle Improvements:
- DAC Passthrough now only works with PipeWire backend (uses pw-metadata)
- Auto-disables when switching to ALSA Direct, Auto, or PulseAudio
- Exclusive Mode only works with ALSA Direct backend
- Auto-disables when switching to any other backend
- Clear tooltips explain incompatibilities
Device Name Translation:
- Auto backend now loads devices and applies translation (was showing ugly names)
- ALSA Direct always applies translation via needsTranslation()
- All backends use deviceOptions with consistent translation
- Removed separate audioDeviceOptions path that skipped translation
Playback Reset:
- Stop playback when changing backend to prevent stuck/dead streams
- Fixes issue where pressing Play on current track would hang
- Player state is fully reset when backend changes
All backends (Auto, PipeWire, ALSA Direct, PulseAudio) now consistently:
1. Show translated device names
2. Auto-disable incompatible features
3. Reset to System Default device on change
4. Stop playback to prevent stream corruption
- Add DAC Passthrough auto-disable when ALSA Direct backend is selected
- DAC Passthrough toggle becomes disabled (grayed out) with ALSA Direct
- Add tooltip explaining why DAC Passthrough is disabled with ALSA Direct
- Always reset Output Device to System Default when backend changes
- Preserve existing auto-disable of Exclusive Mode with PipeWire/Auto
This ensures incompatible feature combinations are handled automatically,
respecting the user's last manual change while preventing invalid states.
Problem 1: ALSA Direct showed NO devices because aplay -L output doesn't
match CPAL device names, causing create_output_stream to fail.
Solution: Revert to CPAL enumeration but with blacklist filtering to skip
non-playback devices (null, lavrate, samplerate, speexrate, jack, oss,
speex, upmix, vdownmix).
Problem 2: Auto backend didn't apply fancy names because needsTranslation()
was too restrictive and didn't cover all ALSA device name patterns.
Solution: Simplify to: if device name starts with 'alsa_output.' it's from
PipeWire (already has friendly name), otherwise it's ALSA (needs translation).
This covers ALL ALSA naming patterns including front:CARD=, sysdefault:CARD=,
hw:, hdmi:, iec958:, etc.
Changes:
- alsa_backend.rs: Back to CPAL with blacklist filter
- SettingsView.svelte: Simplified needsTranslation() logic
Problem: When Audio Backend was set to Auto, device names showed as raw
ALSA names (hw:0,0) instead of friendly names, even though the translator
exists and works for ALSA Direct.
Root cause: Translation was only applied when selectedBackend === 'ALSA Direct'.
Auto mode can use either ALSA or PipeWire depending on system, so it needs
smart translation.
Solution: Instead of checking selectedBackend, check the device NAME itself.
If it looks like a raw ALSA device (starts with hw:, plughw:, sysdefault:CARD=,
etc.), apply getDevicePrettyName(). Otherwise (PipeWire names like 'Built-in
Audio Analog Stereo'), pass through unchanged.
This works for:
- ALSA Direct: Always translates (all devices are raw ALSA)
- PipeWire: Never translates (all devices are friendly pactl names)
- Auto: Translates only if backend chose ALSA
Changes:
- Add needsTranslation() helper to detect raw ALSA device names
- Apply translation conditionally in deviceOptions and deviceByDisplayName
- Update loadAudioSettings to use same logic
Problem 1: ALSA backend only showed CPAL hardware devices, missing virtual
devices like 'default', 'plughw', USB DACs, etc.
Solution: Use 'aplay -L' to enumerate ALL ALSA devices including:
- Hardware devices (hw:X,Y)
- Virtual devices (default, plughw, dmix)
- USB audio devices
- Network audio devices
Problem 2: UI was applying getDevicePrettyName() to all backends, causing
PipeWire's already-friendly names to be translated incorrectly.
Solution: Only apply translator for ALSA/Auto backends. PipeWire names
pass through unchanged since pactl already provides friendly descriptions.
Changes:
- ALSA backend: Use aplay -L instead of CPAL enumeration
- Frontend: Conditional translation based on selected backend
- Map deviceByDisplayName for correct reverse lookup
- Load settings with correct translation logic
This fixes both issues: ALSA now shows all devices including DACs,
and PipeWire names are no longer mangled.
Apply getDevicePrettyName translator to all audio devices in settings.
This provides user-friendly names for ALSA devices (e.g., 'USB: Topping D50s'
instead of 'hw:0,0') while preserving PipeWire's native descriptions.
Changes:
- Import getDevicePrettyName from audioDeviceNames utils
- Apply translator in deviceOptions derived state
- Create deviceByPrettyName map for reverse lookup
- Update handleBackendDeviceChange to use pretty name mapping
- Update loadAudioSettings to display pretty names
This solves the issue where Auto and ALSA Direct backends showed
cryptic device names while PipeWire showed friendly descriptions.
ALSA Direct Backend Implementation:
- Fully functional ALSA backend using CPAL's ALSA host
- Enumerates ALSA devices with hardware names
- Supports custom sample rates for bit-perfect playback
- Supports exclusive mode (device blocking)
- Smaller buffer size (512 samples) for lower latency in exclusive mode
- Clear error messages when device is in use
Smart Toggles in UI:
- Exclusive Mode auto-disabled with PipeWire/Auto backends
(PipeWire is multiplexed and cannot provide true exclusive access)
- Gapless Playback auto-disabled with DAC Passthrough
(bit-perfect requires recreating streams for sample rate changes)
- Toggle component now supports 'disabled' prop with visual feedback
- Tooltips updated to explain why features are disabled
- Auto-disable exclusive mode when switching to PipeWire backend
User Benefits:
- ALSA Direct now appears in backend dropdown
- True exclusive mode available with ALSA Direct
- Prevents confusing feature combinations
- Clear explanations via tooltips
- No more wondering why exclusive mode doesn't work with PipeWire
Technical Notes:
- ALSA backend uses CPAL host selection (not alsa-rs directly)
- Disabled toggles shown as grayed out with cursor: not-allowed
- Backend switching auto-adjusts incompatible settings
All API requests now go through Cloudflare Workers proxy.
User-provided credentials were collected but never used.
Removed:
- src-tauri/src/api_keys.rs (entire module)
- API Keys section from Settings UI
- ApiKeysState and related commands
- User credential parameters from providers
- Simplified DiscogsClient (removed with_user_credentials)
- Cleaned up imports and translations
Moved documentation:
- CHANGELOG-api-keys-refactor.md
- HANDOFF-MERGE.md
- MERGE-PREP.md
- POST-MERGE-CLEANUP.md
Moved to: qbz-nix-docs/feature-api-keys-refactor/
This cleanup reduces codebase by ~715 lines and removes
confusing UI that promised functionality that didn't work.
This major refactor achieves Flathub compliance by removing all embedded
API credentials from the binary. All API requests now go through a
Cloudflare Workers proxy for secure credential management.
New Features:
- Discogs artwork selection UI with multi-release support
- Catalog number support for audiophile libraries
- Carousel navigation for artwork options
- Release metadata display (title, year)
Technical Changes:
- Cloudflare Workers proxy for Last.fm, Spotify, Tidal, Discogs
- Database migration adds catalog_number column
- URI scheme registration (qbz://) for OAuth flows
- Rate limiting and User-Agent validation server-side
See CHANGELOG-api-keys-refactor.md for complete details.
See POST-MERGE-CLEANUP.md for removing legacy API Keys UI.