test: act on review — the skeleton guard was reading the wrong layer

The "separates the skeleton from the panel" cases could not fail.  A Skeleton
is three layers: the element paints nothing, ::before paints
--mantine-color-body (`--bg`) at z-index 10, and ::after paints the bar the
user actually sees (`--head` in light, `--border` in dark) at z-index 11, on
top.  `paintedBackground` walked outward from the element and returned the
first paint, which is ::before -- so all four cases compared the page
background to the panel.  Those differ by design in every theme, so the bars
could have collapsed into the panel entirely and every assertion stayed green.

My planted regression did not catch it because the plant was broader than the
claim: it forced all three layers to the panel colour, so the test went red
for a reason the fix did not depend on.  The plant now sets only ::after, and
a second plant sets only ::before and must stay GREEN.

The layer order is now the caller's argument, since "the background" is
ambiguous once pseudo-elements are involved and guessing makes a test vacuous
rather than wrong.

Also from review:

The disc on a filled button was pinned to `--blue` at the call site, but WROL
mode disables that button and Mantine repaints it `--mantine-color-disabled`
-- a blue chip on a grey button, the original hole inverted.  The surface now
comes from the cascade (`--button-bg`, and the disabled colour for any
variant), so the call site says nothing at all and cannot be wrong about a
state it does not control.  Keying on `[data-variant="filled"]` alone matched
none of our buttons: Mantine omits the attribute when a call site names a
colour but no variant, which is how every filled button here is written.

The Checkbox behaviour test asserted only that a handler fired, against a box
held at `checked={false}` that could never change.  It is now uncontrolled and
asserts the box is checked, plus a second test that the handler sees the new
state -- read inside the handler, because `currentTarget` is null by the time
a mock is inspected.

The empty-caption test counted every div in the container; it counts the
loader's siblings now.  Two comments corrected: Pill emits no `--pill-radius`
at all and its own stylesheet falls back to `1000rem`, and the nav bar no
longer relies on the default surface.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Roland 2026-08-01 16:05:29 -06:00
parent 048ed6c8e2
commit ab58019550
No known key found for this signature in database
GPG key ID: 1BA620CE6C9A4680
4 changed files with 113 additions and 30 deletions

View file

@ -51,6 +51,30 @@
padding: 1px;
}
/*
* A stack inside a button is the one case the call site should not have to describe,
* because the surface changes underneath it: Mantine paints a filled button from
* `--button-bg` but a disabled one from `--mantine-color-disabled`, whatever its variant.
* The file browser's New Folder button is disabled in WROL mode, so a disc pinned to the
* enabled fill would be a blue chip on a grey button -- the original hole, inverted.
*
* Only `filled` gets the first rule: an outline or subtle button sets `--button-bg` to
* `transparent`, and there the surface behind the button is still the right answer.
* `:not([data-variant])` is that same case -- Mantine omits the attribute entirely when a
* call site names a colour but no variant, which is how every filled button here is
* written, and keying on the attribute alone matched none of them. `--button-bg` itself
* is absent when a button names neither, hence the fallback chain.
*/
.mantine-Button-root:not([data-variant]) .wrolpi-icon-stack-corner,
.mantine-Button-root[data-variant="filled"] .wrolpi-icon-stack-corner {
background: var(--button-bg, var(--icon-stack-bg, var(--bg)));
}
.mantine-Button-root:disabled .wrolpi-icon-stack-corner,
.mantine-Button-root[data-disabled] .wrolpi-icon-stack-corner {
background: var(--mantine-color-disabled);
}
/* ---------------------------------------------------------------- Buttons */
/*
* Dashed borders mean "destructive or failed", and nothing else may use them.
@ -364,9 +388,11 @@ html[data-theme="amber"] .wrolpi-searchbox-control:focus-within {
/* ------------------------------------------------------------- Form fields */
/*
* A Pill is what MultiSelect renders for each chosen option, and it is the one place
* Mantine does not honour the radius theme: `Pill` writes `--pill-radius: rem(1000)`
* on the element itself, which no amount of zeroing `--mantine-radius-xl` can reach.
* Everything else in the library has hard corners, so these do too.
* Mantine does not honour the radius theme. MultiSelect leaves `radius` undefined, so
* Pill emits no `--pill-radius` at all and its stylesheet falls back to
* `border-radius: var(--pill-radius, 1000rem)` -- a literal in Mantine's own CSS, which
* zeroing `--mantine-radius-xl` never touches. Defining the variable is what stops the
* fallback from ever applying. Everything else in the library has hard corners.
*/
.mantine-Pill-root {
--pill-radius: 0;