Add release date display to AlbumCard overlay

- Add releaseDate prop to AlbumCard component
- Display release date below genre in overlay (format: "Jan 25, 2026")
- Update all AlbumCard usages across views to pass releaseDate:
  - ArtistDetailView (all album sections)
  - HomeView (all featured album sections)
  - SearchView (search results)
  - FavoritesView (favorite albums)
  - LabelView (label albums)
  - AlbumDetailView ("By the same artist" section)
- Add releaseDate to types and adapters
- Skip local library view (VirtualizedAlbumList)
This commit is contained in:
vicrodh committed 2026-01-25 23:47:33 -06:00
1 parent e9e319aa46
commit e9c7e4672c
10 files changed
+73 -6

No files matched your search

+37 -2
View File
@@ -15,6 +15,7 @@
title: string;
artist: string;
genre: string;
releaseDate?: string;
quality?: string;
size?: 'standard' | 'large';
searchId?: string;
@@ -40,6 +41,7 @@
title,
artist,
genre,
releaseDate,
quality,
size = 'standard',
searchId,
@@ -90,6 +92,19 @@
imageError = true;
}
function formatReleaseDate(dateStr: string | undefined): string {
if (!dateStr) return '';
const date = new Date(dateStr);
if (isNaN(date.getTime())) return '';
return date.toLocaleDateString('en-US', {
month: 'short',
day: 'numeric',
year: 'numeric'
});
}
const formattedDate = $derived(formatReleaseDate(releaseDate));
async function handleToggleFavorite(event: MouseEvent) {
event.stopPropagation();
if (!albumId || !favoriteAvailable) return;
@@ -184,7 +199,12 @@
<!-- Action Overlay -->
{#if hasOverlay}
<div class="action-overlay" class:menu-open={menuOpen}>
<div class="overlay-genre">{genre}</div>
<div class="overlay-info">
<span class="overlay-genre">{genre}</span>
{#if formattedDate}
<span class="overlay-date">{formattedDate}</span>
{/if}
</div>
<div class="action-buttons">
{#if showFavoriteButton}
<button
@@ -393,15 +413,30 @@
height: 30px;
}
.overlay-genre {
.overlay-info {
align-self: flex-start;
width: 100%;
text-align: left;
padding: 14px 14px;
display: flex;
flex-direction: column;
gap: 4px;
}
.overlay-genre {
font-size: 14px;
font-weight: 600;
color: white;
text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
word-wrap: break-word;
overflow-wrap: break-word;
}
.overlay-date {
font-size: 12px;
font-weight: 400;
color: rgba(255, 255, 255, 0.85);
text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}
:global(.album-card .album-menu) {