feat(web): home shelves you can tell apart at a glance
release / go (push) Successful in 1m46s
release / web (push) Failing after 1m8s
release / govulncheck (push) Successful in 23s
release / integration (push) Successful in 4m12s
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 / Build signed APK (push) Canceled after 1m38s
release / android (push) Canceled after 3m3s

Each home shelf now has its own shape. Main mixes and playlists are wide
cards: the lead album's cover on a wash of its own colour, with the name
and what the mix is built from beside it rather than over the art. Songs
like mixes are circles, the shape artists already have. Genre mixes are
short bands with a fan of three covers. Shelf sizes step down from the
main mixes.

Tiles show album covers in place of the four-cover collage, and no cover
repeats along a shelf while a tile still has an unused one. The size and
refresh time every mix on a shelf shares is said once, beside the shelf's
title. Library pages keep the square card.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-23 16:09:02 -05:00
co-authored by Claude Opus 5.5
parent ec017838a2
commit 5e7b8a7694
9 changed files with 512 additions and 51 deletions
+48 -12
View File
@@ -12,6 +12,7 @@
import { createPlaylistsQuery } from '#lib/api/playlists.js';
import { createSystemPlaylistsStatusQuery } from '#lib/api/me.js';
import type { Playlist } from '#lib/api/types.js';
import { assignShelfCovers, shelfMeta } from '#lib/playlists/shelf.js';
const queryStore = createHomeQuery();
const query = $derived($queryStore);
@@ -132,6 +133,21 @@
return out;
});
// Each shelf gives its tiles covers no earlier tile on it shows, and says
// once, in its heading, what every mix on it shares.
const realPlaylists = $derived(
playlistsRow.flatMap((it) => (it.kind === 'real' ? [it.playlist] : []))
);
const playlistsCovers = $derived(new Map(
assignShelfCovers(realPlaylists, 1).map((c, i) => [realPlaylists[i].id, c])
));
const songsLikeCovers = $derived(new Map(
assignShelfCovers(songsLikePlaylists, 1).map((c, i) => [songsLikePlaylists[i].id, c])
));
const genreCovers = $derived(new Map(
assignShelfCovers(genreMixPlaylists, 3).map((c, i) => [genreMixPlaylists[i].id, c])
));
// Dedicated Songs-like row: every generated "Songs like {artist}"
// mix — the best-performing surface, promoted out of the Playlists
// carousel to show a wider spread. Shows a few placeholders while the
@@ -155,22 +171,27 @@
<svelte:head><title>{pageTitle('Home')}</title></svelte:head>
<div class="space-y-8">
<!-- Playlists: For-You + Songs-like + user playlists, single horizontal row -->
<!-- Playlists: For You, Discover, the other daily mixes, then your own playlists -->
<section class="space-y-3">
<HorizontalScrollRow
rows={[playlistsRow]}
title="Playlists"
meta={shelfMeta(realPlaylists)}
ariaLabel="Playlists"
>
{#snippet item(rowItem: PlaylistRowItem)}
<!-- Playlists at the page anchor: largest of the carousels.
Sized so a typical viewport shows ~5-6 across instead
of cramming 8-9. -->
<div class="w-56">
<!-- The page's front door: the biggest tiles on it, wide cards that
say what each mix is built from. Every shelf below steps down. -->
<div class="h-44 w-[26rem] max-w-[85vw]">
{#if rowItem.kind === 'real'}
<PlaylistCard playlist={rowItem.playlist} />
<PlaylistCard
playlist={rowItem.playlist}
shape="wide"
covers={playlistsCovers.get(rowItem.playlist.id) ?? []}
showMeta={false}
/>
{:else}
<PlaylistPlaceholderCard label={rowItem.label} variant={rowItem.variant} />
<PlaylistPlaceholderCard label={rowItem.label} variant={rowItem.variant} shape="wide" />
{/if}
</div>
{/snippet}
@@ -184,14 +205,22 @@
<HorizontalScrollRow
rows={[songsLikeRow]}
title="Songs like…"
meta={shelfMeta(songsLikePlaylists)}
ariaLabel="Songs like"
>
{#snippet item(rowItem: PlaylistRowItem)}
<div class="w-56">
<!-- Circles: the shape artists have everywhere else, so a Songs like
mix reads as "about this artist" before its name is read. -->
<div class="w-40">
{#if rowItem.kind === 'real'}
<PlaylistCard playlist={rowItem.playlist} />
<PlaylistCard
playlist={rowItem.playlist}
shape="round"
covers={songsLikeCovers.get(rowItem.playlist.id) ?? []}
showMeta={false}
/>
{:else}
<PlaylistPlaceholderCard label={rowItem.label} variant={rowItem.variant} />
<PlaylistPlaceholderCard label={rowItem.label} variant={rowItem.variant} shape="round" />
{/if}
</div>
{/snippet}
@@ -206,11 +235,18 @@
<HorizontalScrollRow
rows={[genreMixPlaylists]}
title="Your genres"
meta={shelfMeta(genreMixPlaylists)}
ariaLabel="Your genres"
>
{#snippet item(playlist: Playlist)}
<div class="w-56">
<PlaylistCard {playlist} />
<!-- Short, wide bands: a colour field and a fan of three covers. -->
<div class="h-28 w-64">
<PlaylistCard
{playlist}
shape="band"
covers={genreCovers.get(playlist.id) ?? []}
showMeta={false}
/>
</div>
{/snippet}
</HorizontalScrollRow>
+14 -11
View File
@@ -142,14 +142,15 @@ describe('home Playlists section', () => {
);
const { container } = render(Page);
for (let i = 0; i < 6; i++) {
expect(screen.getByText(`Songs like ${i}`)).toBeInTheDocument();
}
// The mixes live in the Songs-like row, not the Playlists carousel.
const playlistsSection = container.querySelector('[aria-label="Playlists"]') as HTMLElement;
expect(within(playlistsSection).queryByText('Songs like 0')).toBeNull();
// The mixes live in the Songs-like row, not the Playlists carousel. Each
// circle is labelled by its artist; its play button names the whole mix.
const songsSection = container.querySelector('[aria-label="Songs like"]') as HTMLElement;
expect(within(songsSection).getByText('Songs like 0')).toBeInTheDocument();
for (let i = 0; i < 6; i++) {
expect(within(songsSection).getByRole('button', { name: `Play Songs like ${i}` })).toBeInTheDocument();
}
expect(songsSection.querySelectorAll('[data-shape="round"]')).toHaveLength(6);
const playlistsSection = container.querySelector('[aria-label="Playlists"]') as HTMLElement;
expect(within(playlistsSection).queryByRole('button', { name: 'Play Songs like 0' })).toBeNull();
// No placeholders once real mixes exist.
expect(within(songsSection).queryByTestId('playlist-placeholder-card')).toBeNull();
});
@@ -187,12 +188,14 @@ describe('home Playlists section', () => {
const genres = container.querySelector('[aria-label="Your genres"]') as HTMLElement;
expect(genres).not.toBeNull();
// Each band shows the genre; its play button names the whole mix.
const names = within(genres)
.getAllByText(/ mix$/)
.map((el) => el.textContent?.trim());
expect(names).toEqual(['Dub mix', 'Jazz mix', 'Shoegaze mix']);
.getAllByRole('button', { name: /^Play / })
.map((el) => el.getAttribute('aria-label'));
expect(names).toEqual(['Play Dub mix', 'Play Jazz mix', 'Play Shoegaze mix']);
expect(genres.querySelectorAll('[data-shape="band"]')).toHaveLength(3);
const playlistsSection = container.querySelector('[aria-label="Playlists"]') as HTMLElement;
expect(within(playlistsSection).queryByText('Jazz mix')).toBeNull();
expect(within(playlistsSection).queryByRole('button', { name: 'Play Jazz mix' })).toBeNull();
});
test('Your genres row is absent until a genre mix exists', () => {