From bc2491cb95bb84a2f5b7e96a0033e761cd944af1 Mon Sep 17 00:00:00 2001 From: vicrodh <103399283+vicrodh@users.noreply.github.com> Date: Sat, 24 Jan 2026 11:07:29 -0600 Subject: [PATCH] feat(album): circular buttons and full release date Header buttons: - Play button: circular 44px with accent background (primary action) - Shuffle button: circular 36px with outline (secondary) - Favorite button: circular 36px with outline, highlight when active Release date: - Added releaseDate field to AlbumDetail type - Adapter now includes full release_date_original from Qobuz API - Display formatted date (e.g., "January 15, 2024") with year fallback --- src/lib/adapters/qobuzAdapters.ts | 1 + .../components/views/AlbumDetailView.svelte | 136 +++++++++--------- src/lib/types/index.ts | 1 + 3 files changed, 74 insertions(+), 64 deletions(-) diff --git a/src/lib/adapters/qobuzAdapters.ts b/src/lib/adapters/qobuzAdapters.ts index 04fcf53aa..2a1002d19 100644 --- a/src/lib/adapters/qobuzAdapters.ts +++ b/src/lib/adapters/qobuzAdapters.ts @@ -323,6 +323,7 @@ export function convertQobuzAlbum(album: QobuzAlbum): AlbumDetail { artist: album.artist?.name || 'Unknown Artist', artistId: album.artist?.id, year: album.release_date_original?.split('-')[0] || '', + releaseDate: album.release_date_original, label: album.label?.name || '', genre: album.genre?.name || '', quality, diff --git a/src/lib/components/views/AlbumDetailView.svelte b/src/lib/components/views/AlbumDetailView.svelte index 33ae9962e..105206678 100644 --- a/src/lib/components/views/AlbumDetailView.svelte +++ b/src/lib/components/views/AlbumDetailView.svelte @@ -34,6 +34,7 @@ artist: string; artistId?: number; year: string; + releaseDate?: string; label: string; genre: string; quality: string; @@ -105,7 +106,6 @@ let isFavorite = $state(false); let isFavoriteLoading = $state(false); - let playBtnHovered = $state(false); let scrollContainer: HTMLDivElement | null = $state(null); const albumFullyDownloaded = $derived( @@ -116,6 +116,21 @@ album.artist?.trim().toLowerCase() === 'various artists' ); + // Format release date nicely, fallback to year + const formattedReleaseDate = $derived.by(() => { + if (album.releaseDate) { + const date = new Date(album.releaseDate); + if (!isNaN(date.getTime())) { + return date.toLocaleDateString('en-US', { + year: 'numeric', + month: 'long', + day: 'numeric' + }); + } + } + return album.year; + }); + async function scrollToTrack(trackId: number) { await tick(); const target = scrollContainer?.querySelector(`[data-track-id="${trackId}"]`); @@ -193,30 +208,36 @@ {:else}
{album.artist}
{/if} -
{album.year} • {album.label} • {album.genre}
+
{formattedReleaseDate} • {album.label} • {album.genre}
{album.quality}
{album.trackCount} tracks • {album.duration}
- - @@ -227,7 +248,7 @@ onShareQobuz={onShareAlbumQobuz} onShareSonglink={onShareAlbumSonglink} onDownload={onDownloadAlbum} - isAlbumFullyCached={albumFullyDownloaded} + isAlbumFullyDownloaded={albumFullyDownloaded} onOpenContainingFolder={onOpenAlbumFolder} onReDownloadAlbum={onReDownloadAlbum} /> @@ -417,62 +438,49 @@ gap: 12px; } - .play-btn { - height: 40px; - padding: 0 24px; - border-radius: 8px; - border: none; - display: flex; - align-items: center; - gap: 8px; - cursor: pointer; - transition: background-color 150ms ease; - } - - .play-btn span { - font-size: 14px; - font-weight: 500; - color: white; - } - - .secondary-btn { - height: 40px; - padding: 0 24px; - border-radius: 8px; - border: 1px solid rgba(255, 255, 255, 0.3); - background: transparent; - display: flex; - align-items: center; - gap: 8px; - color: white; - cursor: pointer; - transition: background-color 150ms ease; - } - - .secondary-btn:hover { - background-color: rgba(255, 255, 255, 0.1); - } - - .secondary-btn span { - font-size: 14px; - font-weight: 500; - } - - .icon-btn { - width: 40px; - height: 40px; - border-radius: 50%; - border: none; - background: transparent; + .action-btn { display: flex; align-items: center; justify-content: center; + width: 36px; + height: 36px; + border-radius: 50%; + border: 1px solid rgba(255, 255, 255, 0.3); + background: transparent; + color: var(--text-muted); cursor: pointer; - transition: background-color 150ms ease; + transition: background 150ms ease, color 150ms ease, border-color 150ms ease; } - .icon-btn:hover { - background-color: rgba(255, 255, 255, 0.1); + .action-btn:hover:not(:disabled) { + background: var(--bg-hover); + color: var(--text-primary); + border-color: var(--text-primary); + } + + .action-btn:disabled { + opacity: 0.5; + cursor: not-allowed; + } + + .action-btn.primary { + width: 44px; + height: 44px; + background: var(--accent-primary); + border: none; + color: white; + box-shadow: 0 0 2px 1px rgba(var(--accent-primary-rgb, 139, 92, 246), 0.3); + } + + .action-btn.primary:hover { + background: var(--accent-hover); + box-shadow: 0 0 16px 6px rgba(var(--accent-primary-rgb, 139, 92, 246), 0.5); + } + + .action-btn.is-favorite { + background: rgba(var(--accent-primary-rgb, 139, 92, 246), 0.15); + border-color: var(--accent-primary); + color: var(--accent-primary); } .divider { diff --git a/src/lib/types/index.ts b/src/lib/types/index.ts index 5cfe44b60..dc9090a29 100644 --- a/src/lib/types/index.ts +++ b/src/lib/types/index.ts @@ -106,6 +106,7 @@ export interface AlbumDetail { artist: string; artistId?: number; year: string; + releaseDate?: string; // Full date in YYYY-MM-DD format label: string; genre: string; quality: string;