From 12011577d7a6a11af05198113f50fe18304a41d0 Mon Sep 17 00:00:00 2001 From: vicrodh <103399283+vicrodh@users.noreply.github.com> Date: Fri, 23 Jan 2026 01:02:13 -0600 Subject: [PATCH] feat(artists): add virtualized list view component --- .../components/VirtualizedArtistList.svelte | 327 ++++++++++++++++++ .../components/views/LocalLibraryView.svelte | 42 +-- 2 files changed, 335 insertions(+), 34 deletions(-) create mode 100644 src/lib/components/VirtualizedArtistList.svelte diff --git a/src/lib/components/VirtualizedArtistList.svelte b/src/lib/components/VirtualizedArtistList.svelte new file mode 100644 index 000000000..cee52bdaa --- /dev/null +++ b/src/lib/components/VirtualizedArtistList.svelte @@ -0,0 +1,327 @@ + + +
+
+ {#each visibleItems as item (getItemKey(item))} +
+ {#if item.type === 'header'} +
+ {item.key} +
+ {:else if item.type === 'artist'} + {@const artistImage = artistImages.get(item.artist.name)} +
onArtistClick(item.artist.name)} + onkeydown={(e) => e.key === 'Enter' && onArtistClick(item.artist.name)} + > +
+ {#if artistImage} + {item.artist.name} + {:else} + + {/if} +
+
+
{item.artist.name}
+
+ {item.artist.album_count} albums • {item.artist.track_count} tracks +
+
+
+ {/if} +
+ {/each} +
+
+ + diff --git a/src/lib/components/views/LocalLibraryView.svelte b/src/lib/components/views/LocalLibraryView.svelte index b8b008a1c..212f39b8f 100644 --- a/src/lib/components/views/LocalLibraryView.svelte +++ b/src/lib/components/views/LocalLibraryView.svelte @@ -13,6 +13,7 @@ import AlbumCard from '../AlbumCard.svelte'; import VirtualizedAlbumList from '../VirtualizedAlbumList.svelte'; import VirtualizedArtistGrid from '../VirtualizedArtistGrid.svelte'; + import VirtualizedArtistList from '../VirtualizedArtistList.svelte'; import VirtualizedTrackList from '../VirtualizedTrackList.svelte'; import { isVirtualizationEnabled, @@ -2546,41 +2547,14 @@ /> {:else} - +
-
- {#each groupedArtists as group (group.id)} - {#if artistGroupingEnabled && group.key} -
- {group.key} -
- {/if} - {#each group.artists as artist (artist.name)} - {@const artistImage = artistImages.get(artist.name)} -
handleLocalArtistClick(artist.name)} - onkeydown={(e) => e.key === 'Enter' && handleLocalArtistClick(artist.name)} - > -
- {#if artistImage} - {artist.name} - {:else} - - {/if} -
-
-
{artist.name}
-
- {artist.album_count} albums • {artist.track_count} tracks -
-
-
- {/each} - {/each} -
+
{/if}