refactor: one cover fallback icon on Android, one paged-query type on the web
release / web (push) Successful in 1m19s
release / go (push) Successful in 1m45s
release / govulncheck (push) Successful in 19s
release / integration (push) Successful in 3m56s
release / android (push) Successful in 4m34s
release / Build signed APK (push) Successful in 5m3s
release / Attach APK to the Release (tag releases only) (push) Skipped
release / Build + push container image (push) Successful in 25s
release / Verify release artifacts (tag releases only) (push) Skipped
release / web (push) Successful in 1m19s
release / go (push) Successful in 1m45s
release / govulncheck (push) Successful in 19s
release / integration (push) Successful in 3m56s
release / android (push) Successful in 4m34s
release / Build signed APK (push) Successful in 5m3s
release / Attach APK to the Release (tag releases only) (push) Skipped
release / Build + push container image (push) Successful in 25s
release / Verify release artifacts (tag releases only) (push) Skipped
Ten Android covers wrote out the same muted icon for missing artwork; they now call CoverFallbackIcon beside CoverTile, and ShelfPlaylistCards' NoArtIcon wrapper is gone. AlbumDrillDown and AlphaLibrary each declared the infinite-query shape they read; both now take PagedQuery<T> from api/types. Folds the two small copies the M664 DRY close-out found (#8006). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -9,6 +9,24 @@ export type Page<T> = {
|
||||
offset: number;
|
||||
};
|
||||
|
||||
/**
|
||||
* What a paged list's component reads from a TanStack infinite query of
|
||||
* Pages: the loaded pages, the first page's state, the next page's state,
|
||||
* and the two ways to ask again. Typed structurally so a page can pass its
|
||||
* createInfiniteQuery result straight in.
|
||||
*/
|
||||
export type PagedQuery<T> = {
|
||||
data?: { pages: Page<T>[] };
|
||||
isPending: boolean;
|
||||
isError: boolean;
|
||||
error: unknown;
|
||||
hasNextPage: boolean;
|
||||
isFetchingNextPage: boolean;
|
||||
isFetchNextPageError: boolean;
|
||||
fetchNextPage: () => unknown;
|
||||
refetch: () => unknown;
|
||||
};
|
||||
|
||||
export type ArtistRef = {
|
||||
id: string;
|
||||
name: string;
|
||||
|
||||
@@ -4,21 +4,11 @@
|
||||
import AlbumCard from './AlbumCard.svelte';
|
||||
import EmptyState from './EmptyState.svelte';
|
||||
import ListContinuation from './ListContinuation.svelte';
|
||||
import type { AlbumRef, Page } from '#lib/api/types.js';
|
||||
import type { AlbumRef, PagedQuery } from '#lib/api/types.js';
|
||||
|
||||
// One browse axis's albums (a genre, a year): a back link to the axis, the
|
||||
// count, and the paged grid. A failed first page offers Try again; a failed
|
||||
// later page keeps the grid and offers it at the end.
|
||||
type AlbumPages = {
|
||||
data?: { pages: Page<AlbumRef>[] };
|
||||
isPending: boolean;
|
||||
isError: boolean;
|
||||
hasNextPage: boolean;
|
||||
isFetchingNextPage: boolean;
|
||||
isFetchNextPageError: boolean;
|
||||
fetchNextPage: () => unknown;
|
||||
refetch: () => unknown;
|
||||
};
|
||||
|
||||
let {
|
||||
query,
|
||||
@@ -30,7 +20,7 @@
|
||||
emptyHint,
|
||||
endLabel
|
||||
}: {
|
||||
query: AlbumPages | null;
|
||||
query: PagedQuery<AlbumRef> | null;
|
||||
backHref: string;
|
||||
backLabel: string;
|
||||
title: string;
|
||||
|
||||
@@ -8,23 +8,12 @@
|
||||
import EmptyState from './EmptyState.svelte';
|
||||
import { user } from '#lib/auth/user.svelte.js';
|
||||
import { useDelayed } from '#lib/utils/useDelayed.svelte.js';
|
||||
import type { Page } from '#lib/api/types.js';
|
||||
import type { PagedQuery } from '#lib/api/types.js';
|
||||
|
||||
// A whole-library A–Z page (Library › Albums, Library › Artists): the
|
||||
// count, a filter over what has loaded, the lettered grid paged as you
|
||||
// scroll, and the empty states. A filter that matches nothing loaded links
|
||||
// to the full search, since the rest of the library may not have loaded.
|
||||
type Pages = {
|
||||
data?: { pages: Page<T>[] };
|
||||
isPending: boolean;
|
||||
isError: boolean;
|
||||
error: unknown;
|
||||
hasNextPage: boolean;
|
||||
isFetchingNextPage: boolean;
|
||||
isFetchNextPageError: boolean;
|
||||
fetchNextPage: () => unknown;
|
||||
refetch: () => unknown;
|
||||
};
|
||||
|
||||
let {
|
||||
query,
|
||||
@@ -36,7 +25,7 @@
|
||||
searchPath,
|
||||
item
|
||||
}: {
|
||||
query: Pages;
|
||||
query: PagedQuery<T>;
|
||||
title: string;
|
||||
/** The noun for one and for many: 'album', 'albums'. */
|
||||
one: string;
|
||||
|
||||
Reference in New Issue
Block a user