From ff80cc96fd0bcfa283a66574759efe8509083222 Mon Sep 17 00:00:00 2001 From: npeter83 Date: Fri, 25 Sep 2026 13:55:26 +0200 Subject: [PATCH] fix(design): rating and live colour tokens, the player's menus over its notices, the info overlay on a light theme (E28) - F16: --rating (theme-scoped gold, 4.5:1 on the page and its chip), --rating-media, --live/--live-fg, --media-chrome replace 14 palette literals; a lint rule refuses palette classes; the theme contract measures them. - The Plex player's notices drew over its open settings/tracks popovers: notices z-base, popovers z-menu. - The player's info overlay rendered theme tokens on its always-dark panel: on a light theme the score (2.6:1), collection years (3.2:1) and cast initials (1.05:1) were unreadable; onDark variants now. - The lint-rule contract tests share one ESLint with a one-off warm-up (a cold first lint took 8 s, past vitest's 5 s). --- docs/DESIGN.md | 12 +++++-- frontend/eslint.config.js | 10 ++++++ frontend/src/components/PlayerModal.tsx | 2 +- frontend/src/components/PlexInfo.tsx | 36 ++++++++++++++----- frontend/src/components/PlexPlayer.tsx | 11 +++--- .../src/components/PlexPlayerSettings.tsx | 2 +- frontend/src/components/UpNextCard.tsx | 2 +- frontend/src/components/VideoCard.tsx | 6 ++-- frontend/src/components/playlistColumns.tsx | 2 +- frontend/src/components/plexCards.tsx | 4 +-- frontend/src/components/plexViews.tsx | 4 +-- frontend/src/design-lab/batchC.tsx | 4 +-- frontend/src/index.css | 19 ++++++++++ .../src/lib/buttonPrimitive.contract.test.ts | 7 ++-- .../src/lib/controlRules.contract.test.ts | 8 ++--- frontend/src/lib/focusSafe.contract.test.ts | 7 ++-- .../src/lib/hoverAndLink.contract.test.ts | 34 +++++++++++++----- .../src/lib/inputPrimitive.contract.test.ts | 7 ++-- .../src/lib/jsxCommentText.contract.test.ts | 7 ++-- frontend/src/lib/lintProbe.testkit.ts | 16 +++++++++ .../src/lib/literalA11yText.contract.test.ts | 7 ++-- .../src/lib/networkBoundary.contract.test.ts | 7 ++-- frontend/src/lib/pxBox.contract.test.ts | 8 ++--- .../src/lib/sortableA11y.contract.test.ts | 7 ++-- frontend/src/lib/surfaceRole.contract.test.ts | 7 ++-- frontend/src/lib/theme.contract.test.ts | 26 +++++++++++++- frontend/src/lib/uiBoundary.contract.test.ts | 7 ++-- frontend/src/lib/zLayer.contract.test.ts | 32 ++++++++++++++--- 28 files changed, 201 insertions(+), 100 deletions(-) create mode 100644 frontend/src/lib/lintProbe.testkit.ts diff --git a/docs/DESIGN.md b/docs/DESIGN.md index 7232721f..07c3b91c 100644 --- a/docs/DESIGN.md +++ b/docs/DESIGN.md @@ -69,7 +69,12 @@ style guide. ## Tokens - **Colour:** only semantic tokens (`--bg --surface --card --fg --muted --accent --accent-fg --danger ---warn --success --info --border`, each with a `-fg` partner where text sits on it). Four schemes × dark +--warn --success --info --border`, each with a `-fg` partner where text sits on it), and no palette class + (`text-amber-500`: lint-refused). A score's gold is `--rating` (theme-scoped, 4.5:1 on the page and on its + own chip), never `--warn`: a score is not a warning. What sits on a picture looks the same in both themes, + because the picture does: the broadcast red `--live` under `--live-fg` (never `--danger`: "live" is not an + error), `--rating-media` on a poster's scrim, and `--media-chrome` for the always-dark player's menus + (owner decision F16). Black and white are the media scrims and their text. Four schemes × dark and light (B2): **Midnight** (blue), **Forest** (cyan), **Slate** (fuchsia), **Matrix** (moss). Each earns its place with its own hue family. Normal text ≥ 4.5:1 and a control's edge ≥ 3:1 in **every** scheme and mode. [WCAG 1.4.3, 1.4.11] The input edge token is set under Controls (A4). The ≥ 3:1 edge is the field @@ -81,8 +86,8 @@ style guide. the fill, in dark and light. A primary button must never read as a destructive one. A new scheme is measured against this before it ships (the lab's B2 tiles do the arithmetic). [WCAG 1.4.1, 1.4.3] - **Held in code:** `frontend/src/lib/theme.contract.test.ts` measures every scheme × mode in `index.css` - against the two rules above (text 4.5:1, a control edge 3:1, the status colours as text, the accent's hue - gap). A scheme or a retuned colour that breaks them does not pass the gate. + against the two rules above (text 4.5:1, a control edge 3:1, the status and rating colours as text, the accent's + hue gap), and the media colours against what they sit on. A scheme or a retuned colour that breaks them does not pass the gate. - **No per-user colour tuning.** The schemes are the only colour choice; the old floating glass tuner was retired (E28), because free tuning is exactly the drift these rules exist to stop. - **Backdrops:** one per scheme and mode (`public/backdrops/`), soft pools in the accent's family, with a @@ -361,5 +366,6 @@ Wherever there is text, the user can select it and copy it, and no click action | 2026-09-25 | Header search | A 40 glass pill with the field edge (`lg`); what sits inside it is round | 44, r16, a glass box with a faint edge | The one rounded box among pills, and its edge under 3:1; the hero search is the YouTube/Gmail pill | | 2026-09-25 | Switch row (F12) | The whole settings row toggles (`SwitchRow`; a hand-laid row points a label at the switch) | Only the 36×24 switch toggles | The iOS / Material settings row; the text was a dead click beside the control it names | | 2026-09-25 | Edges and hovers (F14) | The ≥ 3:1 edge on the field family (fields, the form trigger); labelled pills keep the faint edge and the accent-edge hover | The ≥ 3:1 edge and a state-layer hover on every control | 1.4.11 asks an edge only where nothing else identifies the control; a heavy edge on every chip and tab weighs the whole UI down | +| 2026-09-25 | Rating and live (F16) | Own tokens: `--rating` (theme-scoped gold), `--live`/`--live-fg`, `--rating-media`, `--media-chrome`; palette classes lint-refused | Map them to `--warn` / `--danger` | A gold star and a red LIVE are what the eye expects; as warn/danger they would read as a status. The old amber score was 2:1 on light | | 2026-09-24 | Chip family | One `Chip` (filter / token / tag / suggest / ghost) + `DismissibleChip`; nothing under 24; the lint rule "no raw `