From d49eaf000f15ce2923c1c4f233557c7c53a50e44 Mon Sep 17 00:00:00 2001 From: vicrodh <103399283+vicrodh@users.noreply.github.com> Date: Sun, 8 Feb 2026 21:25:59 -0600 Subject: [PATCH] feat: add VirtualizedFavoritesAlbumGrid component Binary search virtualization for favorite albums in both grid and list modes. Grid uses AlbumCard with responsive columns, list uses inline rows with QualityBadge. Supports grouping, scroll-to-group, and all album action callbacks. --- .../VirtualizedFavoritesAlbumGrid.svelte | 486 ++++++++++++++++++ 1 file changed, 486 insertions(+) create mode 100644 src/lib/components/VirtualizedFavoritesAlbumGrid.svelte diff --git a/src/lib/components/VirtualizedFavoritesAlbumGrid.svelte b/src/lib/components/VirtualizedFavoritesAlbumGrid.svelte new file mode 100644 index 000000000..0bca5af2a --- /dev/null +++ b/src/lib/components/VirtualizedFavoritesAlbumGrid.svelte @@ -0,0 +1,486 @@ + + +
+
+ {#each visibleItems as item (getItemKey(item))} +
+ {#if item.type === 'header'} +
+ {item.key} + {item.albumCount} +
+ {:else if item.type === 'grid-row'} +
+ {#each item.albums as album (album.id)} + onAlbumPlay(album.id) : undefined} + onPlayNext={onAlbumPlayNext ? () => onAlbumPlayNext(album.id) : undefined} + onPlayLater={onAlbumPlayLater ? () => onAlbumPlayLater(album.id) : undefined} + onShareQobuz={onAlbumShareQobuz ? () => onAlbumShareQobuz(album.id) : undefined} + onShareSonglink={onAlbumShareSonglink ? () => onAlbumShareSonglink(album.id) : undefined} + onDownload={onAlbumDownload ? () => onAlbumDownload(album.id) : undefined} + isAlbumFullyDownloaded={isAlbumDownloaded?.(album.id) ?? false} + onOpenContainingFolder={onOpenAlbumFolder ? () => onOpenAlbumFolder(album.id) : undefined} + onReDownloadAlbum={onReDownloadAlbum ? () => onReDownloadAlbum(album.id) : undefined} + {downloadStateVersion} + onclick={() => handleAlbumClickEvent(album.id)} + /> + {/each} +
+ {:else if item.type === 'list-row'} + {@const album = item.album} +
handleAlbumClickEvent(album.id)}> +
+ {#if album.image?.thumbnail || album.image?.small || album.image?.large} + {album.title} + {:else} +
+ +
+ {/if} +
+
+
{album.title}
+
+ {album.artist.name} + {#if getAlbumYear?.(album)}{getAlbumYear(album)}{/if} +
+
+
+ +
+
+ {/if} +
+ {/each} +
+
+ +