Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions web/e2e/libraryVeil.e2e.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import { expect, fixtures, landed, test } from './fixture';

/**
* The band over the Library's list, from the window's top to the columns' line, is one veil edge to
* edge: a cover or an artist's name scrolled under it is hidden across the whole width, never only
* over the songs, where a cover's shadow drew a pale box round the narrower one.
*/
test('the veil over the list spans the page, and the rail and filters stay over it', async ({
page
}) => {
await page.setViewportSize({ width: 1800, height: 900 });
await page.goto(fixtures('/library'));
await landed(page);
await page.mouse.move(1200, 500);
await page.mouse.wheel(0, 1500);
await expect
.poll(() => page.evaluate(() => document.scrollingElement?.scrollTop ?? 0))
.toBeGreaterThan(1000);

const hits = await page.evaluate(() => {
const head = document.querySelector('.columns-head');
const line = head === null ? 0 : head.getBoundingClientRect().bottom;
const covers = document.querySelector('.albums')?.getBoundingClientRect().left ?? 0;
// Below the nav, above the line: left of the covers, over a cover, and the window's edge.
const y = line - 12;
const at = (x: number): string => {
const top = document.elementFromPoint(x, y);
return top?.closest('.columns-head, .top, .rail') === null ? 'through' : 'veiled';
};
return [at(covers - 20), at(covers + 40), at(4)];
});
expect(hits).toEqual(['veiled', 'veiled', 'veiled']);

await expect(page.locator('.top').getByRole('button', { name: 'Everything' })).toBeVisible();
const rail = page.locator('.rail');
const railTop = await rail.evaluate((el) => {
const r = el.getBoundingClientRect();
const top = document.elementFromPoint(r.left + r.width / 2, r.top + 6);
return el.contains(top);
});
expect(railTop).toBe(true);
});
2 changes: 1 addition & 1 deletion web/src/lib/pages/LibraryRail.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@
--pill-inset: 1.5px;

position: fixed;
z-index: 1;
z-index: 3;
top: 104px;
right: 24px;
width: 32px;
Expand Down
13 changes: 8 additions & 5 deletions web/src/routes/library/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,7 @@
/* Solid, because the name it stands under leaves upward, past it. */
.top {
position: fixed;
z-index: 2;
z-index: 3;
top: var(--head-top);
left: var(--page-edge);
width: var(--name-column);
Expand Down Expand Up @@ -908,13 +908,16 @@
background: var(--ground);
}

/* The veil: the whole band above the list line, edge to edge, so a cover's shadow or an artist's
name passing under it is cut by one straight line and never shows round a narrower box. */
.columns-head::before {
content: '';
position: absolute;
left: 0;
right: 0;
bottom: 100%;
height: var(--head-top);
z-index: -1;
top: calc(-1 * var(--head-top));
bottom: 0;
left: calc(-1 * var(--songs-left));
right: calc(-1 * var(--songs-right));
background: var(--ground);
}

Expand Down