From 40cd6d730323b5eb4b35ca05490abe7c279ac919 Mon Sep 17 00:00:00 2001 From: vicrodh <103399283+vicrodh@users.noreply.github.com> Date: Fri, 16 Jan 2026 21:39:48 -0600 Subject: [PATCH] fix: improve tooltip UX and enforce mutual exclusion on load Tooltip improvements: - Consolidate duplicate tooltips into single unified tooltip - Show device info + DAC status + sample rate in one place - Remove native 'title' attributes that were causing conflicts - Add visual indicators (colored dots) for setting states - Display resampling warning with actual rates when detected - Better structured tooltip with sections Mutual exclusion enforcement: - Validate settings on load in loadAudioSettings() - Auto-disable Gapless and Crossfade if DAC Passthrough is enabled - Prevents invalid state from persisted settings This fixes the issue where users could have incompatible settings active simultaneously after app restart. --- src/lib/components/AudioOutputBadges.svelte | 103 ++++++++++++++++--- src/lib/components/views/SettingsView.svelte | 12 +++ 2 files changed, 103 insertions(+), 12 deletions(-) diff --git a/src/lib/components/AudioOutputBadges.svelte b/src/lib/components/AudioOutputBadges.svelte index 287b10042..edbaf939a 100644 --- a/src/lib/components/AudioOutputBadges.svelte +++ b/src/lib/components/AudioOutputBadges.svelte @@ -157,7 +157,6 @@ class:active={dacBadgeState === 'active'} class:warning={dacBadgeState === 'warning'} class:off={dacBadgeState === 'off'} - title={showTooltips ? dacTooltip : undefined} > DAC @@ -166,23 +165,58 @@
EXC
- + {#if isHovering && showTooltips}
-
Output Device
-
{prettyDeviceName}
- {#if currentDevice && currentDevice !== prettyDeviceName} -
{currentDevice}
- {/if} - {#if currentVolume !== null} -
- Volume: - {currentVolume}% + +
+
Output Device
+
{prettyDeviceName}
+ {#if currentDevice && currentDevice !== prettyDeviceName} +
{currentDevice}
+ {/if} + {#if currentVolume !== null} +
+ Volume: + {currentVolume}% +
+ {/if} +
+ + + {#if settings?.dac_passthrough || settings?.exclusive_mode} +
+
Audio Settings
+ {#if settings.dac_passthrough} +
+ ● + + {#if dacBadgeState === 'warning'} + ⚠ DAC Passthrough: Resampling detected + {#if hardwareStatus?.hardware_sample_rate && samplingRate} +
{samplingRate} kHz → {(hardwareStatus.hardware_sample_rate / 1000).toFixed(1)} kHz + {/if} + {:else if dacBadgeState === 'active'} + DAC Passthrough: Bit-perfect + {#if hardwareStatus?.hardware_sample_rate} +
{(hardwareStatus.hardware_sample_rate / 1000).toFixed(1)} kHz + {/if} + {:else} + DAC Passthrough: Off + {/if} +
+
+ {/if} + {#if settings.exclusive_mode} +
+ ● + Exclusive Mode +
+ {/if}
{/if}
@@ -312,4 +346,49 @@ font-weight: 500; color: rgba(255, 255, 255, 0.8); } + + .tooltip-section { + margin-bottom: 8px; + } + + .tooltip-section:last-child { + margin-bottom: 0; + } + + .tooltip-setting { + display: flex; + align-items: flex-start; + gap: 6px; + margin-top: 6px; + font-size: 11px; + } + + .setting-icon { + font-size: 8px; + color: rgba(255, 255, 255, 0.3); + line-height: 1.4; + } + + .setting-icon.active { + color: #22c55e; + } + + .setting-icon.warning { + color: #eab308; + } + + .setting-text { + color: rgba(255, 255, 255, 0.7); + line-height: 1.4; + } + + .tooltip-setting.warning .setting-text { + color: #eab308; + } + + .setting-detail { + font-size: 10px; + color: rgba(255, 255, 255, 0.5); + font-family: var(--font-mono, monospace); + } diff --git a/src/lib/components/views/SettingsView.svelte b/src/lib/components/views/SettingsView.svelte index 75bb16e83..31c14258b 100644 --- a/src/lib/components/views/SettingsView.svelte +++ b/src/lib/components/views/SettingsView.svelte @@ -795,6 +795,18 @@ } exclusiveMode = settings.exclusive_mode; dacPassthrough = settings.dac_passthrough; + + // Validate mutual exclusion: DAC Passthrough disables Gapless + Crossfade + if (dacPassthrough) { + if (gaplessPlayback) { + console.warn('DAC Passthrough and Gapless both enabled - disabling Gapless'); + gaplessPlayback = false; + } + if (crossfade > 0) { + console.warn('DAC Passthrough and Crossfade both enabled - disabling Crossfade'); + crossfade = 0; + } + } } catch (err) { console.error('Failed to load audio settings:', err); }