feat(home): land on Home, and make it worth landing on
The app opened on Tracks — an alphabetical list of everything, which is the one entry point that is identical every time and therefore gives the user nothing to start from. Home is listed first in the nav and is the page built to answer 'what should I play' (H-8). Two things had to be true before that was an improvement. An album with no cover rendered as a small dim icon on a surface the same colour as the page, so a shelf read as having holes in it, while the Albums and Artists grids both drew a letter tile (H-9). It draws the same tile now. And a shelf that repeats the one above it is suppressed, the way an empty one already is — 'On repeat' was 'Pick up where you left off' reordered. The rule fires only when the shelf is not showing the whole library: a repeat is a fault only if a different row was possible, and measured against a fixed shelf size instead this let an 11-album library keep three identical shelves while a 13-album one lost them. The first two versions of that rule were wrong and the *existing* Go tests caught both — it collapsed a four-album library to a single shelf. Nine e2e specs assumed the app starts on Tracks and now navigate there, and one new spec freezes the landing itself. Home's page-header action is 'Shuffle suggestions': 'Shuffle' alone was two different controls with one accessible name, which only became reachable together once a cached Home was always in the tree.
This commit is contained in:
@@ -17,6 +17,7 @@ test.describe('library views', () => {
|
||||
// library exists, so its presence proves nothing. Playwright's own
|
||||
// actionability check fails a covered click with "intercepts pointer
|
||||
// events", which is exactly the condition worth catching.
|
||||
await app.getByTestId('nav-tracks').click({ timeout: 5_000 });
|
||||
await expect(app.getByTestId('track-row').first()).toBeVisible();
|
||||
await app.getByTestId('nav-artists').click({ timeout: 5_000 });
|
||||
|
||||
@@ -30,6 +31,8 @@ test.describe('library views', () => {
|
||||
app,
|
||||
testctl,
|
||||
}) => {
|
||||
await app.getByTestId('nav-tracks').click();
|
||||
|
||||
const health = await testctl.health();
|
||||
const rows = app.getByTestId('track-row');
|
||||
|
||||
@@ -42,6 +45,27 @@ test.describe('library views', () => {
|
||||
await expect(app.getByText('مرحبا بالعالم')).toBeVisible();
|
||||
});
|
||||
|
||||
test('opens on Home, which is the page built to answer what to play', async ({
|
||||
app,
|
||||
}) => {
|
||||
// H-8: the app opened on Tracks — an alphabetical list of
|
||||
// everything, the one entry point that is identical every time and
|
||||
// therefore gives the user nothing to start from. Home is listed
|
||||
// first in the nav and was never what anybody saw.
|
||||
await expect(app.getByTestId('main-content')).toHaveAttribute(
|
||||
'data-active-view',
|
||||
'home',
|
||||
);
|
||||
|
||||
// …and the sidebar agrees. It does not hear a `navigate` it did not
|
||||
// send, so this is a separate claim from the one above and was
|
||||
// briefly false.
|
||||
await expect(app.getByTestId('nav-home')).toHaveAttribute(
|
||||
'aria-current',
|
||||
'page',
|
||||
);
|
||||
});
|
||||
|
||||
test('the sidebar navigates between primary views', async ({ app }) => {
|
||||
const main = app.getByTestId('main-content');
|
||||
|
||||
@@ -62,8 +86,14 @@ test.describe('library views', () => {
|
||||
'artists',
|
||||
);
|
||||
|
||||
await expect(app.getByText('Aurora Fields').first()).toBeVisible();
|
||||
await expect(app.getByText('Pale Circuit').first()).toBeVisible();
|
||||
// Scoped to the view: every primary view stays in the DOM, and
|
||||
// Home's shelves name the same artists — so an unscoped `.first()`
|
||||
// matches a card on a page that is `.view-hidden`, and asserting it
|
||||
// is visible fails for a reason that has nothing to do with Artists.
|
||||
const artists = app.locator('artists-view');
|
||||
|
||||
await expect(artists.getByText('Aurora Fields').first()).toBeVisible();
|
||||
await expect(artists.getByText('Pale Circuit').first()).toBeVisible();
|
||||
});
|
||||
|
||||
test('a library can be renamed from its own name', async ({ app }) => {
|
||||
|
||||
@@ -23,6 +23,9 @@ const longRow = (app: import('@playwright/test').Page) =>
|
||||
*/
|
||||
test.describe('playback', () => {
|
||||
test.beforeEach(async ({ app }) => {
|
||||
// The app lands on Home now (H-8), so the track list is a
|
||||
// navigation away rather than the first thing on screen.
|
||||
await app.getByTestId('nav-tracks').click();
|
||||
await callBinding(app, 'queue.Queue.Clear').catch(() => {
|
||||
/* older builds may not expose Clear; the specs below do not need it */
|
||||
});
|
||||
@@ -84,6 +87,11 @@ test.describe('playback', () => {
|
||||
});
|
||||
|
||||
test.describe('queue', () => {
|
||||
test.beforeEach(async ({ app }) => {
|
||||
// The app lands on Home now (H-8).
|
||||
await app.getByTestId('nav-tracks').click();
|
||||
});
|
||||
|
||||
test('playing a track populates the queue panel', async ({ app }) => {
|
||||
await resetEvents(app);
|
||||
await longRow(app).dblclick();
|
||||
|
||||
@@ -95,6 +95,8 @@ async function blurDeepActive(app: Page): Promise<void> {
|
||||
|
||||
test.describe('the player reports its real position', () => {
|
||||
test.beforeEach(async ({ app }) => {
|
||||
// The app lands on Home now (H-8); these specs start from a row.
|
||||
await app.getByTestId('nav-tracks').click();
|
||||
await callBinding(app, 'queue.Queue.Clear');
|
||||
await resetEvents(app);
|
||||
});
|
||||
|
||||
@@ -123,6 +123,11 @@ test.describe('keyboard reach', () => {
|
||||
test('tabs out of the header straight into the sidebar', async ({
|
||||
app,
|
||||
}) => {
|
||||
// On Tracks, because the header search box is disabled on Home —
|
||||
// it keeps its slot everywhere and says why, but a disabled input
|
||||
// cannot hold focus, and this spec is about what follows it.
|
||||
await app.getByTestId('nav-tracks').click();
|
||||
|
||||
// Started from the search box rather than from the top of the page:
|
||||
// the header's leading controls come and go (the index-status button
|
||||
// is only there while the index builds), so counting stops from the
|
||||
|
||||
Reference in New Issue
Block a user