refactor(playlists): unify track row appearance and add remove option

- Move local track indicator from quality column to favorite button position
  for consistent row alignment with Qobuz tracks
- Remove explicit delete button from playlist track rows (was easy to
  accidentally click)
- Add "Remove from playlist" option to TrackMenu for all tracks (local and
  Qobuz)
- Qobuz track removal uses playlist_track_id from API response
- Clean up unused CSS and imports from PlaylistDetailView

cc
This commit is contained in:
vicrodh committed 2026-01-16 06:18:32 -06:00
1 parent 3915abd3bb
commit d731805eca
3 files changed
+55 -73

No files matched your search

+20 -2
View File
@@ -11,7 +11,8 @@
Share2,
Disc3,
User,
Link
Link,
Trash2
} from 'lucide-svelte';
interface Props {
@@ -20,6 +21,7 @@
onPlayLater?: () => void;
onAddFavorite?: () => void;
onAddToPlaylist?: () => void;
onRemoveFromPlaylist?: () => void;
onShareQobuz?: () => void;
onShareSonglink?: () => void;
onGoToAlbum?: () => void;
@@ -32,6 +34,7 @@
onPlayLater,
onAddFavorite,
onAddToPlaylist,
onRemoveFromPlaylist,
onShareQobuz,
onShareSonglink,
onGoToAlbum,
@@ -49,7 +52,7 @@
let submenuStyle = $state('');
const hasPlayback = $derived(!!(onPlayNow || onPlayNext || onPlayLater));
const hasLibrary = $derived(!!(onAddFavorite || onAddToPlaylist));
const hasLibrary = $derived(!!(onAddFavorite || onAddToPlaylist || onRemoveFromPlaylist));
const hasShare = $derived(!!(onShareQobuz || onShareSonglink));
const hasNav = $derived(!!(onGoToAlbum || onGoToArtist));
const hasMenu = $derived(hasPlayback || hasLibrary || hasShare || hasNav);
@@ -205,6 +208,12 @@
<span>Add to playlist</span>
</button>
{/if}
{#if onRemoveFromPlaylist}
<button class="menu-item danger" onclick={() => handleAction(onRemoveFromPlaylist)}>
<Trash2 size={14} />
<span>Remove from playlist</span>
</button>
{/if}
{/if}
{#if hasLibrary && (hasShare || hasNav)}
@@ -333,6 +342,15 @@
color: var(--text-primary);
}
.menu-item.danger {
color: #ef4444;
}
.menu-item.danger:hover {
background-color: rgba(239, 68, 68, 0.1);
color: #ef4444;
}
.separator {
height: 1px;
background-color: var(--bg-hover);