From 5f7a0ae57d89a90ef97211b1ab3120c4b76262c5 Mon Sep 17 00:00:00 2001 From: vicrodh <103399283+vicrodh@users.noreply.github.com> Date: Sun, 8 Feb 2026 21:24:40 -0600 Subject: [PATCH] feat: integrate VirtualizedFavoritesArtistList into sidepanel Replace raw {#each} loops in artist sidepanel left column with virtualized list component. Remove ticker animation state from parent (now encapsulated in VirtualizedFavoritesArtistList). Clean up unused CSS for artist-list-* classes. --- src/lib/components/views/FavoritesView.svelte | 181 +----------------- 1 file changed, 8 insertions(+), 173 deletions(-) diff --git a/src/lib/components/views/FavoritesView.svelte b/src/lib/components/views/FavoritesView.svelte index 2e8900273..bbf7ccaf4 100644 --- a/src/lib/components/views/FavoritesView.svelte +++ b/src/lib/components/views/FavoritesView.svelte @@ -9,6 +9,7 @@ import QualityBadge from '../QualityBadge.svelte'; import VirtualizedTrackList from '../VirtualizedTrackList.svelte'; import VirtualizedFavoritesArtistGrid from '../VirtualizedFavoritesArtistGrid.svelte'; + import VirtualizedFavoritesArtistList from '../VirtualizedFavoritesArtistList.svelte'; import FavoritePlaylistCard from '../FavoritePlaylistCard.svelte'; import FavoritesEditModal from '../FavoritesEditModal.svelte'; import ViewTransition from '../ViewTransition.svelte'; @@ -357,31 +358,6 @@ } } - // Ticker animation for long artist names in sidepanel - let hoveredArtistId = $state(null); - let artistNameOverflows = $state>(new Map()); - const tickerSpeed = 40; // px per second - - function measureArtistNameOverflow(artistId: number, element: HTMLElement | null) { - if (!element) return; - const textSpan = element.querySelector('.artist-name-text') as HTMLElement | null; - if (!textSpan) return; - const overflow = textSpan.scrollWidth - element.clientWidth; - if (overflow > 0) { - artistNameOverflows.set(artistId, overflow); - } else { - artistNameOverflows.delete(artistId); - } - } - - function getArtistNameTickerStyle(artistId: number): string { - if (hoveredArtistId !== artistId) return ''; - const overflow = artistNameOverflows.get(artistId); - if (!overflow || overflow <= 0) return ''; - const duration = (overflow + 16) / tickerSpeed; - return `--ticker-offset: -${overflow + 16}px; --ticker-duration: ${duration}s;`; - } - let showTracksContextMenu = $state(false); function resolveCustomIconSrc(path: string | null): string | null { if (!path) return null; @@ -1760,50 +1736,14 @@ {@const groupedArtistsSidepanel = groupArtists(filteredArtists)}
- +
-
- {#each groupedArtistsSidepanel as group (group.id)} -
{group.key}
- {#each group.artists as artist (artist.id)} - {@const hasOverflow = artistNameOverflows.has(artist.id)} - {@const isHovered = hoveredArtistId === artist.id} - - {/each} - {/each} -
+
@@ -2853,111 +2793,6 @@ padding-left: 18px; } - .artist-list-scroll { - flex: 1; - overflow-y: auto; - padding: 4px 12px 4px 0; - /* Smooth scrolling optimizations */ - -webkit-overflow-scrolling: touch; - scroll-behavior: smooth; - overscroll-behavior: contain; - will-change: scroll-position; - contain: strict; - } - - .artist-list-group-header { - font-size: 11px; - font-weight: 600; - color: var(--text-muted); - padding: 12px 8px 4px; - text-transform: uppercase; - letter-spacing: 0.5px; - } - - .artist-list-item { - display: flex; - align-items: center; - gap: 12px; - width: 100%; - padding: 8px; - border: none; - background: transparent; - border-radius: 8px; - cursor: pointer; - transition: background-color 150ms ease; - text-align: left; - } - - .artist-list-item:hover { - background: var(--bg-hover); - } - - .artist-list-item.selected { - background: var(--bg-tertiary); - } - - .artist-list-image { - width: 48px; - height: 48px; - border-radius: 50%; - overflow: hidden; - flex-shrink: 0; - background: var(--bg-tertiary); - } - - .artist-list-image img { - width: 100%; - height: 100%; - object-fit: cover; - } - - .artist-list-placeholder { - width: 100%; - height: 100%; - display: flex; - align-items: center; - justify-content: center; - color: var(--text-muted); - } - - .artist-list-info { - flex: 1; - min-width: 0; - } - - .artist-list-name { - font-size: 14px; - font-weight: 500; - color: var(--text-primary); - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - } - - .artist-list-name.scrollable { - text-overflow: clip; - } - - .artist-list-name .artist-name-text { - display: inline-block; - } - - .artist-list-name .artist-name-text.animating { - animation: artist-name-ticker var(--ticker-duration, 0s) linear infinite; - } - - @keyframes artist-name-ticker { - 0%, 20% { transform: translateX(0); } - 70%, 80% { transform: translateX(var(--ticker-offset, 0)); } - 90%, 100% { transform: translateX(0); } - } - - .artist-list-meta { - font-size: 12px; - color: var(--text-muted); - margin-top: 2px; - } - .artist-albums-column { flex: 1; display: flex;