feat(web): every paged list loads as you scroll; Liked becomes tabs (#5416)
release / go (push) Successful in 1m53s
release / govulncheck (push) Successful in 49s
release / web (push) Successful in 1m50s
release / android (push) Successful in 6m44s
release / Build signed APK (releases and dev) (push) Successful in 6m30s
release / Attach APK to the Release (tag releases only) (push) Canceled after 0s
release / Build + push container image (push) Canceled after 0s
release / Verify release artifacts (tag releases only) (push) Canceled after 0s
release / integration (push) Canceled after 21m41s

Preference 172: no "Load more" buttons. Eight remained, on Liked (three
sections), the three Search overflow pages, Genres and Years.

- ListContinuation: the one bottom-of-list block. It loads the next page
  ahead of the reader, announces "Loading more…" through aria-live, shows an
  optional end line, and on a failed page shows the error with Try again,
  dropping the sentinel so a dead endpoint isn't re-hit on every scroll.
  Used on all ten paged lists, including the four that already autoloaded.
- A failed next page no longer replaces the list. TanStack sets isError for
  it, so the page-level error branches now apply only to a failed first
  load. Genres and Years did the same with their own loader; a later
  page's failure now keeps the grid.
- Liked: Artists | Albums | Tracks tabs (operator's choice). Stacked, a
  long Artists list loading as you scroll would bury the other two. It
  opens on the first tab that has likes.
- TabStrip: the in-page tab strip, now shared by Liked, Playback errors
  and Requests.
- test-utils/intersectionObserver: a stand-in so tests can scroll to the end.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-08 16:55:33 -04:00
co-authored by Claude Opus 5.5
parent 2205b2927b
commit 0f9ddbca97
24 changed files with 593 additions and 344 deletions
+9 -12
View File
@@ -7,6 +7,7 @@
import TrackList from '#lib/components/TrackList.svelte';
import LibrarySkeleton from '#lib/components/LibrarySkeleton.svelte';
import ApiErrorBanner from '#lib/components/ApiErrorBanner.svelte';
import ListContinuation from '#lib/components/ListContinuation.svelte';
import { useDelayed } from '#lib/utils/useDelayed.svelte.js';
import { playRadio } from '#lib/player/store.svelte.js';
import type { TrackRef } from '#lib/api/types.js';
@@ -32,14 +33,14 @@
← Back to search
</a>
<h1 class="mt-2 font-display text-2xl font-medium text-text-primary">Tracks matching '{q}'</h1>
{#if !query?.isPending && !query?.isError && q}
{#if q && !query?.isPending && !(query?.isError && tracks.length === 0)}
<p class="text-sm text-text-secondary">{total} {total === 1 ? 'track' : 'tracks'}</p>
{/if}
</header>
{#if !q}
<p class="text-text-secondary">No query — return to search to start typing.</p>
{:else if query?.isError}
{:else if query?.isError && tracks.length === 0}
<ApiErrorBanner error={query.error} onRetry={query.refetch} />
{:else if showSkeleton.value && tracks.length === 0}
<LibrarySkeleton variant="list" count={12} />
@@ -51,15 +52,11 @@
<TrackRow tracks={tracks} index={i} onPlay={onTrackPlay} />
{/each}
</TrackList>
{#if query?.hasNextPage}
<button
type="button"
class="w-full rounded bg-surface py-2 text-sm hover:bg-surface-hover disabled:opacity-60"
disabled={query.isFetchingNextPage}
onclick={() => query.fetchNextPage()}
>
{query.isFetchingNextPage ? 'Loading…' : 'Load more'}
</button>
{/if}
<ListContinuation
hasMore={!!query?.hasNextPage}
loading={!!query?.isFetchingNextPage}
failed={!!query?.isFetchNextPageError}
onMore={() => query?.fetchNextPage()}
/>
{/if}
</PageColumn>