fix(phase3): context navigation and autoplay persistence

- Fixed context navigation using correct property names (.type, .id)
- Simplified autoplay setting from radio buttons to toggle switch
- Fixed tooltip using native title attribute (like QualityBadge)
- Removed custom tooltip CSS and hover state
- Updated translations (en/es) for clearer autoplay behavior description

cp
This commit is contained in:
vicrodh committed 2026-01-18 04:53:43 -06:00
1 parent 315bdce79c
commit 12067d7a61
5 files changed
+17 -112

No files matched your search

+7 -81
View File
@@ -14,19 +14,12 @@
let context = $state(getCurrentContext());
let displayInfo = $state(context ? getContextDisplayInfo() : null);
let showIcon = $state(getCachedPreferences().show_context_icon);
let isHovering = $state(false);
function handleClick(e: MouseEvent) {
e.stopPropagation();
e.preventDefault();
console.log('[StackIcon] Button clicked');
console.log('[StackIcon] onClick prop:', onClick);
console.log('[StackIcon] Current context:', context);
if (onClick) {
console.log('[StackIcon] Calling onClick callback');
onClick();
} else {
console.warn('[StackIcon] No onClick callback provided');
}
}
@@ -59,35 +52,17 @@
</script>
{#if context && displayInfo && showIcon}
<div
class="stack-icon-container {className}"
onmouseenter={() => isHovering = true}
onmouseleave={() => isHovering = false}
<button
class="stack-icon-wrapper {className}"
onclick={handleClick}
type="button"
title="Playing from {displayInfo} (click to navigate)"
>
<button
class="stack-icon-wrapper"
onclick={handleClick}
type="button"
>
<Layers size={size} strokeWidth={2} />
</button>
{#if isHovering}
<div class="context-tooltip">
<div class="tooltip-label">Playing from</div>
<div class="tooltip-value">{displayInfo}</div>
<div class="tooltip-hint">Click to navigate</div>
</div>
{/if}
</div>
<Layers size={size} strokeWidth={2} />
</button>
{/if}
<style>
.stack-icon-container {
position: relative;
display: inline-flex;
}
.stack-icon-wrapper {
display: inline-flex;
align-items: center;
@@ -112,53 +87,4 @@
.stack-icon-wrapper:active {
transform: scale(0.95);
}
.context-tooltip {
position: absolute;
bottom: calc(100% + 8px);
left: 50%;
transform: translateX(-50%);
background: rgba(24, 24, 28, 0.98);
border: 1px solid rgba(255, 255, 255, 0.1);
border-radius: 6px;
padding: 8px 12px;
min-width: 140px;
max-width: 220px;
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
z-index: 9999;
animation: tooltip-appear 150ms ease;
pointer-events: none;
white-space: nowrap;
}
@keyframes tooltip-appear {
from {
opacity: 0;
transform: translateX(-50%) translateY(4px);
}
to {
opacity: 1;
transform: translateX(-50%) translateY(0);
}
}
.tooltip-label {
font-size: 9px;
text-transform: uppercase;
letter-spacing: 0.5px;
color: rgba(255, 255, 255, 0.4);
margin-bottom: 4px;
}
.tooltip-value {
font-size: 12px;
font-weight: 500;
color: white;
}
.tooltip-hint {
font-size: 10px;
color: rgba(255, 255, 255, 0.5);
margin-top: 4px;
}
</style>
+1 -22
View File
@@ -1483,28 +1483,7 @@
<span class="setting-label">{$t('settings.playback.autoplayBehavior')}</span>
<span class="setting-desc">{$t('settings.playback.autoplayBehaviorDesc')}</span>
</div>
<div class="radio-group">
<label class="radio-option">
<input
type="radio"
name="autoplay-mode"
value="continue"
checked={autoplayMode === 'continue'}
onchange={() => handleAutoplayModeChange('continue')}
/>
<span>{$t('settings.playback.continueWithinSource')}</span>
</label>
<label class="radio-option">
<input
type="radio"
name="autoplay-mode"
value="track_only"
checked={autoplayMode === 'track_only'}
onchange={() => handleAutoplayModeChange('track_only')}
/>
<span>{$t('settings.playback.playOnlySelectedTrack')}</span>
</label>
</div>
<Toggle enabled={autoplayMode === 'continue'} onchange={(enabled) => handleAutoplayModeChange(enabled ? 'continue' : 'track_only')} />
</div>
<div class="setting-row">
<div class="label-with-tooltip">
+2 -2
View File
@@ -312,8 +312,8 @@
"crossfade": "Crossfade",
"crossfadeSeconds": "{seconds}s",
"normalizeVolume": "Normalize Volume",
"autoplayBehavior": "Autoplay behavior",
"autoplayBehaviorDesc": "Choose what happens when you click a track",
"autoplayBehavior": "Continue playback after track ends",
"autoplayBehaviorDesc": "When enabled, plays next track in the source. When disabled, stops after each track",
"continueWithinSource": "Continue within source",
"playOnlySelectedTrack": "Play only selected track",
"showContextIcon": "Show track playing context in player",
+2 -2
View File
@@ -312,8 +312,8 @@
"crossfade": "Crossfade",
"crossfadeSeconds": "{seconds}s",
"normalizeVolume": "Normalizar Volumen",
"autoplayBehavior": "Comportamiento de autoreproducción",
"autoplayBehaviorDesc": "Elige qué sucede al hacer clic en una pista",
"autoplayBehavior": "Continuar reproducción al finalizar pista",
"autoplayBehaviorDesc": "Cuando está activado, reproduce la siguiente pista del contexto. Cuando está desactivado, se detiene después de cada pista",
"continueWithinSource": "Continuar dentro del contexto",
"playOnlySelectedTrack": "Reproducir solo la pista seleccionada",
"showContextIcon": "Mostrar contexto de reproducción en el reproductor",