Skip to content

feat(react-checkout): restyle the app on the Whatsaaaa design system - #4

Merged
whatsaaaa merged 8 commits into
mainfrom
fm/sample-app-restyle-react
Nov 13, 2026
Merged

whatsaaaa merged 8 commits into
mainfrom
fm/sample-app-restyle-react

Conversation

@whatsaaaa

@whatsaaaa whatsaaaa commented Nov 13, 2026 •

Copy link
Copy Markdown
Owner

Intent

Restyle the sample apps on the Whatsaaaa design system, installed from npm like any user would. The apps were built plain on purpose as a docs-only trial of form-builder, with everything visual kept in each app's src/ui folder and src/styles.css so the look could be swapped later.

This pull request restyles the React app, react-checkout, following the look settled in the Vue app's restyle (#3), so the two apps read as siblings.

What Changed

  • react-checkout now installs @whatsaaaa/design-system 0.1.1 and Shiki from npm. Its Node engine moves to ^22.18.0 || >=24.12.0 to match the design system. A Vite plugin inlines the system's theme and shortcut-key init scripts in the <head>, so a saved theme and a saved "keys off" setting apply before the first paint. The app also gets new favicons and an apple-touch icon.

  • The page now sits in the design system's terminal frame, matching the Vue app:

    • A new TabBar shows the form-builder mark for each theme, a docs link and the ghost.
    • The rewritten StatusLine has a NORMAL/INSERT mode, a ~/react-checkout path that shows whole or not at all, a theme switch (the t key or the theme name) and a shortcut-keys switch.
    • The language buttons move into a LanguageSwitch in the header. The loading line becomes StatusMessage.
    • src/styles.css is rewritten on the design system's tokens. It covers dark and light themes, narrow screens and forced colors.
    • Form changes: sections get titles instead of cards, a row of sections gets its own spacing, and selects get a drawn arrow. Text inputs no longer show a placeholder.
  • The placed order now shows in the design system's code block, captioned order.json. It is highlighted with the system's Shiki code theme, loaded lazily, and stays plain text if the highlighter fails to load. New Playwright specs (frame.spec.ts, shared helpers in checks.ts) and additions to checkout.spec.ts cover:

    • the theme and keys switches, and that both are remembered
    • the status line at 320 and 390 px in both themes
    • forced colors
    • no sideways scrolling
    • the faint order button while an order is being sent
    • the plain-text fallback

    The README now says both apps are restyled and both need Node 22.18+ or 24.12+.

🤖 Generated with Claude Code

Risk Assessment

✅ Low: The change is a well-bounded restyle of the React app's src/ui, stylesheet and tests that mirrors the already-reviewed Vue sibling; the three round-1 fixes are correct and minimal, and no new defect, regression or intent conflict was found.

Testing

I rebuilt react-checkout with pnpm build, served it on localhost:4275 with its own server and drove it in Chromium through two Playwright scripts, saving screenshots to the evidence round2 folder. Scenarios covered: - Desktop in light and dark: empty form, field errors, and a placed order with highlighted JSON. - Theme switch and shortcut-keys switch, both remembered after a reload. - 320 and 390 px screens in both themes: German text, server-side errors, and the placed order, with zero sideways overflow. - The "Place order" button while the order is being sent, with the pointer on it and away from it. - The order shown with the highlighter file blocked. - Forced colors on a light and a dark system: each language pressed in turn, the terms box ticked, and a pixel count of each label's text. - A runtime mutant that removes forced-color-adjust: none from the pressed-language rule. The label's text pixel count drops from 2143 to 0, the same blank plate seen in round 1. I also ran the app's two e2e specs, which this change edited, against a fresh production build on desktop and mobile Chromium. 45 passed, and 1 was skipped on purpose: the t-key test is marked to skip on mobile. Every scenario passed. I stopped the server and removed dist and test-results.

  • Live validation: ✅ go - 7 of 7 scenarios driven live against the product
Scenario Result Live Evidence
Desktop shopper in light and dark sees the checkout on the design system's terminal frame and places an order shown as highlighted JSON ✅ pass live round2/desktop-dark-form.png, desktop-light-placed.png, desktop--errors.png; capture-log.json placed--token-colors (5 Shiki token colors), desktop-*-errors []
Shopper switches the theme and the shortcut keys from the status line, and both are remembered after a reload ✅ pass live capture-log.json theme-after-click=dark, theme-after-reload=dark, keys-after-click=off; round2/desktop-switched-to-dark-after-reload.png, statusline-dark-keys-off.png
Shopper on 320 and 390 px screens in both themes switches to German, gets server-side errors, then places the order without any sideways scroll ✅ pass live capture-log.json w320/w390--overflow- all 0; round2/mobile-320-light-german-server-errors.png and the other mobile-*.png
Regression: shopper clicks 'Place order' and keeps the pointer on it; the disabled 'Placing your order...' button stays faint instead of showing the hover fill ✅ pass live capture-log.json light/dark-disabled-hover equals disabled-rest (transparent background, faint text, not-allowed cursor); round2/button-*-disabled-under-pointer.png; e2e 'keeps the order button faint…
Adversarial: the highlighter file fails to load; the placed order still shows as plain text with no page errors ✅ pass live capture-log.json blocked-highlighter-aborted-urls [highlight-*.js], blocked-highlighter-pageerrors [], one text color; round2/codeblock-highlighter-blocked-plain.png; e2e 'shows the order as plain tex…
Adversarial (round-1 failure): in forced colors on a light and a dark system, the shopper can read the pressed language and tell it and the ticked terms box from the others ✅ pass live round2/forced-colors-{light,dark}-language-{english,deutsch}-pressed.png, forced-colors-*-terms-ticked.png; forced-colors-log.json: pressed button background = Highlight and label pixel count 2143/210…
The app's e2e specs (frame and checkout) pass against a fresh production build on desktop and mobile Chromium ✅ pass live round2/playwright-e2e.log: 45 passed, 1 skipped on purpose (t-key test on mobile), EXIT=0

Forced colors, light system: English pressed, label readable

Forced colors, dark system: Deutsch pressed, label readable

Forced colors, runtime mutant without the fix: pressed label is a blank plate

Forced colors, light system: full page with terms box ticked

Forced colors, dark system: terms box ticked

Evidence: Forced colors computed styles, label pixel counts and mutant results
{
  "light": {
    "system": {
      "Canvas": "rgb(255, 255, 255)",
      "CanvasText": "rgb(0, 0, 0)",
      "Highlight": "rgba(5, 0, 73, 0.8)",
      "HighlightText": "rgb(255, 255, 255)",
      "ButtonText": "rgb(0, 0, 0)"
    },
    "English-pressed": {
      "English": {
        "color": "rgb(255, 255, 255)",
        "background": "rgba(5, 0, 73, 0.8)",
        "fca": "none",
        "outline": "rgba(5, 0, 73, 0.8)",
        "ink": 2143
      },
      "Deutsch": {
        "color": "rgb(0, 0, 0)",
        "background": "rgba(255, 255, 255, 0)",
        "fca": "auto",
        "outline": "rgb(0, 0, 0)",
        "ink": 2100
      }
    },
    "Deutsch-pressed": {
      "English": {
        "color": "rgb(0, 0, 0)",
        "background": "rgba(255, 255, 255, 0)",
        "fca": "auto",
        "outline": "rgb(0, 0, 0)",
        "ink": 2143
      },
      "Deutsch": {
        "color": "rgb(255, 255, 255)",
        "background": "rgba(5, 0, 73, 0.8)",
        "fca": "none",
        "outline": "rgba(5, 0, 73, 0.8)",
        "ink": 2100
      }
    },
    "termsUnticked": {
      "color": "rgb(0, 0, 0)",
      "background": "rgb(255, 255, 255)",
      "fca": "auto",
      "outline": "rgb(0, 0, 0)"
    },
    "termsTicked": {
      "color": "rgb(255, 255, 255)",
      "background": "rgba(5, 0, 73, 0.8)",
      "fca": "auto",
      "outline": "rgb(255, 255, 255)"
    },
    "mutant": {
      "rulesStripped": 1,
      "EnglishInk": 0,
      "DeutschInk": 2100
    },
    "pageErrors": []
  },
  "dark": {
    "system": {
      "Canvas": "rgb(0, 0, 0)",
      "CanvasText": "rgb(255, 255, 255)",
      "Highlight": "rgba(26, 235, 255, 0.8)",
      "HighlightText": "rgb(0, 0, 0)",
      "ButtonText": "rgb(255, 255, 255)"
    },
    "English-pressed": {
      "English": {
        "color": "rgb(0, 0, 0)",
        "background": "rgba(26, 235, 255, 0.8)",
        "fca": "none",
        "outline": "rgba(26, 235, 255, 0.8)",
        "ink": 2143
      },
      "Deutsch": {
        "color": "rgb(255, 255, 255)",
        "background": "rgba(0, 0, 0, 0)",
        "fca": "auto",
        "outline": "rgb(255, 255, 255)",
        "ink": 2100
      }
    },
    "Deutsch-pressed": {
      "English": {
        "color": "rgb(255, 255, 255)",
        "background": "rgba(0, 0, 0, 0)",
        "fca": "auto",
        "outline": "rgb(255, 255, 255)",
        "ink": 2143
      },
      "Deutsch": {
        "color": "rgb(0, 0, 0)",
        "background": "rgba(26, 235, 255, 0.8)",
        "fca": "none",
        "outline": "rgba(26, 235, 255, 0.8)",
        "ink": 2100
      }
    },
    "termsUnticked": {
      "color": "rgb(255, 255, 255)",
      "background": "rgb(0, 0, 0)",
      "fca": "auto",
      "outline": "rgb(255, 255, 255)"
    },
    "termsTicked": {
      "color": "rgb(0, 0, 0)",
      "background": "rgba(26, 235, 255, 0.8)",
      "fca": "auto",
      "outline": "rgb(0, 0, 0)"
    },
    "mutant": {
      "rulesStripped": 1,
      "EnglishInk": 0,
      "DeutschInk": 2100
    },
    "pageErrors": []
  }
}

Desktop dark form on the design system frame

Desktop light placed order with highlighted JSON

320 px light, German, server errors

Disabled 'Placing your order...' under the pointer (light), faint, no hover fill

Order code block as plain text with the highlighter file blocked

Evidence: Captured states: overflow, theme and keys after reload, button styles, highlighter fallback
{
  "placed-dark-token-colors": [
    "rgb(144, 140, 170)",
    "rgb(224, 222, 244)",
    "rgb(156, 207, 216)",
    "rgb(246, 193, 119)",
    "rgb(196, 167, 231)"
  ],
  "desktop-dark-errors": [],
  "placed-light-token-colors": [
    "rgb(144, 140, 170)",
    "rgb(224, 222, 244)",
    "rgb(156, 207, 216)",
    "rgb(246, 193, 119)",
    "rgb(196, 167, 231)"
  ],
  "desktop-light-errors": [],
  "theme-after-click": "dark",
  "theme-after-reload": "dark",
  "keys-after-click": "off",
  "w320-dark-overflow-initial": 0,
  "w320-dark-overflow-german-errors": 0,
  "w320-dark-overflow-placed": 0,
  "w320-light-overflow-initial": 0,
  "w320-light-overflow-german-errors": 0,
  "w320-light-overflow-placed": 0,
  "w390-dark-overflow-initial": 0,
  "w390-dark-overflow-german-errors": 0,
  "w390-dark-overflow-placed": 0,
  "w390-light-overflow-initial": 0,
  "w390-light-overflow-german-errors": 0,
  "w390-light-overflow-placed": 0,
  "dark-enabled-rest": {
    "color": "rgb(25, 23, 36)",
    "border": "rgb(156, 207, 216)",
    "background": "rgb(156, 207, 216)",
    "cursor": "pointer"
  },
  "dark-enabled-hover": {
    "color": "rgb(25, 23, 36)",
    "border": "oklab(0.834936 -0.0386028 -0.0269734)",
    "background": "oklab(0.834936 -0.0386028 -0.0269734)",
    "cursor": "pointer"
  },
  "dark-disabled-hover": {
    "color": "rgb(110, 106, 134)",
    "border": "rgb(110, 106, 134)",
    "background": "rgba(0, 0, 0, 0)",
    "cursor": "not-allowed"
  },
  "dark-disabled-rest": {
    "color": "rgb(110, 106, 134)",
    "border": "rgb(110, 106, 134)",
    "background": "rgba(0, 0, 0, 0)",
    "cursor": "not-allowed"
  },
  "light-enabled-rest": {
    "color": "rgb(250, 244, 237)",
    "border": "rgb(40, 105, 131)",
    "background": "rgb(40, 105, 131)",
    "cursor": "pointer"
  },
  "light-enabled-hover": {
    "color": "rgb(250, 244, 237)",
    "border": "oklab(0.486259 -0.0406089 -0.0575134)",
    "background": "oklab(0.486259 -0.0406089 -0.0575134)",
    "cursor": "pointer"
  },
  "light-disabled-hover": {
    "color": "rgb(121, 117, 147)",
    "border": "rgb(121, 117, 147)",
    "background": "rgba(0, 0, 0, 0)",
    "cursor": "not-allowed"
  },
  "light-disabled-rest": {
    "color": "rgb(121, 117, 147)",
    "border": "rgb(121, 117, 147)",
    "background": "rgba(0, 0, 0, 0)",
    "cursor": "not-allowed"
  },
  "blocked-highlighter-aborted-urls": [
    "http://localhost:4275/assets/highlight-DwL3HFnv.js"
  ],
  "blocked-highlighter-pageerrors": [],
  "blocked-highlighter-colors": [
    "rgb(224, 222, 244)"
  ],
  "forced-highlight": "rgba(5, 0, 73, 0.8)",
  "forced-english": "rgba(5, 0, 73, 0.8)",
  "forced-deutsch": "rgba(255, 255, 255, 0)",
  "forced-terms-unticked": "rgb(255, 255, 255)",
  "forced-terms-ticked": "rgba(5, 0, 73, 0.8)"
}
Evidence: Playwright e2e run (frame and checkout specs, desktop and mobile)

45 passed, 1 skipped (t-key test, skipped on mobile on purpose), EXIT=0

[WebServer] $ tsc -b && vite build
[WebServer] $ tsx server/index.ts dist

Running 46 tests using 4 workers

  ✓   3 [desktop] › e2e/checkout.spec.ts:144:1 › stops an invalid order in the browser, before it reaches the server (2.4s)
  ✓   2 [desktop] › e2e/checkout.spec.ts:81:1 › keeps the order button faint while it is sent, under the pointer too (2.8s)
  ✓   4 [desktop] › e2e/checkout.spec.ts:115:1 › shows the order as plain text when its highlighter does not load (2.9s)
  ✓   1 [desktop] › e2e/checkout.spec.ts:32:1 › places an order that the server validates and prices again (3.0s)
  ✓   8 [desktop] › e2e/checkout.spec.ts:314:1 › the server rejects invalid data sent straight to its API (737ms)
  ✓   5 [desktop] › e2e/checkout.spec.ts:183:1 › shows the fields a condition asks for, and drops what it hides (2.1s)
  ✓   6 [desktop] › e2e/checkout.spec.ts:210:1 › shows the server rejecting an order that got past the browser (2.0s)
  ✓   7 [desktop] › e2e/checkout.spec.ts:256:1 › speaks German in the browser and on the server, and keeps the input (1.9s)
  ✓   9 [desktop] › e2e/checkout.spec.ts:351:5 › on a 320 px screen, in the dark theme › fits the screen in English and in German, with its errors (2.2s)
  ✓  10 [desktop] › e2e/checkout.spec.ts:351:5 › on a 320 px screen, in the light theme › fits the screen in English and in German, with its errors (2.4s)
  ✓  12 [desktop] › e2e/checkout.spec.ts:351:5 › on a 390 px screen, in the light theme › fits the screen in English and in German, with its errors (2.1s)
  ✓  13 [desktop] › e2e/frame.spec.ts:29:3 › on a light system › switches the theme, and remembers it (1.1s)
  ✓  11 [desktop] › e2e/checkout.spec.ts:351:5 › on a 390 px screen, in the dark theme › fits the screen in English and in German, with its errors (2.4s)
  ✓  15 [desktop] › e2e/frame.spec.ts:85:3 › on a dark system › switches the theme with the t key while the keys are on (1.1s)
  ✓  14 [desktop] › e2e/frame.spec.ts:56:1 › switches the shortcut keys off and on, and remembers it (1.4s)
  ✓  18 [desktop] › e2e/frame.spec.ts:190:5 › in forced colors, on a light system › tells the pressed language and a ticked box from the others (1.3s)
  ✓  19 [desktop] › e2e/frame.spec.ts:220:5 › in forced colors, on a light system › shows the name of each language, pressed or not (1.8s)
  ✓  20 [desktop] › e2e/frame.spec.ts:238:5 › in forced colors, on a light system › rings the pressed language in focus as it rings the other (749ms)
  ✓  21 [desktop] › e2e/frame.spec.ts:190:5 › in forced colors, on a dark system › tells the pressed language and a ticked box from the others (1.2s)
  ✓  16 [desktop] › e2e/frame.spec.ts:125:5 › in the dark theme › keeps the status line whole on a narrow screen (4.9s)
  ✓  17 [desktop] › e2e/frame.spec.ts:125:5 › in the light theme › keeps the status line whole on a narrow screen (4.8s)
  ✓  22 [desktop] › e2e/frame.spec.ts:220:5 › in forced colors, on a dark system › shows the name of each language, pressed or not (1.9s)
  ✓  23 [desktop] › e2e/frame.spec.ts:238:5 › in forced colors, on a dark system › rings the pressed language in focus as it rings the other (855ms)
  ✓  27 [mobile] › e2e/checkout.spec.ts:144:1 › stops an invalid order in the browser, before it reaches the server (1.8s)
  ✓  25 [mobile] › e2e/checkout.spec.ts:81:1 › keeps the order button faint while it is sent, under the pointer too (2.7s)
  ✓  24 [mobile] › e2e/checkout.spec.ts:32:1 › places an order that the server validates and prices again (2.9s)
  ✓  26 [mobile] › e2e/checkout.spec.ts:115:1 › shows the order as plain text when its highlighter does not load (2.9s)
  ✓  31 [mobile] › e2e/checkout.spec.ts:314:1 › the server rejects invalid data sent straight to its API (560ms)
  ✓  29 [mobile] › e2e/checkout.spec.ts:210:1 › shows the server rejecting an order that got past the browser (1.8s)
  ✓  28 [mobile] › e2e/checkout.spec.ts:183:1 › shows the fields a condition asks for, and drops what it hides (2.0s)
  ✓  30 [mobile] › e2e/checkout.spec.ts:256:1 › speaks German in the browser and on the server, and keeps the input (2.0s)
  ✓  32 [mobile] › e2e/checkout.spec.ts:351:5 › on a 320 px screen, in the dark theme › fits the screen in English and in German, with its errors (2.3s)
  ✓  34 [mobile] › e2e/checkout.spec.ts:351:5 › on a 320 px screen, in the light theme › fits the screen in English and in German, with its errors (2.2s)
  ✓  33 [mobile] › e2e/checkout.spec.ts:351:5 › on a 390 px screen, in the dark theme › fits the screen in English and in German, with its errors (2.2s)
  ✓  35 [mobile] › e2e/checkout.spec.ts:351:5 › on a 390 px screen, in the light theme › fits the screen in English and in German, with its errors (1.9s)
  ✓  36 [mobile] › e2e/frame.spec.ts:29:3 › on a light system › switches the theme, and remembers it (1.1s)
  -  38 [mobile] › e2e/frame.spec.ts:85:3 › on a dark system › switches the theme with the t key while the keys are on
  ✓  37 [mobile] › e2e/frame.spec.ts:56:1 › switches the shortcut keys off and on, and remembers it (1.3s)
  ✓  41 [mobile] › e2e/frame.spec.ts:190:5 › in forced colors, on a light system › tells the pressed language and a ticked box from the others (794ms)
  ✓  43 [mobile] › e2e/frame.spec.ts:238:5 › in forced colors, on a light system › rings the pressed language in focus as it rings the other (652ms)
  ✓  44 [mobile] › e2e/frame.spec.ts:190:5 › in forced colors, on a dark system › tells the pressed language and a ticked box from the others (603ms)
  ✓  42 [mobile] › e2e/frame.spec.ts:220:5 › in forced colors, on a light system › shows the name of each language, pressed or not (1.9s)
  ✓  46 [mobile] › e2e/frame.spec.ts:238:5 › in forced colors, on a dark system › rings the pressed language in focus as it rings the other (667ms)
  ✓  39 [mobile] › e2e/frame.spec.ts:125:5 › in the dark theme › keeps the status line whole on a narrow screen (4.2s)
  ✓  40 [mobile] › e2e/frame.spec.ts:125:5 › in the light theme › keeps the status line whole on a narrow screen (4.0s)
  ✓  45 [mobile] › e2e/frame.spec.ts:220:5 › in forced colors, on a dark system › shows the name of each language, pressed or not (1.9s)

  1 skipped
  45 passed (30.6s)
EXIT=0
  • Outcome: 🔧 2 issues found → auto-fixed ✅ across 2 runs (14m40s)

Pipeline

Updates from git push no-mistakes

✅ **Intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

🔧 **Review** - 3 issues found → auto-fixed ✅
  • ⚠️ react-checkout/src/styles.css:660 - Disabled buttons still pick up their hover look. Both .button:disabled (lines 526-533, specificity 0,2,0) and the hover rules have the same specificity, and the hover rules come later in the file: .button:hover at line 648 and .button--primary:hover at line 660. Chromium matches :hover on disabled buttons, so the later hover rules win. How a user hits it: they click "Place order" with the mouse, and CheckoutForm.tsx:124 disables the button while the POST runs. The pointer is still over it, so .button--primary:hover brings back the interactive fill and border, while .button:disabled keeps the text at --ws-color-text-faint. The result is faint, low-contrast "Placing your order..." text on the interactive fill, which looks clickable but shows a not-allowed cursor, in both themes. This is a regression: the old stylesheet dimmed the whole button with opacity: 0.7. The Vue app has the same rule order, but nothing there is ever disabled, so it never showed. Fix: limit both hover rules to enabled buttons (.button:enabled:hover, .button--primary:enabled:hover), or move the :disabled block after the button hover rules. .input:hover (388) and .choice__input:hover (501) already come before the disabled rule, so they are fine.
  • ⚠️ react-checkout/e2e/frame.spec.ts:164 - The forced-colors test probably cannot catch the bug it is named for (likely, not certain: it depends on Chromium internals, and tests were not run in this review). It only checks that English's computed background differs from Deutsch's. Deutsch's background is none (transparent) and the pressed button's is opaque. Chromium's forced-colors mode keeps the alpha channel of background-color, so the two strings likely differ even without the .language__button[aria-pressed=&#39;true&#39;] { background: Highlight } rule at styles.css:821. The bug the test should catch: without that rule, the pressed language paints in Canvas, the same color as the page, so it looks no different from the other button, and the test still passes. A better oracle is the CSS system color Highlight (CSS Color 4). Resolve it with a probe element styled background: Highlight, then assert that English's background equals it and Deutsch's does not. Do the same for the ticked checkbox at lines 168-172 (ticked equals the Highlight probe, unticked does not), so both parts of the test fail if the forced-colors rules are removed.
  • ℹ️ react-checkout/src/ui/CodeBlock.tsx:16 - The lazy-loaded Shiki chunk has no failure handling. If import(&#39;./highlight&#39;) fails (for example a flaky network at page load), the module-level loading promise rejects with no handler. Each mounted CodeBlock then adds another unhandled rejection through void loading.then(...) at line 41. The order still shows in plain text, which is the intended fallback, but the console logs 'Uncaught (in promise)' errors and the fallback only works by accident. Fix: add .catch(() =&gt; undefined) to loading, and skip setHighlight when the result is undefined, so plain text is an explicit result. The split itself is justified: the restyle commit says it keeps every chunk under Vite's 500 kB warning.

🔧 Fix applied.
✅ Re-checked - no issues remain.

🔧 **Test** - 2 issues found → auto-fixed ✅
  • 🚨 react-checkout/src/styles.css:821 - In forced colors, the pressed language button's label can't be read. The forced-colors rule .choice__input:checked, .language__button[aria-pressed=&#39;true&#39;] { border-color: Highlight; color: HighlightText; background: Highlight } (added by commit 5809292) keeps forced-color-adjust: auto. Chromium therefore paints its Canvas-colored readability backplate behind the button's text. In the forced palettes, Canvas has the same color as HighlightText: light is Canvas rgb(255,255,255) and HighlightText rgb(255,255,255), dark is rgb(0,0,0) for both. So "English" (or "Deutsch" once pressed) is drawn as a blank plate on the Highlight fill, as seen in forced-colors-light-language-zoom.png and forced-colors-dark-language-zoom.png. A plain control button with the same colors shows the same thing. Before this change the app had no such rule, and the browser painted the label in ButtonText, which was readable. The e2e test 'tells the pressed language and a ticked box from the others' (e2e/frame.spec.ts:157) still passes because it only checks the button's background color, not the legibility of its text. The ticked checkbox is not affected because it has no text. Fix, verified by injecting it at runtime (forced-colors-*-language-with-candidate-fix.png): inside the @media (forced-colors: active) block, give .language__button[aria-pressed=&#39;true&#39;] the declaration forced-color-adjust: none (its colors are already system colors, so the user's palette still applies). A test that fails before the fix should also be added, for example one that checks the pressed button's label pixels differ from the backplate, or that the pressed button's computed forced-color-adjust is none. The Vue app likely has the same rule (this one was copied from it, per the commit message), but that app was not driven in this run.
  • 🚨 live validation verdict: no-go (10 of 10 scenarios were driven live against the product); failed: Adversarial (forced colors): the user can tell, and read, which language is pressed and whether the terms box is ticked in Windows-style forced colors
  • Live validation: ❌ no-go - 10 of 10 scenarios driven live against the product
Scenario Result Live Evidence
User opens the production checkout (local tsx server serving dist) in dark and light system themes and sees the design system's terminal frame: tab bar, window, status line, Rose Pine colors ✅ pass live desktop-dark-form.png, desktop-light-form.png; playwright-e2e.log
User places a valid order (2 mugs to Belgrade) and gets the confirmation with order.json highlighted by Shiki in the design system's code theme ✅ pass live desktop-light-placed.png, desktop-dark-placed.png, codeblock-highlighted.png; e2e 'places an order that the server validates and prices again' passed on desktop and mobile
User submits an empty form and sees the restyled field errors (red border, error icon and message) ✅ pass live desktop-dark-errors.png; e2e 'stops an invalid order in the browser' passed
User clicks the theme name in the status line, the theme flips and is kept after reload; t toggles it while the keys are on and is just a letter inside a field ✅ pass live desktop-switched-to-dark-after-reload.png; capture-log.json theme-after-click/after-reload = dark; e2e frame.spec 'switches the theme, and remembers it' and 'switches the theme with the t key' passed
User switches the shortcut keys off and on in the status line, and the choice is kept after reload ✅ pass live statusline-dark-keys-off.png; e2e 'switches the shortcut keys off and on, and remembers it' passed on desktop and mobile
On a 320 px and a 390 px phone, in both themes, the user fills the order, switches to German, gets server-side field errors and places the order without the page scrolling sideways ✅ pass live mobile-320/390-{dark,light}-{form,german-server-errors,placed}.png; capture-log.json overflow 0 at every step; e2e 'fits the screen in English and in German, with its errors' (4 variants x 2 projects)…
Adversarial: from 320 to 400 px in 2 px steps, with the keys on and off, the status line never cuts the mode, the keys switch or the theme name, and its path shows whole or not at all ✅ pass live e2e frame.spec 'keeps the status line whole on a narrow screen' (dark and light, desktop and mobile) passed; mobile-320-dark-form.png shows '~…'
Adversarial (review fix): after clicking 'Place order', the disabled 'Placing your order...' button under the pointer keeps its faint disabled look rather than the hover fill ✅ pass live button-{dark,light}-disabled-under-pointer.png vs -pointer-away.png (identical colors in capture-log.json); e2e 'keeps the order button faint while it is sent' passed; the same test failed on a build…
Adversarial (review fix): when the highlight-*.js chunk fails to load, the order shows as plain text with no uncaught errors ✅ pass live codeblock-highlighter-blocked-plain.png; capture-log.json blocked-highlighter-pageerrors = [] and a single text color; the e2e test passed, and failed with 'Failed to fetch dynamically imported module…
Adversarial (forced colors): the user can tell, and read, which language is pressed and whether the terms box is ticked in Windows-style forced colors ❌ fail live forced-colors-light-language-zoom.png, forced-colors-dark-language-zoom.png, forced-colors-top.png (pressed 'English' is a blank plate); forced-colors-*-language-with-candidate-fix.png (readable once…
  • pnpm exec playwright test e2e/frame.spec.ts e2e/checkout.spec.ts --reporter=list (webServer: pnpm build &amp;&amp; pnpm start on :4274, desktop + Pixel 7 projects): 35 passed, 1 skipped by design (t key on mobile)
  • PORT=4275 pnpm start (production tsx server/index.ts dist), driven by node capture.mjs (Playwright Chromium): desktop dark/light form, client errors, placed order with the Shiki-highlighted order.json; the status line theme switch and its persistence after reload; the keys switch; 320/390 px dark/light in English and German with server-side field errors, measuring sideways overflow; the disabled 'Placing your order...' button under and away from the pointer vs the enabled hover; the highlight-*.js chunk aborted; forced colors on the language switch and the terms checkbox
  • Mutation check: undid .button:enabled:hover→.button:hover, the forced-colors Highlight selectors and .catch(() =&gt; undefined) in CodeBlock, ran vite build --outDir /tmp/rc-mutant-01M7B8, served it on :4274 and ran playwright test --project=desktop -g &#34;faint while it is sent|plain text when its highlighter|tells the pressed language&#34;: all 3 failed as expected; sources restored with git checkout
  • node forced-colors-probe.mjs: forced colors (light and dark palettes) at DPR 3, zoomed shots of the language switch, the system color values, and a control bare button with background Highlight / color HighlightText
  • node forced-colors-fix-probe.mjs: the same forced-colors shots with forced-color-adjust: none injected at runtime on the pressed language button

🔧 Fix applied.
✅ Re-checked - no issues remain.

  • Live validation: ✅ go - 7 of 7 scenarios driven live against the product
Scenario Result Live Evidence
Desktop shopper in light and dark sees the checkout on the design system's terminal frame and places an order shown as highlighted JSON ✅ pass live round2/desktop-dark-form.png, desktop-light-placed.png, desktop--errors.png; capture-log.json placed--token-colors (5 Shiki token colors), desktop-*-errors []
Shopper switches the theme and the shortcut keys from the status line, and both are remembered after a reload ✅ pass live capture-log.json theme-after-click=dark, theme-after-reload=dark, keys-after-click=off; round2/desktop-switched-to-dark-after-reload.png, statusline-dark-keys-off.png
Shopper on 320 and 390 px screens in both themes switches to German, gets server-side errors, then places the order without any sideways scroll ✅ pass live capture-log.json w320/w390--overflow- all 0; round2/mobile-320-light-german-server-errors.png and the other mobile-*.png
Regression: shopper clicks 'Place order' and keeps the pointer on it; the disabled 'Placing your order...' button stays faint instead of showing the hover fill ✅ pass live capture-log.json light/dark-disabled-hover equals disabled-rest (transparent background, faint text, not-allowed cursor); round2/button-*-disabled-under-pointer.png; e2e 'keeps the order button faint…
Adversarial: the highlighter file fails to load; the placed order still shows as plain text with no page errors ✅ pass live capture-log.json blocked-highlighter-aborted-urls [highlight-*.js], blocked-highlighter-pageerrors [], one text color; round2/codeblock-highlighter-blocked-plain.png; e2e 'shows the order as plain tex…
Adversarial (round-1 failure): in forced colors on a light and a dark system, the shopper can read the pressed language and tell it and the ticked terms box from the others ✅ pass live round2/forced-colors-{light,dark}-language-{english,deutsch}-pressed.png, forced-colors-*-terms-ticked.png; forced-colors-log.json: pressed button background = Highlight and label pixel count 2143/210…
The app's e2e specs (frame and checkout) pass against a fresh production build on desktop and mobile Chromium ✅ pass live round2/playwright-e2e.log: 45 passed, 1 skipped on purpose (t-key test on mobile), EXIT=0
  • pnpm build (react-checkout production build)
  • PORT=4275 tsx server/index.ts dist (the app's own server, serving the build)
  • node round2/capture.mjs: desktop light/dark form, errors and placed order; theme and keys switches remembered after reload; 320/390 px in both themes with German server errors and sideways-overflow checks; disabled button under the pointer vs away; highlighter file blocked
  • node round2/forced-colors.mjs: forced colors on light and dark systems, each language pressed, terms box ticked, label pixel count, plus a runtime mutant without the pressed-button forced-color-adjust: none
  • playwright test e2e/frame.spec.ts e2e/checkout.spec.ts (desktop and mobile projects, fresh production build)
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

The design system comes from npm like any other package, and needs Node
22.18 or 24.12, so the app's engines follow it. Shiki highlights code in
the design system's code theme.
The page is the design system's window, as in the Vue app: a tab bar with
form-builder's mark, a link to its docs and the ghost, and a status line
with the mode, the theme switch and the switch for the shortcut keys. The
fields, buttons, groups, notices and code block are the Vue app's, ported
to React. Every color, font, size, space, radius and border comes from a
design system token, in both themes.

What the Vue app does not have: the checkout's sections are titled parts
of the page, side by side on a wide screen and one under the other on a
phone; the language switch is a pair of buttons that share an edge; the
order summary lists its amounts on the right; a server's rejection is a
message over the order button, in the voice of a field's error. The
loading line is StatusMessage now, as StatusLine is the window's.

On a 320 px screen the status line keeps the mode, the keys switch and the
theme's name whole, with the keys on or off: the path shrinks behind its
ellipsis and then goes. Shiki is loaded on its own, so the first render
does not wait for it and no chunk is over Vite's 500 kB warning.
The window, its bars and its code block hide what is wider than they are,
so the check for sideways overflow measures them too, not only the page:
without it, a row of the page that was wider than a phone passed. At 320
px the status line keeps its working items whole with the keys on and
off, and the theme and keys switches work and are remembered.
The path's box is a size container that takes the room the mode, the keys
switch and the theme's name leave. The path's text, with its fill and
padding, shrinks behind its ellipsis in it, and goes, padding and all, once
the box has no room for "~…" between the paddings: no glyph is cut through
at any width, and there is still no breakpoint but the design system's.

The end-to-end check sweeps 320 to 400 px in 2 px steps, in both themes
with the keys on and off, and fails on a path without the query.
The status line's path is the design system's again, in a box of the
app's own that takes the room left in the line and is a size container:
the path shrinks to its ellipsis in it, and is hidden as a whole once "~…"
and its padding no longer fit. It is the Vue app's rule, so both apps'
status lines behave the same, and the end-to-end check is the Vue app's
too: from 320 to 400 px, with the keys on and off, the path never shows a
cut glyph, never runs into the keys switch, and hides only when it must.

In forced colors the browser paints every background in the page's color,
so a checked box, the pressed language and the marks drawn as masks take
the system's colors instead. A new check fails when the pressed language
or a ticked box looks like the others there.
The React app is restyled too now, so it needs the design system's Node
22.18 or 24.12 like the Vue app.
@whatsaaaa
whatsaaaa merged commit acdb3fe into main Nov 13, 2026
2 checks passed
@whatsaaaa
whatsaaaa deleted the fm/sample-app-restyle-react branch November 13, 2026 20:59
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