Repository navigation
fix(app): chart labels reach contrast, every chart speaks the page's language and is purged, and the widget's theme stays its own (GH-3618, GH-3619, GH-3625) - #3641
Merged
Conversation
…language and is purged, and the widget's theme stays its own (GH-3618, GH-3619, GH-3625) The text that names a series (the Forecast's y-axis titles and tick labels, its weekend day labels, the stripes' availability label) is the series' hue at 4.5:1 or more on the paper, and the Forecast's zero line is the muted text colour. The widget's ?theme= is forced on the page, not set as the preference the colour-mode module saves to localStorage for the whole origin. The Explorer and the stripes purge their charts before they unmount, as does the Meteogram, whose onUnmounted found its chart ref already cleared. Every chart config carries the page's language through one helper (plotly.js-locales for the buttons, Intl for the dates). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0187kUCUFKYgEkY8mDbH23V8
…, GH-3619, GH-3625) - stripes: the language is awaited before the purge and the drawing, and an older drawing whose chunk comes late draws nothing; the chart is not blank while the chunk loads - saved images: the copy drawn off screen gets the page's locale (Explorer and stripes) - Explorer: a failed language chunk is not kept as the language's config, so the next drawing asks again - Explorer: a chart whose element goes while the viewer stays (table view, facets on and off, an answer of other parameters) is purged - Polish and Danish, whose Plotly dictionary is empty, load no chunk - the dark paper is slate-900 (#0f172b): the contrast test and ACCESSIBILITY.md say so Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0187kUCUFKYgEkY8mDbH23V8
This was referenced Oct 30, 2026
gutzbenj
added a commit
that referenced
this pull request
Nov 10, 2026
…ames its reasons (Closes #3642, Closes #2559) (#3949) Closes #3642. Closes #2559 (the maintainer's decision of 2026-11-10: one app PR for the Meteogram's contrast, the baseline's issue links and reasons, and the acceptance written down). ## Colours (#3642) The Meteogram's HTML chrome outside Plotly used Tailwind's 500 shades. The icons of the five panel toggles and of the summary line now take the label colours of the charts (`SERIES_LABEL` / `seriesLabelColor`, #3641; `slate` is new, for the cloud cover, which has no label). A toggle that is on is the icon in that colour on a 10 % wash and a 40 % edge of it (`panelToggleStyle`), so the colour is one source for the icon, the wash and the edge. | Mark | Before (white, v4 palette) | After, by day: white / toolbar / on a toggle that is on | After, at night: card / toolbar / on a toggle that is on | | --- | --- | --- | --- | | wind (cyan) | `cyan-500` 2.37 | `#0e7490` 5.36 / 5.10 / 4.47 | `#06b6d4` 6.47 / 6.23 / 5.29 | | pressure (lime) | `lime-500` 1.95; toggle on `lime-600` 2.74 | `#4d7c0f` 4.99 / 4.75 / 4.20 | `#84cc16` 7.95 / 7.66 / 6.33 | | cloud cover (slate) | `slate-400` 2.63 | `#475569` 7.58 / 7.21 / 6.23 | `#94a3b8` 6.12 / 5.90 / 4.96 | | temperature (red) | `red-500` 3.81 | `#dc2626` 4.83 / 4.60 / 3.95 | `#f25b5b` 4.80 / 4.63 / 4.18 | | rain (blue) | `blue-500` 3.76 | `#2563eb` 5.17 / 4.92 / 4.29 | `#5b9cf8` 5.65 / 5.44 / 4.63 | Other HTML uses of the series colours found by grepping the whole app: - The wind line's `(km/h)` text (`text-cyan-700 dark:text-cyan-400`) takes the cyan label colour too (5.36 / 6.47). - The card of today had `border-blue-400 dark:border-blue-800` (2.5:1 by day); it is `border-blue-600 dark:border-blue-400` (5.25 and 5.95). - The explorer's warning icon was `text-red-500` (3.81); it is `text-red-600 dark:text-red-400`. - A toggle also says whether it is on (`aria-pressed`, it had none); the inactive toggles keep the app's greys (held at 3:1). ## Baseline entries (#2559) Each entry in `tests/e2e/accessibility/baseline.json` has an `issue` and a `reason`. I reproduced all four against the current components (Chrome 156, the spec's states, the generated markup read). In each the app sets none of the attributes concerned and has no prop or slot that reaches them: the cause is Nuxt UI's or Reka UI's. The upstream trackers were read only; **no issue was opened**. | Entry | Cause | Issue | | --- | --- | --- | | `aria-required-children`, explorer and meteogram / `station-menu-open` | Nuxt UI `USelectMenu`: `role="listbox"` on the combobox content, whose only child is `<div tabindex="-1" data-slot="focusScope">` | nuxt/ui#7075 (closed; fixed by nuxt/ui#7096 in 4.12.0) | | `scrollable-region-focusable`, explorer / `station-menu-open` | The same menu's `role="presentation"` viewport scrolls, with options at `tabindex="-1"` | the same issue, #7075 | | `aria-hidden-focus`, explorer / `values-error` | Reka UI toast viewport (behind `UToaster`): two focus proxies `<span aria-hidden="true" tabindex="0">` | unovue/reka-ui#2776 (closed; fixed by unovue/reka-ui#2980 in 2.11.0) | **All three are fixed in releases the app does not have yet.** The app is on `@nuxt/ui` 4.11.3 and `reka-ui` 2.10.5; `@nuxt/ui` 4.12.0 (2026-10-15) depends on `reka-ui` 2.11.0 (2026-10-05). In a throwaway copy of the app (not committed) built on 4.12.0, the three states reproduce none of the rules. Bumping `@nuxt/ui` would therefore empty the baseline. I did not bump: it is a dependency change of its own (4.12.0 also loads the menu and toast overlays lazily), and it is not in the decision. Schema: `issue?: string | null` and `reason?: string` are optional, so the spec (`compareToBaseline`) is unchanged and old files still load. `report.mjs --write-baseline` keeps both for an entry that is still found. `tests/unit/a11y-baseline.test.ts` holds that every entry states a reason and an issue (a GitHub URL or `null`, and a `null` names its project in the reason). ## `app/ACCESSIBILITY.md` - New section "How it is accepted", as decided: axe on request (`pnpm test:a11y`, the *App accessibility* workflow by dispatch or the label), not in every e2e run, because of its run time; Lighthouse by hand before each app release, with its score recorded in the file; the baseline lists its causes. - The baseline section lists the entries with their cause and issue (table above). - Lighthouse section: a table (date, app version, Lighthouse version, pages x devices, scores), with the 2026-10-18 result (Lighthouse 13.5.0, 34 x 100) and a row for this run, and how a row is made. - A paragraph on the Meteogram's chrome in the contrast section; the "On request" section states the scan's size and time, and the result of the full run below. ## Lighthouse (run by hand, this change) Lighthouse 13.6.0, Chrome 156.0.8078.80, production build of this tree with the spec's mock answers served as the backend, 17 URLs x mobile and desktop = 34 runs: **34 x 100**. A first run of the same pages scored the widget 98 (`landmark-one-main`: the page has no main landmark); the widget now has a `<main>` around its content (a unit test holds it). ## Tests, mutation checks and results - `tests/unit/button-contrast.test.ts` (new `describe`): every `SERIES_LABEL` colour on white, the paper, the toolbar and the dark card at 4.5:1; as the icon of a toggle that is on, on its own wash, at 3:1; the Tailwind palette read from `tailwindcss/theme.css` (oklch to sRGB, red-600 checked at 4.77); every `text-<colour>-<step>` class in `app/**/*.vue|ts` at 4.5:1 on white (`dark:` on the dark card); the Meteogram has no `text-(cyan|lime|slate)-` class and uses the label colours; the today card's border at 3:1. - `tests/e2e/chart-theme.spec.ts`: the icons and toggles measured as the browser paints them (computed colour of the icon, every background under it down to the page), on, off, and in both schemes. - Mutation checks, each failing and restored: cyan light label put back to `#06b6d4` (5 unit tests fail); `text-lime-500` back on an icon (2 fail); `text-slate-400` back (2 fail); `text-red-500` back on the explorer icon (1 fails); `border-blue-400 dark:border-blue-800` back on the card (1 fails); lime light label to `#84cc16` in the e2e (fails: `pressure toggle that is on, rgb(132, 204, 22) on rgb(237, 245, 227)`); the widget's `<main>` back to a `<div>` (1 fails). - `pnpm lint`: clean. `pnpm typecheck` (tsbuildinfo deleted first): exit 0. `pnpm test:ci`: **103 files, 2990 tests passed**. E2E (Chrome, Playwright's Firefox does not start on this machine): `chart-theme.spec.ts` and `meteogram-barbs.spec.ts`, **27 passed**. - `pnpm test:a11y --workers=3` on this tree (Chrome 156, axe 4.13.0): **393 tests, 393 passed, none retried, 15.5 minutes**; it found exactly the four baseline entries. A first run failed six tests of `index: search-results`: the spec expected one option for BERLIN-TEMPELHOF where the search lists the station twice (forecast, and on the map since #3839), which nothing had noticed as the scan runs on request. The spec takes the first now. (A second full run was disturbed by an e2e run of mine on the same server and is not counted.) The scan has been run in Chrome; the baseline was recorded in Firefox on Linux, which the `a11y` label would run in CI. I did not set it. ## Review fixes (commit 6115bed, a merge of main, and 68eb412) - **M1, a valid class crashed the contrast file.** Tailwind 4.3.3 writes `oklch(55.6% 0 none)` for every `neutral-*` and `zinc-50` (13 colours). `oklchToHex` takes `none` as 0 and throws a named error (`not an oklch() colour of Tailwind's palette: ...`) instead of `!`. New tests: `neutral-500` converts, at 4.74:1 on white; every `--color-*: oklch(...)` of `theme.css` (200+) converts; an unreadable colour is a named error. Mutation: the old numeric-only hue back fails the two neutral tests with the named error; a `text-neutral-500 dark:text-neutral-300` class in the markup passes (does not crash), and without its partner it is flagged (3.31:1 on the dark card). - **L1, gaps in the text-colour test.** A light class with no `dark:` partner in its class string (a partner is any `dark:` text colour of the same variants, `dark:text-white` included; the string is what lies between two quotes) is now also held to the dark card. That found `pages/history.vue`: `text-red-600` error text at 3.29:1 at night, now `dark:text-red-400` (mutation: the old class back fails with `pages/history.vue: text-red-600 (no dark: partner, painted at night too) 3.29:1 on card`). An opacity (`/NN`) or arbitrary `text-[#hex]` now fails (`unreadable`) rather than being skipped; none exists in the app today. `primary` and `brand` are **not** resolved: `text-primary-500` is 3.47:1 on white and is used **48 times** (icons and spinners), so resolving them would fail 48 places. I took the allowed alternative and said so in the test and in ACCESSIBILITY.md: only Tailwind's palette and `gray` are checked. The 48 `text-primary-500` uses are a finding for its own issue, not fixed here. The scan has tests of its own (what it flags and lets through). - **L2.** The test that could not fail is general: an entry with `issue: null` must name an owner (`Nuxt UI`, `Reka UI`, `Leaflet`, `Plotly`, `Tailwind`, `the app`) in its reason, and a synthetic test shows the check can say no. - **L3.** `pnpm lighthouse` (`app/tests/e2e/accessibility/lighthouse.mjs`) starts the spec's mock backend (the TypeScript file, transpiled with the `typescript` the app already has) as a plain HTTP server, serves `.output` with `NUXT_API_BASE` on it, runs `npx lighthouse@<version>` over the 17 URLs on mobile and desktop, prints each score with the failed audits and the line for the table, and exits 1 under 100. `tests/unit/lighthouse-urls.test.ts` holds its URLs to the spec's `PAGES`. ACCESSIBILITY.md's by-hand step now says `pnpm build && pnpm lighthouse`. I ran it end to end: **17 URLs x mobile and desktop, 34 x 100** (Lighthouse 13.6.0, HeadlessChrome 157; Chrome had updated since the first run). The first version of the script hung the API page: `spawnSync` blocked the script's own mock backend while Lighthouse waited for `/api/version` (NO_FCP). That is fixed in 68eb412 (async spawn, one retry of a run Lighthouse fails itself, `--only` for a subset of the URLs). - **Nits.** `CHANGELOG_APP.md`: the Forecast entry is rewrapped to 100 columns and mentions the night edge of today's card (blue-800 1.8:1 to blue-400 6.0:1; the day edge was 2.6:1 before, not 2.5), the explorer icon has its own `[Explorer]` line, and the History error text has a `[History]` line. ACCESSIBILITY.md: line 3 no longer calls #2559 the open tracking issue; "500 shades" names what the toggles and icons had (cyan-500, lime-500, red-500, blue-500, slate-400); the last-run paragraph says the first run came before the `.first()` fix and mentions the second, disturbed run, and that the app change since the full run is the `dark:` colour on History's error. `tests/nuxt/components/Meteogram.test.ts` has a describe that holds `aria-pressed`, the toggles' style, the summary icons' colours in both schemes and today's card classes in the rendered component (mutation: `aria-pressed` removed and the old card border back fail 3 of the 4); the source-text assertions in `button-contrast.test.ts` are gone. The comment in `playwright.config.ts` states the scan's real size. - **Checks** (`app/`, after merging main, which changed no app file): `pnpm lint` clean; `pnpm typecheck` (tsbuildinfo deleted) exit 0; `pnpm test:ci` **104 files, 3004 tests passed**; `chart-theme.spec.ts` e2e (Chrome, port 4415) **25 passed**. The full a11y scan was not re-run: the app change since the recorded run is the `dark:` class on History's error text (ACCESSIBILITY.md says so). Review fixes: the contrast test reads Tailwind's `none` hue instead of crashing, holds a light text colour with no `dark:` partner to the dark card (History's error text fixed), and fails on opacity modifiers and arbitrary colours; `pnpm lighthouse` committed for the by-hand runs (34 of 34 at 100); the baseline test can fail; `aria-pressed` held in the component test. The App accessibility workflow was dispatched once on the head and passed. The `primary`/`brand` text colours the test does not check are a separate issue. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0187kUCUFKYgEkY8mDbH23V8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
GH-3618, contrast. The text that names a series is the series' hue at 4.5:1 or more on the paper, from one table (
SERIES_LABEL,seriesLabelColorinutils/chart-theme.ts): the Forecast's y-axis titles and tick labels, its weekend day labels, and the stripes' "data availability" label. The lines, bars and the availability line keep their data colours. Light paper (white) / dark paper (slate-900, #0f172b):The Forecast's zero line is the muted text colour (it was a 20 % wash, 1.4:1 / 1.7:1).
tests/e2e/chart-theme.spec.tsnow reads the drawn charts (title and tick colour of every y axis, the zero line, the weekend labels, the stripes' label, in both schemes, washes mixed over the paper) and holds them to 4.5:1 / 3:1.GH-3619, widget scheme and purge.
widget.vueforces its scheme (colorMode.forced, the mechanism ofdefinePageMeta({ colorMode })) instead of settingpreference, which @nuxtjs/color-mode saves to localStorage for the whole origin. The saved choice stays, and the next navigation puts the app's scheme back. The Explorer (single chart and facets) and the stripes purge their charts before unmount, and the Explorer also purges a chart whose element goes while the viewer stays (table view, facets on or off, an answer of other parameters). The Meteogram's purge never ran:chartRefis already cleared inonUnmounted, so it isonBeforeUnmountnow.GH-3625, language. One helper,
utils/plotly-locale.ts, gives every chart configlocaleandlocales: Plotly's own button names (new dependencyplotly.js-locales, one chunk per language, loaded on use) and the Intl names of weekdays and months.lbandde-hhtake German's buttons; the camera the app adds itself is translated too (Plotly does not translate an added button). The stripes await the language before they purge and draw, so an older drawing whose chunk comes late draws nothing and the chart is not blank meanwhile; a language whose chunk failed is drawn in English and asked for again by the next drawing (not kept in the Explorer's config); the copy drawn for a saved image (Explorer and stripes) has the page's locale; Polish and Danish, whose Plotly dictionary is empty, load no chunk. A language switch redraws the charts like a scheme switch (Meteogram and stripes already watchedlocale; the Explorer's single chart and facets follow through the config). The suncalc caching of the issue was done by #3615. Plotly ships no button names for Polish and Danish and only some for Dutch: those stay English, as noted inACCESSIBILITY.md.Tests
react.chart-theme.spec.ts, Chrome, production build): contrast of the Forecast and the stripes' label, and the widget with?theme=darkover a saved light scheme and the reverse, read fromlocalStorageand from the app opened afterwards.Closes #3618
Closes #3619
Closes #3625
🤖 Generated with Claude Code
https://claude.ai/code/session_0187kUCUFKYgEkY8mDbH23V8