From 0a676950d9fea4c049ab4601d33f9964da458cec Mon Sep 17 00:00:00 2001 From: Simon Hull <5488089+simonhull@users.noreply.github.com> Date: Mon, 23 Nov 2026 16:48:11 -0600 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20The=20Library's=20veil=20spans?= =?UTF-8?q?=20the=20page,=20so=20a=20cover's=20shadow=20never=20draws=20a?= =?UTF-8?q?=20pale=20box=20round=20the=20columns?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/e2e/libraryVeil.e2e.ts | 42 ++++++++++++++++++++++++++++ web/src/lib/pages/LibraryRail.svelte | 2 +- web/src/routes/library/+page.svelte | 13 +++++---- 3 files changed, 51 insertions(+), 6 deletions(-) create mode 100644 web/e2e/libraryVeil.e2e.ts diff --git a/web/e2e/libraryVeil.e2e.ts b/web/e2e/libraryVeil.e2e.ts new file mode 100644 index 00000000..0aa73804 --- /dev/null +++ b/web/e2e/libraryVeil.e2e.ts @@ -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); +}); diff --git a/web/src/lib/pages/LibraryRail.svelte b/web/src/lib/pages/LibraryRail.svelte index ccc3298b..130a900c 100644 --- a/web/src/lib/pages/LibraryRail.svelte +++ b/web/src/lib/pages/LibraryRail.svelte @@ -368,7 +368,7 @@ --pill-inset: 1.5px; position: fixed; - z-index: 1; + z-index: 3; top: 104px; right: 24px; width: 32px; diff --git a/web/src/routes/library/+page.svelte b/web/src/routes/library/+page.svelte index 9de01049..5938c922 100644 --- a/web/src/routes/library/+page.svelte +++ b/web/src/routes/library/+page.svelte @@ -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); @@ -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); }