+
-
-
diff --git a/web/src/lib/components/HorizontalScrollRow.test.ts b/web/src/lib/components/HorizontalScrollRow.test.ts
index 55ee2e9d..9f640c15 100644
--- a/web/src/lib/components/HorizontalScrollRow.test.ts
+++ b/web/src/lib/components/HorizontalScrollRow.test.ts
@@ -29,4 +29,14 @@ describe('HorizontalScrollRow', () => {
expect(spy).toHaveBeenCalledWith({ left: expect.any(Number), behavior: 'smooth' });
expect(spy.mock.calls[0][0].left).toBeGreaterThan(0);
});
+
+ test('renders title as a heading when prop is provided', () => {
+ render(HorizontalScrollRow, { props: { items: ['a'], title: 'My section' } });
+ expect(screen.getByRole('heading', { name: 'My section' })).toBeInTheDocument();
+ });
+
+ test('omits heading when title prop is absent', () => {
+ render(HorizontalScrollRow, { props: { items: ['a'] } });
+ expect(screen.queryByRole('heading')).not.toBeInTheDocument();
+ });
});
diff --git a/web/src/routes/+page.svelte b/web/src/routes/+page.svelte
index de76c01f..6334abb3 100644
--- a/web/src/routes/+page.svelte
+++ b/web/src/routes/+page.svelte
@@ -30,14 +30,18 @@
{:else if data}
-
{#if data.recently_added_albums.length === 0}
+
Nothing added yet. Scan a folder via the server's config.
{:else}
{#each chunk(data.recently_added_albums, 25) as row, i (i)}
-
+
{#snippet item(album: import('$lib/api/types').AlbumRef)}
{/snippet}
@@ -48,21 +52,29 @@
-
{#if data.rediscover_albums.length === 0 && data.rediscover_artists.length === 0}
+
No forgotten favourites yet. Like some albums or artists to fill this in.
{:else}
{#if data.rediscover_albums.length > 0}
-
+
{#snippet item(album: import('$lib/api/types').AlbumRef)}
{/snippet}
{/if}
{#if data.rediscover_artists.length > 0}
-
+
{#snippet item(artist: import('$lib/api/types').ArtistRef)}
{/snippet}
@@ -73,14 +85,18 @@
-
{#if data.most_played_tracks.length === 0}
+
No plays to draw from. Listen to something.
{:else}
{#each chunk(data.most_played_tracks, 25) as row, i (i)}
-
+
{#snippet item(track: import('$lib/api/types').TrackRef, idx: number)}
-
{#if data.last_played_artists.length === 0}
+
No recent plays.
{:else}
-
+
{#snippet item(artist: import('$lib/api/types').ArtistRef)}
{/snippet}