Skip to content

fix(ui): status that survives greyscale, and a button that clears AA (#232) - #238

Merged
vishr merged 5 commits into
mainfrom
fix/p3-design-system
Sep 7, 2026
Merged

vishr merged 5 commits into
mainfrom
fix/p3-design-system

Conversation

@vishr

@vishr vishr commented Sep 7, 2026 •

Copy link
Copy Markdown
Member

What changed

P3 items from #232 — the design-system findings — verified against a running instance with all three health states seeded.

The dark scheme's primary button was under WCAG AA. White on #a97ce0 measured 3.16:1 on the New chat button, the most-used control in the product. The theme already asked for autoContrast and its comment already described near-black on that fill; the reason it never happened is that Mantine reads filled text from parseThemeColor, which resolves a two-shade primaryShade against the light scheme whatever scheme is actually rendering — so the decision was made against #7c4dcc while the CSS painted #a97ce0. Filled primary surfaces now defer to --mantine-primary-color-contrast, which is emitted per scheme. Measured in the running app afterwards: 6.65:1 dark, 5.54:1 light, with the brand fill unchanged in both.

Health was hue-only. Green, amber and red are the one channel a reader with a colour vision deficiency does not have, on a map that is otherwise a field of identical circles. Each state now carries a shape too — diamond, rounded square, circle — in the service map and as a glyph on every health badge.

The map's salience was inverted. A failing dependency took its width from call volume like every other edge, at the same half opacity, so the worst edge was the thinnest and palest line on the canvas. It is now the widest and the only one at full strength.

Type had no floor. One screen carried fifteen size-and-weight pairs including a 9px badge and 10px axis labels. The sizes a component may use are a named scale with an 11px floor, and the charts read the same numbers because a canvas cannot inherit them.

Two chart readings that said nothing. The error-rate sparkline had no baseline and no scale, so a line near zero looked like a line near its own peak; it states its peak and draws a zero line. The latency heatmap's colour scale sat on top of the time labels and read "600000" with no unit; it has its own band and reads in the same units as every other latency in the product.

Two findings deliberately not acted on

  • Dark muted text is warm against a cool ground. I raised this in the original review, but ui/tokens.ts says the Ayu cast is the point and that a "corrected" neutral grey would undo what makes the surfaces read as Ayu. That is a decision with a stated rationale, not a defect, so it stands.
  • The chart hatching is not decoration. It is ECharts' decal — the same second channel for colour vision this PR adds elsewhere. It stays on, and is disabled only on the 28px sparkline, where a texture cannot be read at that size.

Verification

  • just check
  • just test-race when auth, API, ingest, query, MCP, or agent paths changed
  • User-facing behavior and configuration docs are current
  • No credentials, private telemetry, host details, or enterprise-only source are included
  • API, migration, ingest, MCP/AG-UI, or release-contract changes are called out

New tests cover the resolver (including that it leaves other colours and variants alone), the type scale's floor, and the distinctness of the health shapes. Contrast was measured in the running app in both schemes rather than computed from the palette.

Part of #232 (P3 items 18, 19, 21, 22, 25, 26).

P3 items from #232, less the two that turned out to be wrong.

The dark scheme's primary button rendered white on #a97ce0 at 3.16:1 — under
WCAG AA, on the most-used control in the product. The theme already asked for
autoContrast and its comment already described near-black on that fill, but
Mantine reads filled text from parseThemeColor, which resolves a two-shade
primaryShade against the light scheme whatever scheme is rendering: the decision
was made against #7c4dcc while the CSS painted #a97ce0. Filled primary surfaces
now defer to --mantine-primary-color-contrast, which is emitted per scheme.
Measured in the running app: 6.65:1 dark, 5.54:1 light, with the brand fill
unchanged in both.

Health was drawn in green, amber and red alone — the one channel a reader with
a colour vision deficiency does not have, on a map that is otherwise twenty
identical circles. Each state now carries a shape as well: a diamond for
unhealthy, a rounded square for degraded, a circle for healthy, in the service
map and as a glyph on every health badge.

A failing dependency was the thinnest, palest line on the map: it took its width
from call volume like every other edge and the same half opacity. It is now the
widest line and the only one at full strength, because it is the one thing the
map exists to show.

A survey of one screen found fifteen size-and-weight pairs, including a 9px
badge and 10px axis labels. The sizes a component may use are now a named scale
with an 11px floor, and the charts read the same numbers because a canvas cannot
inherit them.

The error-rate sparkline had no baseline and no scale, so a line near zero and a
line near its own peak looked the same. It states its peak and draws a zero
line. The latency heatmap's colour scale sat on top of the time labels and read
"600000" with no unit; it has its own band and reads in the same units as every
other latency.

Two findings from the review are deliberately not acted on. The dark muted text
is warm against a cool ground, but tokens.ts says the Ayu cast is the point and
that a corrected neutral would undo it — that is a decision, not a defect. And
the chart hatching is ECharts' decal, the same second channel for colour vision
this commit adds elsewhere; it stays, and is disabled only on the 28px
sparkline, where a texture cannot be read.

Claude-Session: https://claude.ai/code/session_017ovmTezqzvxVP8P9MGDQNk
…seline draws

Two defects in the previous commit, found by reading it back rather than by a
test.

The MCP app views mount their own MantineProvider and built it straight from
fanoutThemeConfig, so the resolver never reached them: a filled button inside a
chat card still read white on the dark accent at 3.16:1 while the identical
button outside the card cleared AA. The rule now lives in the shared theme as a
factory that takes Mantine's default resolver as an argument — the shared
directory has no node_modules of its own — and both apps wire it.

The sparkline's zero line was specified as var(--mantine-color-dimmed). A chart
is drawn into a canvas, which cannot read a CSS custom property, so the line
that was added to give the trend something to be a shape against never drew at
all. The colour is passed in resolved, from the same chart palette the axes use.

Claude-Session: https://claude.ai/code/session_017ovmTezqzvxVP8P9MGDQNk
Two of these are defects in the previous commits, not refinements.

The sparkline's zero line never drew: markLine is a separately registered
ECharts component and neither echart.tsx nor this file registers it, so the
option was silently dropped. The commit and the PR both claimed a line that was
never on screen. The reviewer also pointed out it would not have helped if it
had drawn — the axis is pinned at zero and auto-scales its top, so the rule sits
on the floor of the plot whatever the data does. Stating the peak is what
answers "near zero or near its own peak", so the peak stays and the rule goes.

The contrast fix reached the host and not the embedded views. Tabs and
Pagination set their own text colour through Mantine's other auto-contrast path,
which has the same bug — it resolves the two-shade primaryShade against the
light scheme — so the pill tabs on every MCP app view were still white on
#a97ce0 at 3.16:1 while the button beside them was fixed. Both components are
now pointed at the per-scheme contrast variable, verified resolving to #000 in
dark and #fff in light.

The rest are corrections to claims and to craft:

The luminanceThreshold comment said the accent was the only stop in the band.
It is not: the resolver evaluates shade 7, so ok[7], warn[7] and dark[3] change
hands too. Each flips white to near-black on a filled surface, and each is an
improvement — black on #7fd962 reads 12.0:1 where white read 1.75:1. The comment
now says so.

The diamond was the smallest node on the map. ECharts sizes a symbol by its
bounding box and a diamond fills half of one, against a circle's 0.79 and a
rounded square's 0.95, so the unhealthy node drew a third smaller than a healthy
one and shrank its click target to match — the opposite of the commit's claim
that it stands out. The shapes are scaled to even out drawn area.

The sparkline's aria option replaced EChart's defaults wholesale, dropping the
description and letting ECharts generate an aria-label that reads the data
values instead of the label. And the health glyph this branch added was itself
9px, in the commit that raised the floor to 11.

Claude-Session: https://claude.ai/code/session_017ovmTezqzvxVP8P9MGDQNk
@vishr

vishr commented Sep 7, 2026 •

Copy link
Copy Markdown
Member Author

Second round of review fixes pushed as e9bf7cf1.

The contrast fix only reached the primary colour. Mantine emits a per-scheme contrast variable for the primary alone, so the other four semantic colours kept the original defect: the dark scheme painted white on bad[5] #f26d78 at 2.90:1 — the Remove button under a widget's menu, a failing waterfall span, and the unhealthy count in the embedded health bar. Each semantic colour now gets its own per-scheme variable, and the rule is which of black and white reads better, not is this colour light. Those diverge in the middle of the range: info[7] #1e86bd is below the threshold, so white, at 4.04:1, where black reads 5.20:1.

Measured after the change, all ten pairs:

light dark
brand 5.54 6.65
ok 6.15 12.00
warn 6.41 11.91
bad 5.46 7.87
info 5.20 9.86

The test now computes those numbers from the palette rather than asserting a variable name. The previous test passed with luminanceThreshold reverted and the button back at 3.16:1; this one fails. The Tabs and Pagination overrides are covered too, including that a color other than the accent is left alone.

The 11px floor was a claim the code did not keep. Mantine's Badge has its own scale (xs 9px, sm 10px), so the log severity badge, the tab count and the rail's "Default" pill were still under it — including the 9px badge that motivated the scale. Badge sizes below the floor are raised to it; nothing above it is touched. The scale's comment no longer claims to be the whole type ramp.

Also fixed: an ungraded node fell through to healthy green on both service maps (now grey, and a dashed ring, since shape is the severity channel); the health badge announced the service name and not its state; the node size cap is applied after the equal-area scale so a node stays inside the documented maximum; autoContrast={false} is respected; the sparkline memo lists label.

Verified against a running instance: the five variables resolve per scheme in the DOM (#000/#fff as the table above), and the rail badge measures 11px where it measured 9px.

just check green.

Re-review findings on the design-system pass. The primary button was fixed by
deferring to Mantine's per-scheme contrast variable, but Mantine emits that
variable for the primary colour alone, so the same defect stayed on the other
four semantic colours: the dark scheme painted white on bad[5] #f26d78 at
2.90:1, which is what the Remove button under a widget's menu, a failing
waterfall span, and the unhealthy count in the health bar were drawn in.

Each semantic colour now gets its own per-scheme contrast variable, decided
against the shade that scheme actually paints, and the rule is which of black
and white reads better on it rather than whether the colour is light. Those
differ in the middle of the range, and info[7] #1e86bd is in it: light enough
for white by the threshold, at 4.04:1, where black reads 5.20:1. The active
tab, the current page control and the Progress labels in the embedded health
bar are pointed at the same variables, so one measurement covers them all.

The contrast test now computes ratios from the palette instead of asserting a
variable name: every semantic colour, both schemes, against 4.5:1. The
previous test would have passed with luminanceThreshold reverted and the
button back at 3.16:1.

The 11px floor was a claim the code did not keep. Mantine's Badge carries its
own scale — xs is 9px, sm is 10px — so the severity badge in a log table, the
count on a tab and the "Default" pill in the rail were still under it, one of
them the 9px badge that motivated the scale. Badge sizes below the floor are
raised to it and no size above it is touched. The scale's own comment no
longer claims to be the whole type ramp; headings still come from Mantine.

Also from the review: an ungraded node fell through to healthy green on both
service maps, so it claimed a health the data never established — it is grey
now, and a dashed ring, because shape is the severity channel and "unknown"
has no place in that order. The health badge named the service and not its
state to a screen reader, in the component whose whole point is that hue is not
enough. The node size cap is applied after the equal-area scale rather than
before, so a node stays inside the documented maximum. A filled surface that
sets autoContrast={false} keeps Mantine's white. The sparkline's option memo
reads `label` and now lists it.

Claude-Session: https://claude.ai/code/session_017ovmTezqzvxVP8P9MGDQNk
@vishr

vishr commented Sep 7, 2026 •

Copy link
Copy Markdown
Member Author

Correction to the table above: dark is 7.23 and dark 10.59 — I mistyped both. Every pair still clears 4.5:1, and the test computes the numbers rather than trusting the comment.

Head is now 41c2f0a0 (the same change, with the rebuilt embedded assets).

@vishr

vishr commented Sep 7, 2026

Copy link
Copy Markdown
Member Author

The previous comment lost two words to shell expansion. It should read: bad dark is 7.23 and info dark is 10.59 — both were mistyped in the table above. Every pair still clears 4.5:1, and the test computes the numbers rather than trusting the comment.

Verification of the previous commit found three of its claims untrue on the
page, and the tests could not see any of them because none of them rendered a
component.

The Progress fix was inert. Progress sets --progress-label-color through its
own vars, and Mantine writes vars after any style prop on the same element, so
pointing that variable elsewhere from the section changed nothing: the
unhealthy count in the embedded health bar was still white on #f26d78 at
2.90:1. The colour goes on the label itself, where nothing overwrites it.

The badge scale was wrong. Mantine's md is 11px and lg is 13px, not 12 and 14,
so raising every size to a floor of 11 by way of that table grew the default
badge — the one used unqualified across the trace, performance and overview
views — from 11px to 12px, and lg from 13 to 14. Only xs and sm sit under the
floor and only those two are raised; a size the scale does not name is left
alone rather than collapsed onto the default, and the value is emitted in rem
so a badge still answers to the root font size.

The node size cap is back outside the equal-area scale. Clamping the product
puts every busy service on the same bounding box, which is where a diamond
loses a third of its area to a circle again — the defect the scale exists to
fix. An unhealthy node is allowed to be the biggest thing on the map.

The health badge names its state as text rather than as an aria-label: a Badge
renders a bare div, which maps to role=generic, where a name from the author is
discarded — so the previous fix announced nothing.

Three rendering tests now assert what lands on the element: the filled text
variable on a Button, the badge floor on each size, and a Progress label that
Progress cannot overwrite. Also from the review: the two filled shades come
from one constant that primaryShade also reads, Object.hasOwn replaces an `in`
that walked the prototype chain, and relativeLuminance accepts a three-digit
hex.

Claude-Session: https://claude.ai/code/session_017ovmTezqzvxVP8P9MGDQNk
@vishr

vishr commented Sep 7, 2026 •

Copy link
Copy Markdown
Member Author

Third round, pushed as d446f6c8. Verification of the previous commit found three of its claims untrue on the page — and the tests could not see any of them, because none of them rendered a component.

  • The Progress fix was inert. Progress sets --progress-label-color through its own vars, and Mantine writes vars after any style prop on the same element, so pointing that variable elsewhere from the section changed nothing: the unhealthy count in the embedded health bar was still white on #f26d78 at 2.90:1. The colour now goes on the label itself.
  • The badge scale numbers were wrong. Mantine's md is 11px and lg is 13px, not 12 and 14. Raising every size through that table grew the default badge — used unqualified across the trace, performance and overview views — from 11px to 12px, and lg from 13 to 14, which is the opposite of "no size above the floor is touched". Only xs and sm sit under the floor; only those two are raised, a size the scale does not name is left alone rather than collapsed onto the default, and the value is emitted in rem so a badge still answers to the root font size.
  • The node size cap is back outside the equal-area scale. Clamping the product puts every busy service on the same bounding box, which is exactly where a diamond loses a third of its area to a circle — the defect the scale exists to fix. An unhealthy node is allowed to be the biggest thing on the map.
  • The health badge's aria-label announced nothing. A Badge renders a bare div, which maps to role=generic, where an author-supplied name is discarded. The state is text inside the badge now, visually hidden.

Three rendering tests now assert what lands on the element rather than what the config says: the filled-text variable on a Button (including autoContrast={false} and a non-semantic colour), the badge floor across every size, and a Progress label that Progress cannot overwrite. That is the hole all three defects fell through.

Also from the review: both filled shades come from one constant that primaryShade reads too, Object.hasOwn replaces an in that walked the prototype chain, and relativeLuminance accepts a three-digit hex.

just check green; 103 UI tests.

@vishr
vishr merged commit 576765f into main Sep 7, 2026
8 checks passed
@vishr
vishr deleted the fix/p3-design-system branch September 7, 2026 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant