From 513ac9a8a025ff92731c5a2c7239c8d89461dcb5 Mon Sep 17 00:00:00 2001 From: vicrodh <103399283+vicrodh@users.noreply.github.com> Date: Sun, 11 Jan 2026 20:44:39 -0600 Subject: [PATCH] feat(playlists): Update PlaylistDetailView with collage, stats, edit button - Replace artwork section with PlaylistCollage component - Add play count display in header info (with BarChart2 icon) - Increment play count when "Play All" is clicked - Add edit button that opens PlaylistModal - Add handleEditSuccess and handleDelete callbacks - Add onPlaylistUpdated and onPlaylistDeleted props - Update Sidebar to use NavigationItem in list view (icons only) - Keep PlaylistCollage in grid view only per user request - Add badge and class props to NavigationItem component --- src/lib/components/NavigationItem.svelte | 15 +- src/lib/components/Sidebar.svelte | 85 +++-------- .../views/PlaylistDetailView.svelte | 140 +++++++++++++++--- 3 files changed, 154 insertions(+), 86 deletions(-) diff --git a/src/lib/components/NavigationItem.svelte b/src/lib/components/NavigationItem.svelte index 85bd11b9e..6c4de747f 100644 --- a/src/lib/components/NavigationItem.svelte +++ b/src/lib/components/NavigationItem.svelte @@ -4,16 +4,18 @@ interface Props { icon: Snippet; label: string; + badge?: string; active?: boolean; onclick?: () => void; + class?: string; } - let { icon, label, active = false, onclick }: Props = $props(); + let { icon, label, badge, active = false, onclick, class: className = '' }: Props = $props(); diff --git a/src/lib/components/Sidebar.svelte b/src/lib/components/Sidebar.svelte index ca19848f1..c92659c82 100644 --- a/src/lib/components/Sidebar.svelte +++ b/src/lib/components/Sidebar.svelte @@ -309,27 +309,27 @@
Loading...
{:else if filteredPlaylists.length > 0} {#if playlistViewMode === 'list'} - -
+ +
+ {:else}
@@ -580,64 +580,16 @@ } /* Playlist list view */ - .playlists-list { + .playlists-nav { display: flex; flex-direction: column; gap: 2px; } - .playlist-list-item { - display: flex; - align-items: center; - gap: 10px; - padding: 6px 8px; - background: none; - border: none; - border-radius: 6px; - cursor: pointer; - transition: background-color 150ms ease; - text-align: left; - width: 100%; - } - - .playlist-list-item:hover { - background: var(--bg-tertiary); - } - - .playlist-list-item.active { - background: var(--bg-hover); - } - - .playlist-list-item.hidden-playlist { + .playlists-nav :global(.hidden-playlist) { opacity: 0.5; } - .playlist-info { - flex: 1; - min-width: 0; - display: flex; - flex-direction: column; - gap: 1px; - } - - .playlist-name { - font-size: 13px; - color: var(--text-primary); - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - } - - .playlist-count { - font-size: 11px; - color: var(--text-muted); - } - - .playlist-list-item :global(.hidden-indicator) { - color: var(--text-muted); - flex-shrink: 0; - } - /* Playlist grid view */ .playlists-grid { display: grid; @@ -695,6 +647,7 @@ -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; + color: var(--text-primary); } .playlists-loading, diff --git a/src/lib/components/views/PlaylistDetailView.svelte b/src/lib/components/views/PlaylistDetailView.svelte index fa5f30429..c357d6a23 100644 --- a/src/lib/components/views/PlaylistDetailView.svelte +++ b/src/lib/components/views/PlaylistDetailView.svelte @@ -1,6 +1,8 @@