refactor(suggestions): move preview to album art overlay

Move play button from action buttons to album art hover overlay,
matching the pattern used in ArtistDetailView popular tracks.
This commit is contained in:
vicrodh committed 2026-01-27 17:56:31 -06:00
1 parent 79e37cbf7a
commit 900df9307a
1 file changed
+32 -18
+32 -18
View File
@@ -309,6 +309,15 @@
}}
/>
{/if}
{#if onPreviewTrack}
<button
class="play-overlay"
onclick={(e) => { e.stopPropagation(); onPreviewTrack(track); }}
aria-label="Preview track"
>
<Play size={16} fill="white" color="white" />
</button>
{/if}
</div>
<div class="track-info">
@@ -345,15 +354,6 @@
</div>
<div class="actions">
{#if onPreviewTrack}
<button
class="action-btn preview"
onclick={(e) => { e.stopPropagation(); onPreviewTrack(track); }}
title="Preview"
>
<Play size={14} />
</button>
{/if}
<button
class="action-btn info"
onclick={(e) => { e.stopPropagation(); handleShowTrackInfo(track.track_id); }}
@@ -521,6 +521,7 @@
border-radius: 4px;
overflow: hidden;
flex-shrink: 0;
position: relative;
}
.album-art img {
@@ -529,6 +530,28 @@
object-fit: cover;
}
.play-overlay {
position: absolute;
inset: 0;
display: none;
align-items: center;
justify-content: center;
background: rgba(0, 0, 0, 0.5);
border: none;
border-radius: 4px;
cursor: pointer;
transition: background 150ms ease;
z-index: 2;
}
.suggestion-row:hover .play-overlay {
display: flex;
}
.play-overlay:hover {
background: rgba(0, 0, 0, 0.7);
}
.track-info {
flex: 1;
min-width: 0;
@@ -623,15 +646,6 @@
color: var(--text-primary);
}
.action-btn.preview {
color: var(--text-muted);
}
.action-btn.preview:hover {
background: var(--accent-primary);
color: white;
}
.action-btn.info {
color: var(--text-muted);
}