fix(player): put the phone's Now Playing button above the artwork
`.expand` is the phone's only route into the full-screen now-playing view. It is absolutely positioned with `z-index: auto` over `.cover-art`, which is a *later* sibling with the same z-index, so the two tie on paint order and the later one wins. An `<img>` costs nothing there; a track with no artwork renders a placeholder `wa-icon`, which takes every click aimed at the button underneath it. So the control did not work whenever the current song had no cover, on the one platform that has no other way in. Nothing to do with the fixture: any library has untagged files. Measured at 390px with elementFromPoint at the button's centre — the icon with a placeholder, the button with an image, and the button either way with the z-index. Chosen over `pointer-events: none` on the art, which would take the cover preview's mouseenter with it, and over reordering the DOM, which leaves the same tie to be won by the same accident in the other direction. This was filed as an e2e flake, and the diagnosis was wrong: it failed on both engines three times across two branches that could not have caused it, and passed on re-run each time, because the spec starts the *first* row of the track list and which track that is depends on the order the scan inserted rows — the same root cause as #156. The new spec picks a track *for* having no artwork, and asserts the placeholder is rendered rather than assuming it, so it cannot quietly go back to measuring the easy case. Two things it has to get right, both already documented traps: the track must be the 90-second one, since a 2-second one finishes before the assertions run; and `library.Track.CoverArt` is empty for all 31 fixture rows, so "the first track with no cover art" selects nothing in particular and picked a short one. Verified by mutation: without the z-index the new spec fails on the click in 30s, and the pre-existing one beside it passes, which is exactly how this survived. Closes #150
This commit is contained in:
@@ -3961,3 +3961,51 @@ The general rule for this repo's fixture library: it is deliberately
|
||||
full of edge cases (untagged, unicode, duplicates, extremes), so a spec
|
||||
that wants an *ordinary* track has to **say so** — filter on the
|
||||
property it depends on rather than slicing.
|
||||
|
||||
## The phone's way into Now Playing was under the artwork (measured 2026-08-20)
|
||||
|
||||
`phone-shell.spec.ts`'s "opens the full-screen now playing" failed in CI
|
||||
on both engines, three times across two branches that could not have
|
||||
caused it, and passed on re-run each time. It was filed as a flake
|
||||
(#150). It is not one: **it depends on which track is playing.**
|
||||
|
||||
`.expand` — the phone's only route into `<now-playing-view>` — is
|
||||
`position: absolute; inset: 0` inside `.cover-art-wrapper`, and
|
||||
`.cover-art` is a **later sibling**. Both have `z-index: auto`, so they
|
||||
tie on paint order and the later one wins. With an `<img>` that costs
|
||||
nothing; with no artwork the placeholder `wa-icon` renders and takes
|
||||
every click aimed at the button underneath it.
|
||||
|
||||
Measured at 390px with `elementFromPoint` at the button's centre:
|
||||
|
||||
| playing track | hit test |
|
||||
|---|---|
|
||||
| has artwork | `button.expand` |
|
||||
| no artwork | **`wa-icon`** |
|
||||
| no artwork, with `z-index: 1` | `button.expand` |
|
||||
|
||||
So on a phone, the only way into the full-screen player stopped working
|
||||
whenever the current song had no cover — and this has nothing to do with
|
||||
the fixture: any library has untagged files.
|
||||
|
||||
Three things worth keeping.
|
||||
|
||||
**"Flaky in CI" was the wrong diagnosis and it cost three cycles.** The
|
||||
spec starts the *first* row of the track list, so which track it plays
|
||||
is the order the scan inserted rows in — the same root cause as #156,
|
||||
one spec over. A test whose subject is a hit test has to *choose* the
|
||||
case that breaks it.
|
||||
|
||||
**The first two hypotheses were both wrong, and both were plausible.**
|
||||
A custom element's upgrade replacing its own contents, and the cover
|
||||
preview's `mouseenter` opening a popup under the pointer. Neither
|
||||
survived contact with `elementFromPoint`, which took a minute and would
|
||||
have saved the other two cycles.
|
||||
|
||||
**And the spec that pins it needs the 90-second track**, because a
|
||||
2-second one finishes before the assertions run — the trap
|
||||
`fixtures.ts` already documents. Note the filter that does *not* work:
|
||||
`library.Track.CoverArt` is empty for all 31 fixture rows, so "the
|
||||
first track with no cover art" selects nothing in particular. The
|
||||
placeholder's presence is asserted instead, which is the property the
|
||||
test actually depends on.
|
||||
|
||||
Reference in New Issue
Block a user