feat(phase36): implement context icon visibility toggle (frontend + UI)

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
This commit is contained in:
vicrodh committed 2026-01-18 03:40:19 -06:00
1 parent dfd1eb588d
commit b070884ee8
3 files changed
+56 -6

No files matched your search

@@ -46,6 +46,7 @@
import {
getPlaybackPreferences,
setAutoplayMode,
setShowContextIcon,
type AutoplayMode
} from '$lib/stores/playbackPreferencesStore';
@@ -316,6 +317,7 @@
// Playback settings
let autoplayMode = $state<AutoplayMode>('continue');
let showContextIcon = $state(true);
let gaplessPlayback = $state(true);
let crossfade = $state(0);
let normalizeVolume = $state(false);
@@ -1114,6 +1116,7 @@
try {
const prefs = await getPlaybackPreferences();
autoplayMode = prefs.autoplay_mode;
showContextIcon = prefs.show_context_icon;
} catch (err) {
console.error('Failed to load playback preferences:', err);
}
@@ -1131,6 +1134,18 @@
}
}
async function handleShowContextIconChange(show: boolean) {
console.log('[Settings] Changing show context icon to:', show);
try {
await setShowContextIcon(show);
showContextIcon = show;
console.log('[Settings] Show context icon saved successfully');
} catch (err) {
console.error('[Settings] Failed to set show context icon:', err);
showToast('Failed to save icon visibility preference', 'error');
}
}
async function checkLegacyDownloads() {
try {
const result = await invoke<{has_legacy_files: boolean, total_tracks: number}>('detect_legacy_downloads');
@@ -1478,6 +1493,19 @@
</label>
</div>
</div>
<div class="setting-row">
<div class="label-with-tooltip">
<span class="setting-label">Show track playing context in player</span>
<Tooltip>
<div style="max-width: 260px;">
<strong>English:</strong> Shows the context from which the current track is being played, such as from an album view, artist page, playlist, etc.
<br><br>
<strong>Español:</strong> Muestra el contexto desde donde se está reproduciendo el track actual, por ejemplo desde la vista de álbum, de artista, playlist, etc.
</div>
</Tooltip>
</div>
<Toggle enabled={showContextIcon} onchange={handleShowContextIconChange} />
</div>
<div class="setting-row">
<div class="label-with-tooltip">
<span class="setting-label">{$t('settings.playback.gapless')}</span>