Skip to content

fix: adopt @whatsaaaa/design-system 0.6.1 and drop covered workarounds - #4

Merged
whatsaaaa merged 2 commits into
mainfrom
fm/ds-adopt-site
Nov 15, 2026
Merged

whatsaaaa merged 2 commits into
mainfrom
fm/ds-adopt-site

Conversation

@whatsaaaa

@whatsaaaa whatsaaaa commented Nov 15, 2026 •

Copy link
Copy Markdown
Owner

Intent

Context. whatsaaaa.github.io, the personal landing page, was built on @whatsaaaa/design-system 0.1.0, one of its first real consumers. Where the system lacked something, the site built a local workaround and recorded it. Those findings went back to the design system, which has since covered them: 0.5.0 and 0.6.0 added the theme and status line fixes and the missing pieces, and 0.6.1 (published 2026-11-15) the docs and small fixes.

Once the design system's docs-and-fixes change merged and the release carrying it was published, switch the website to that release and remove the workarounds the system now covers.

What Changed

  • Bumps @whatsaaaa/design-system from ^0.1.0 to ^0.6.1 in package.json and the lockfile, and moves the transitive postcss-selector-parser from the deprecated 7.2.0 to 7.2.1.
  • Swaps the site's workarounds for what the design system now provides. The status line's two per-theme buttons become a single ws-status-line__theme button that shows the name of the active theme. The path wrapper becomes ws-status-line__path, so the local container-query styles are gone. In Base.astro, the inline theme-color meta tags, their MutationObserver script and the focus-keeping toggle handler are removed, and themeInitScript now colors the browser's own bars. Theme switch clicks now call only toggleTheme().
  • Removes local CSS fixes that the system now covers: focus-ring offsets for tabs and status line keys, the prompt chevron alignment and the .ws-state dot baseline in Entry.astro. The Ghost component gets a compactPx prop, passed to ws-ghost as compact-px. The landing page uses compactPx={4} in place of its own sprite sizing for screens below 64rem. Its role line now uses the --ws-text-tagline and --ws-text-tagline-compact type tokens in place of hand-set font sizes.

🤖 Generated with Claude Code

Workarounds still needed

0.6.1 does not cover these, so the site keeps them:

  • Status line padding of 10 px below 64rem (now on the theme button too). The system pads every status line item 14 px at every width. Without the override the path loses about 32 px on a phone: at 390 px in the light theme, form-builder.md would be cut to about five characters. With it, every status line item is exactly as wide as on main.
  • The 16 px phone gutter. The usage guide still says nothing about a gutter, and the style guide's example still pads a pane 20 px below 64rem, while the tab bar's brand is padded 16 px. With 16 px the brand and the content start at the same pixel.
  • The cat ~/projects/<name>.md prompt on detail pages, not ws-crumb. 0.6.1 documents the crumb, but the guide does not require it, and switching would be a restyle.
  • The status line shows only the file name below 64rem. This is a content choice of the site; the system has no rule for it.
  • minimumReleaseAgeExclude: ['@whatsaaaa/design-system'] stays, because 0.6.1 was published on 2026-11-15.

Visible changes

Screenshots of the home page and /projects/form-builder/ on main and on this branch, in both themes, at 320, 390 and 1440 px, compared pixel by pixel:

  • Detail page: pixel-identical in all six.
  • Home page: the tagline now uses the system's tagline text style, as the 0.5.0 upgrade notes intend. Its line height is 1.5 instead of the body's 1.65, so the content under it in the left pane sits about 3 px higher, and the page is 5 px (320) and 2 px (390) shorter. Nothing else changed; the smaller whoami ghost from compact-px="4" is pixel-identical.
  • Focus states: a focused key hint's ring is 2 px narrower on each side, because the system pads hints 6 px where the site used 8 px (0.2.0 notes). Tab and key-hint rings are still drawn whole, inside their control.
  • Without JavaScript the page now has no theme-color tag (see below).

Design-system follow-ups

Gaps in the system, left as gaps rather than new local workarounds:

  • theme-color without JavaScript. Following 0.6.1 ("the head needs no tag of its own"), the served HTML has no theme-color tag; the head script adds it at runtime. Visitors with JavaScript off, and link unfurlers that read the raw HTML (such as Discord's embed stripe), get no theme color. The review gate accepted this as a gap of the design system.
  • Phone gutter. The style guide example pads a pane 20 px below 64rem, 4 px off the tab bar's brand at 16 px.
  • Phone status line padding. The system has no narrower padding for a phone, and the path's container query hard-codes the 14 px padding (2ch + 1.75rem).

Also in this PR: postcss-selector-parser, a dev dependency of eslint-plugin-astro, goes from 7.2.0 to 7.2.1 in the lockfile only. pnpm warned that 7.2.0 is deprecated.

Risk Assessment

✅ Low: A bounded dependency bump plus removal of local CSS/JS workarounds. Each removed one has an equivalent rule or behavior in the published 0.6.1 package: state baseline, prompt chevron, focus offsets for tabs and keys, status-line path container query, the single theme button with visually-hidden label, ghost compact-px, tagline tokens, and theme-color script. Lockfile integrity hashes match the registry.

Testing

I built and served the 0.6.1 site and the base commit (0.1.0 plus workarounds) side by side, then drove both in headless Chrome. All checks passed: the theme button (click, keyboard, keeping focus, accessible name, phone width, JavaScript off), the browser bar color following both hand-picked and system themes, the status line path at every width from 260 to 560px, focus rings, ghost size, prompt wrapping, and all 10 pages loading without errors. I compared each removed workaround against the base in target/base screenshots, then stopped the preview servers and deleted the temporary build folders.

  • Live validation: ✅ go - 9 of 9 scenarios driven live against the product
Scenario Result Live Evidence
The site builds and serves on design-system 0.6.1 (all 10 pages render with the new status line, path and one theme-color tag, and no console errors) ✅ pass live pnpm build built 10 pages; S7-all-pages in results.json (10 routes, no errors); s7-project-page-dark.png
The theme button switches the theme with keyboard (Tab, Enter, Space) and keeps the focus; its accessible name and visible name follow; the choice survives a reload; the t shortcut still works ✅ pass live S1-theme-button in results.json; s1-statusline-*-theme-btn-focused.png; s1-home-light-after-toggle.png
On a 375px phone, with the key hints hidden, the theme button stays fully inside the status line and a tap switches the theme ✅ pass live S1b-narrow-theme-button in results.json; s1b-375-statusline-dark.png, s1b-375-statusline-light.png, s1b-375-home-light.png
Browser bar color: the head script keeps one theme-color tag at the token background (#191724 / #faf4ed) for a hand-picked theme, for the system theme, and when the system theme changes, while a hand-… ✅ pass live S2-theme-color in results.json (13 checks against the token resolver's colors)
With JavaScript disabled, the theme button shows the name of the system theme (rose-pine on dark, rose-pine-dawn on light) and has the right accessible name ✅ pass live S3-no-js in results.json; s3-nojs-dark-statusline.png, s3-nojs-light-statusline.png
At narrow widths (260-560px sweep), the status line path shortens with an ellipsis and then hides whole, never showing part of a character, with no overflow and the theme button always inside, the sam… ✅ pass live S4-status-path and S4-rows-target/base in results.json; compare-s4-X-statusline-300.png, compare-s4-X-statusline-270.png
Keyboard focus rings on tabs, key hints, the keys switch and the theme button are drawn inside their bars and are not clipped ✅ pass live S5-focus-ring in results.json (offset -2px equals -width); compare-s5-X-focus-tab.png, compare-s5-X-focus-key.png, compare-s5-X-focus-theme.png
The large ghost uses compact-px=4 below 64rem (40x48 at 1023px and 375px, 60x72 at 1024px and wider), and the tab-bar ghost is unchanged ✅ pass live S6-ghost-compact and S6-sizes in results.json; compare-s6-X-who-375.png, compare-s6-X-who-1280.png
A prompt that wraps keeps its chevron on the first line, and Entry state dots stay aligned with their word, now from the design system's CSS instead of local rules ✅ pass live compare-s6-X-prompt-wrapped.png, compare-s6-X-entry-state.png (target and base look the same)
Evidence: Driver results (all checks, with measured values)
{
  "out": {
    "S1-theme-button": [
      "PASS initial (system dark) shows rose-pine only: {\"dataTheme\":null,\"stored\":null,\"darkNameVisible\":true,\"lightNameVisible\":false,\"focusedIsThemeBtn\":false,\"metas\":[\"#191724\"],\"bodyBg\":\"rgb(25, 23, 36)\"}",
      "PASS accessible name \"Switch theme, now rose-pine\"",
      "PASS theme button reachable by Tab (after 19 presses)",
      "PASS Enter switches to light and stores it: {\"dataTheme\":\"light\",\"stored\":\"light\",\"darkNameVisible\":false,\"lightNameVisible\":true,\"focusedIsThemeBtn\":true,\"metas\":[\"#faf4ed\"],\"bodyBg\":\"rgb(250, 244, 237)\"}",
      "PASS button now shows rose-pine-dawn only",
      "PASS focus stays on the theme button after switching",
      "PASS accessible name updates to \"Switch theme, now rose-pine-dawn\"",
      "PASS Space switches back to dark, focus kept: {\"dataTheme\":\"dark\",\"stored\":\"dark\",\"darkNameVisible\":true,\"lightNameVisible\":false,\"focusedIsThemeBtn\":true,\"metas\":[\"#191724\"],\"bodyBg\":\"rgb(25, 23, 36)\"}",
      "PASS \"t\" shortcut toggles theme and the button name follows: {\"dataTheme\":\"light\",\"stored\":\"light\",\"darkNameVisible\":false,\"lightNameVisible\":true,\"focusedIsThemeBtn\":false,\"metas\":[\"#faf4ed\"],\"bodyBg\":\"rgb(250, 244, 237)\"}",
      "PASS reload keeps the chosen light theme: {\"dataTheme\":\"light\",\"stored\":\"light\",\"darkNameVisible\":false,\"lightNameVisible\":true,\"focusedIsThemeBtn\":false,\"metas\":[\"#faf4ed\"],\"bodyBg\":\"rgb(250, 244, 237)\"}",
      "PASS no console/page errors: []"
    ],
    "S2-theme-color": [
      "PASS theme-color follows hand-picked light: #faf4ed",
      "PASS theme-color follows hand-picked dark: #191724",
      "PASS served HTML has no static theme-color tag (declined: accepted tradeoff)",
      "PASS system dark, no choice: one tag = #191724 (got #191724)",
      "PASS system dark: button shows that theme's name",
      "PASS system flips dark->light live: tag follows (got #faf4ed)",
      "PASS system flips dark->light live: button name follows",
      "PASS system light, no choice: one tag = #faf4ed (got #faf4ed)",
      "PASS system light: button shows that theme's name",
      "PASS system flips light->dark live: tag follows (got #191724)",
      "PASS system flips light->dark live: button name follows",
      "PASS stored light on dark system: tag = light (#faf4ed)",
      "PASS system change does not override hand-picked light (#faf4ed)"
    ],
    "S1b-narrow-theme-button": [
      "PASS key hints hidden at 375px",
      "PASS theme button fully inside the status line: {\"fRight\":362,\"bRight\":362,\"bLeft\":276.1875,\"fLeft\":13}",
      "PASS tap switches theme at 375px: {\"dataTheme\":\"light\",\"stored\":\"light\",\"darkNameVisible\":false,\"lightNameVisible\":true,\"focusedIsThemeBtn\":true,\"metas\":[\"#faf4ed\"],\"bodyBg\":\"rgb(250, 244, 237)\"}"
    ],
    "S3-no-js": [
      "PASS no-JS, system dark: button shows rose-pine only (dark=true, light=false)",
      "PASS no-JS, system dark: accessible name right",
      "PASS no-JS, system light: button shows rose-pine-dawn only (dark=false, light=true)",
      "PASS no-JS, system light: accessible name right"
    ],
    "S4-rows-target": [
      "260px shown=false ellipsis=false inner=0.0 ch=7.20 overflow=0 themeInside=true",
      "292px shown=true ellipsis=true inner=24.0 ch=7.20 overflow=0 themeInside=true",
      "384px shown=true ellipsis=false inner=115.0 ch=7.20 overflow=0 themeInside=true"
    ],
    "S4-rows-base": [
      "260px shown=false ellipsis=false inner=0.0 ch=7.20 overflow=0 themeInside=true",
      "292px shown=true ellipsis=true inner=24.0 ch=7.20 overflow=0 themeInside=true",
      "384px shown=true ellipsis=false inner=115.0 ch=7.20 overflow=0 themeInside=true"
    ],
    "S4-status-path": [
      "PASS sweep 260-560px: path ellipsizes then hides whole, no status line overflow, theme button always inside"
    ],
    "S5-target": [
      "tab: outline solid 2px offset -2px",
      "key: outline solid 2px offset -2px",
      "switch: outline solid 2px offset -2px",
      "theme: outline solid 2px offset -2px"
    ],
    "S5-focus-ring": [
      "PASS tab focus ring drawn inside (offset = -width): {\"k\":\"tab\",\"offset\":\"-2px\",\"style\":\"solid\",\"width\":\"2px\"}",
      "PASS key focus ring drawn inside (offset = -width): {\"k\":\"key\",\"offset\":\"-2px\",\"style\":\"solid\",\"width\":\"2px\"}",
      "PASS switch focus ring drawn inside (offset = -width): {\"k\":\"switch\",\"offset\":\"-2px\",\"style\":\"solid\",\"width\":\"2px\"}",
      "PASS theme focus ring drawn inside (offset = -width): {\"k\":\"theme\",\"offset\":\"-2px\",\"style\":\"solid\",\"width\":\"2px\"}"
    ],
    "S5-base": [
      "tab: outline solid 2px offset -2px",
      "key: outline solid 2px offset -2px",
      "switch: outline solid 2px offset -2px",
      "theme: outline solid 2px offset -2px"
    ],
    "S6-sizes": {
      "target@1280": {
        "big": "60x72",
        "small": "20x24",
        "role": "20px/30px w500 ls=normal Inter"
      },
      "target@1024": {
        "big": "60x72",
        "small": "20x24",
        "role": "20px/30px w500 ls=normal Inter"
      },
      "target@1023": {
        "big": "40x48",
        "small": "20x24",
        "role": "18px/27px w500 ls=normal Inter"
      },
      "target@375": {
        "big": "40x48",
        "small": "20x24",
        "role": "18px/27px w500 ls=normal Inter"
      },
      "base@1280": {
        "big": "60x72",
        "small": "20x24",
        "role": "20px/33px w500 ls=normal Inter"
      },
      "base@1024": {
        "big": "60x72",
        "small": "20x24",
        "role": "20px/33px w500 ls=normal Inter"
      },
      "base@1023": {
        "big": "40x48",
        "small": "20x24",
        "role": "18px/29.7px w500 ls=normal Inter"
      },
      "base@375": {
        "big": "40x48",
        "small": "20x24",
        "role": "18px/29.7px w500 ls=normal Inter"
      }
    },
    "S6-ghost-compact": [
      "PASS ghost is 6px/sprite-px (60x72) at >=64rem",
      "PASS ghost is 4px/sprite-px (40x48) below 64rem",
      "PASS tab-bar ghost unaffected (20x24)",
      "PASS ghost sizes match base workaround"
    ],
    "S6-prompt-lines-target": 2,
    "S6-prompt-lines-base": 2,
    "S7-all-pages": [
      "PASS /: status line with theme button + path and one theme-color tag",
      "PASS /projects/: status line with theme button + path and one theme-color tag",
      "PASS /ideas/: status line with theme button + path and one theme-color tag",
      "PASS /projects/design-system/: status line with theme button + path and one theme-color tag",
      "PASS /projects/form-builder/: status line with theme button + path and one theme-color tag",
      "PASS /projects/building-blocks/: status line with theme button + path and one theme-color tag",
      "PASS /projects/dotfiles/: status line with theme button + path and one theme-color tag",
      "PASS /ideas/react-component-library/: status line with theme button + path and one theme-color tag",
      "PASS /ideas/vue-component-library/: status line with theme button + path and one theme-color tag",
      "PASS /does-not-exist/: status line with theme button + path and one theme-color tag",
      "PASS no console/page errors across pages: []"
    ]
  },
  "fail": []
}
Evidence: Driver console output
{
  "S1-theme-button": [
    "PASS initial (system dark) shows rose-pine only: {\"dataTheme\":null,\"stored\":null,\"darkNameVisible\":true,\"lightNameVisible\":false,\"focusedIsThemeBtn\":false,\"metas\":[\"#191724\"],\"bodyBg\":\"rgb(25, 23, 36)\"}",
    "PASS accessible name \"Switch theme, now rose-pine\"",
    "PASS theme button reachable by Tab (after 19 presses)",
    "PASS Enter switches to light and stores it: {\"dataTheme\":\"light\",\"stored\":\"light\",\"darkNameVisible\":false,\"lightNameVisible\":true,\"focusedIsThemeBtn\":true,\"metas\":[\"#faf4ed\"],\"bodyBg\":\"rgb(250, 244, 237)\"}",
    "PASS button now shows rose-pine-dawn only",
    "PASS focus stays on the theme button after switching",
    "PASS accessible name updates to \"Switch theme, now rose-pine-dawn\"",
    "PASS Space switches back to dark, focus kept: {\"dataTheme\":\"dark\",\"stored\":\"dark\",\"darkNameVisible\":true,\"lightNameVisible\":false,\"focusedIsThemeBtn\":true,\"metas\":[\"#191724\"],\"bodyBg\":\"rgb(25, 23, 36)\"}",
    "PASS \"t\" shortcut toggles theme and the button name follows: {\"dataTheme\":\"light\",\"stored\":\"light\",\"darkNameVisible\":false,\"lightNameVisible\":true,\"focusedIsThemeBtn\":false,\"metas\":[\"#faf4ed\"],\"bodyBg\":\"rgb(250, 244, 237)\"}",
    "PASS reload keeps the chosen light theme: {\"dataTheme\":\"light\",\"stored\":\"light\",\"darkNameVisible\":false,\"lightNameVisible\":true,\"focusedIsThemeBtn\":false,\"metas\":[\"#faf4ed\"],\"bodyBg\":\"rgb(250, 244, 237)\"}",
    "PASS no console/page errors: []"
  ],
  "S2-theme-color": [
    "PASS theme-color follows hand-picked light: #faf4ed",
    "PASS theme-color follows hand-picked dark: #191724",
    "PASS served HTML has no static theme-color tag (declined: accepted tradeoff)",
    "PASS system dark, no choice: one tag = #191724 (got #191724)",
    "PASS system dark: button shows that theme's name",
    "PASS system flips dark->light live: tag follows (got #faf4ed)",
    "PASS system flips dark->light live: button name follows",
    "PASS system light, no choice: one tag = #faf4ed (got #faf4ed)",
    "PASS system light: button shows that theme's name",
    "PASS system flips light->dark live: tag follows (got #191724)",
    "PASS system flips light->dark live: button name follows",
    "PASS stored light on dark system: tag = light (#faf4ed)",
    "PASS system change does not override hand-picked light (#faf4ed)"
  ],
  "S1b-narrow-theme-button": [
    "PASS key hints hidden at 375px",
    "PASS theme button fully inside the status line: {\"fRight\":362,\"bRight\":362,\"bLeft\":276.1875,\"fLeft\":13}",
    "PASS tap switches theme at 375px: {\"dataTheme\":\"light\",\"stored\":\"light\",\"darkNameVisible\":false,\"lightNameVisible\":true,\"focusedIsThemeBtn\":true,\"metas\":[\"#faf4ed\"],\"bodyBg\":\"rgb(250, 244, 237)\"}"
  ],
  "S3-no-js": [
    "PASS no-JS, system dark: button shows rose-pine only (dark=true, light=false)",
    "PASS no-JS, system dark: accessible name right",
    "PASS no-JS, system light: button shows rose-pine-dawn only (dark=false, light=true)",
    "PASS no-JS, system light: accessible name right"
  ],
  "S4-rows-target": [
    "260px shown=false ellipsis=false inner=0.0 ch=7.20 overflow=0 themeInside=true",
    "292px shown=true ellipsis=true inner=24.0 ch=7.20 overflow=0 themeInside=true",
    "384px shown=true ellipsis=false inner=115.0 ch=7.20 overflow=0 themeInside=true"
  ],
  "S4-rows-base": [
    "260px shown=false ellipsis=false inner=0.0 ch=7.20 overflow=0 themeInside=true",
    "292px shown=true ellipsis=true inner=24.0 ch=7.20 overflow=0 themeInside=true",
    "384px shown=true ellipsis=false inner=115.0 ch=7.20 overflow=0 themeInside=true"
  ],
  "S4-status-path": [
    "PASS sweep 260-560px: path ellipsizes then hides whole, no status line overflow, theme button always inside"
  ],
  "S5-target": [
    "tab: outline solid 2px offset -2px",
    "key: outline solid 2px offset -2px",
    "switch: outline solid 2px offset -2px",
    "theme: outline solid 2px offset -2px"
  ],
  "S5-focus-ring": [
    "PASS tab focus ring drawn inside (offset = -width): {\"k\":\"tab\",\"offset\":\"-2px\",\"style\":\"solid\",\"width\":\"2px\"}",
    "PASS key focus ring drawn inside (offset = -width): {\"k\":\"key\",\"offset\":\"-2px\",\"style\":\"solid\",\"width\":\"2px\"}",
    "PASS switch focus ring drawn inside (offset = -width): {\"k\":\"switch\",\"offset\":\"-2px\",\"style\":\"solid\",\"width\":\"2px\"}",
    "PASS theme focus ring drawn inside (offset = -width): {\"k\":\"theme\",\"offset\":\"-2px\",\"style\":\"solid\",\"width\":\"2px\"}"
  ],
  "S5-base": [
    "tab: outline solid 2px offset -2px",
    "key: outline solid 2px offset -2px",
    "switch: outline solid 2px offset -2px",
    "theme: outline solid 2px offset -2px"
  ],
  "S6-sizes": {
    "target@1280": {
      "big": "60x72",
      "small": "20x24",
      "role": "20px/30px w500 ls=normal Inter"
    },
    "target@1024": {
      "big": "60x72",
      "small": "20x24",
      "role": "20px/30px w500 ls=normal Inter"
    },
    "target@1023": {
      "big": "40x48",
      "small": "20x24",
      "role": "18px/27px w500 ls=normal Inter"
    },
    "target@375": {
      "big": "40x48",
      "small": "20x24",
      "role": "18px/27px w500 ls=normal Inter"
    },
    "base@1280": {
      "big": "60x72",
      "small": "20x24",
      "role": "20px/33px w500 ls=normal Inter"
    },
    "base@1024": {
      "big": "60x72",
      "small": "20x24",
      "role": "20px/33px w500 ls=normal Inter"
    },
    "base@1023": {
      "big": "40x48",
      "small": "20x24",
      "role": "18px/29.7px w500 ls=normal Inter"
    },
    "base@375": {
      "big": "40x48",
      "small": "20x24",
      "role": "18px/29.7px w500 ls=normal Inter"
    }
  },
  "S6-ghost-compact": [
    "PASS ghost is 6px/sprite-px (60x72) at >=64rem",
    "PASS ghost is 4px/sprite-px (40x48) below 64rem",
    "PASS tab-bar ghost unaffected (20x24)",
    "PASS ghost sizes match base workaround"
  ],
  "S6-prompt-lines-target": 2,
  "S6-prompt-lines-base": 2,
  "S7-all-pages": [
    "PASS /: status line with theme button + path and one theme-color tag",
    "PASS /projects/: status line with theme button + path and one theme-color tag",
    "PASS /ideas/: status line with theme button + path and one theme-color tag",
    "PASS /projects/design-system/: status line with theme button + path and one theme-color tag",
    "PASS /projects/form-builder/: status line with theme button + path and one theme-color tag",
    "PASS /projects/building-blocks/: status line with theme button + path and one theme-color tag",
    "PASS /projects/dotfiles/: status line with theme button + path and one theme-color tag",
    "PASS /ideas/react-component-library/: status line with theme button + path and one theme-color tag",
    "PASS /ideas/vue-component-library/: status line with theme button + path and one theme-color tag",
    "PASS /does-not-exist/: status line with theme button + path and one theme-color tag",
    "PASS no console/page errors across pages: []"
  ]
}
FAILURES 0 []
Evidence: Playwright driver script
import { chromium } from 'playwright-core';
import fs from 'node:fs';

const exe =
  '~/Library/Caches/ms-playwright/chromium-1254/chrome-mac-x64/Google Chrome for Testing.app/Contents/MacOS/Google Chrome for Testing';
const EV = '~/.no-mistakes/evidence/01M7FBYE152059RBNF7DAE9B0Z';
const T = 'http://127.0.0.1:4401';
const B = 'http://127.0.0.1:4402';
// oracle: the token resolver's color.bg per theme (independent of the runtime CSS-var read)
const BG = { dark: '#191724', light: '#faf4ed' };

const out = {};
const fail = [];
const check = (scenario, cond, msg) => {
  (out[scenario] ??= []).push(`${cond ? 'PASS' : 'FAIL'} ${msg}`);
  if (!cond) fail.push(`${scenario}: ${msg}`);
};
const shot = (name) => `${EV}/${name}.png`;

const browser = await chromium.launch({ executablePath: exe, headless: true });
const ctx = (opts = {}) =>
  browser.newContext({ viewport: { width: 1280, height: 800 }, deviceScaleFactor: 2, colorScheme: 'dark', ...opts });

const themeState = (page) =>
  page.evaluate(() => {
    const btn = document.querySelector('.ws-status-line__theme');
    const vis = (el) => !!el && el.getClientRects().length > 0 && getComputedStyle(el).visibility !== 'hidden';
    const metas = [...document.querySelectorAll('meta[name="theme-color"]')].map((m) => m.content);
    return {
      dataTheme: document.documentElement.dataset.theme ?? null,
      stored: localStorage.getItem('ws-theme'),
      darkNameVisible: vis(btn?.querySelector('.ws-theme-dark')),
      lightNameVisible: vis(btn?.querySelector('.ws-theme-light')),
      focusedIsThemeBtn: document.activeElement === btn,
      metas,
      bodyBg: getComputedStyle(document.body).backgroundColor,
    };
  });
const accName = async (page, name) =>
  page.getByRole('button', { name, exact: true }).count();

// ---------- S1: theme button, keyboard, focus kept, accessible name ----------
{
  const c = await ctx();
  const page = await c.newPage();
  const errors = [];
  page.on('pageerror', (e) => errors.push(e.message));
  page.on('console', (m) => m.type() === 'error' && errors.push(m.text()));
  await page.goto(T + '/');
  await page.waitForLoadState('load');
  let s = await themeState(page);
  check('S1-theme-button', s.darkNameVisible && !s.lightNameVisible, `initial (system dark) shows rose-pine only: ${JSON.stringify(s)}`);
  check('S1-theme-button', (await accName(page, 'Switch theme, now rose-pine')) === 1, 'accessible name "Switch theme, now rose-pine"');
  // keyboard: tab until the theme button is focused
  let tabs = 0;
  for (; tabs < 60; tabs++) {
    await page.keyboard.press('Tab');
    if (await page.evaluate(() => document.activeElement?.classList.contains('ws-status-line__theme'))) break;
  }
  check('S1-theme-button', tabs < 60, `theme button reachable by Tab (after ${tabs + 1} presses)`);
  const footer = page.locator('footer.ws-status-line');
  await footer.screenshot({ path: shot('s1-statusline-dark-theme-btn-focused') });
  await page.keyboard.press('Enter');
  await page.waitForTimeout(150);
  s = await themeState(page);
  check('S1-theme-button', s.dataTheme === 'light' && s.stored === 'light', `Enter switches to light and stores it: ${JSON.stringify(s)}`);
  check('S1-theme-button', s.lightNameVisible && !s.darkNameVisible, 'button now shows rose-pine-dawn only');
  check('S1-theme-button', s.focusedIsThemeBtn, 'focus stays on the theme button after switching');
  check('S1-theme-button', (await accName(page, 'Switch theme, now rose-pine-dawn')) === 1, 'accessible name updates to "Switch theme, now rose-pine-dawn"');
  check('S2-theme-color', s.metas.length === 1 && s.metas[0].toLowerCase() === BG.light, `theme-color follows hand-picked light: ${s.metas}`);
  await footer.screenshot({ path: shot('s1-statusline-light-theme-btn-focused') });
  await page.screenshot({ path: shot('s1-home-light-after-toggle') });
  await page.keyboard.press('Space');
  await page.waitForTimeout(150);
  s = await themeState(page);
  check('S1-theme-button', s.dataTheme === 'dark' && s.darkNameVisible && s.focusedIsThemeBtn, `Space switches back to dark, focus kept: ${JSON.stringify(s)}`);
  check('S2-theme-color', s.metas.length === 1 && s.metas[0].toLowerCase() === BG.dark, `theme-color follows hand-picked dark: ${s.metas}`);
  // the "t" key hint still toggles too (shortcut keys)
  await page.locator('h1').click();
  await page.keyboard.press('t');
  await page.waitForTimeout(150);
  s = await themeState(page);
  check('S1-theme-button', s.dataTheme === 'light' && s.lightNameVisible, `"t" shortcut toggles theme and the button name follows: ${JSON.stringify(s)}`);
  await page.reload();
  await page.waitForLoadState('load');
  s = await themeState(page);
  check('S1-theme-button', s.dataTheme === 'light' && s.lightNameVisible && s.metas[0]?.toLowerCase() === BG.light, `reload keeps the chosen light theme: ${JSON.stringify(s)}`);
  check('S1-theme-button', errors.length === 0, `no console/page errors: ${JSON.stringify(errors)}`);
  await c.close();
}

// ---------- S1b: narrow screen, hints hidden, theme button is the switch ----------
{
  const c = await ctx({ viewport: { width: 375, height: 760 } });
  const page = await c.newPage();
  await page.goto(T + '/');
  await page.waitForLoadState('load');
  const keysVisible = await page.locator('.ws-status-line__keys').isVisible();
  const btn = page.locator('.ws-status-line__theme');
  const geo = await page.evaluate(() => {
    const f = document.querySelector('footer.ws-status-line').getBoundingClientRect();
    const b = document.querySelector('.ws-status-line__theme').getBoundingClientRect();
    return { fRight: f.right, bRight: b.right, bLeft: b.left, fLeft: f.left };
  });
  check('S1b-narrow-theme-button', !keysVisible, 'key hints hidden at 375px');
  check('S1b-narrow-theme-button', (await btn.isVisible()) && geo.bRight <= geo.fRight + 0.5 && geo.bLeft >= geo.fLeft, `theme button fully inside the status line: ${JSON.stringify(geo)}`);
  await page.locator('footer.ws-status-line').screenshot({ path: shot('s1b-375-statusline-dark') });
  await btn.click();
  await page.waitForTimeout(150);
  const s = await themeState(page);
  check('S1b-narrow-theme-button', s.dataTheme === 'light' && s.lightNameVisible && s.focusedIsThemeBtn && s.metas[0]?.toLowerCase() === BG.light, `tap switches theme at 375px: ${JSON.stringify(s)}`);
  await page.locator('footer.ws-status-line').screenshot({ path: shot('s1b-375-statusline-light') });
  await page.screenshot({ path: shot('s1b-375-home-light'), fullPage: true });
  await c.close();
}

// ---------- S2: theme-color without a hand-picked theme follows the system ----------
{
  const raw = await (await fetch(T + '/')).text();
  check('S2-theme-color', !/<meta[^>]+name="theme-color"/.test(raw), 'served HTML has no static theme-color tag (declined: accepted tradeoff)');
  for (const scheme of ['dark', 'light']) {
    const c = await ctx({ colorScheme: scheme });
    const page = await c.newPage();
    await page.goto(T + '/');
    await page.waitForLoadState('load');
    const s = await themeState(page);
    check('S2-theme-color', s.metas.length === 1 && s.metas[0].toLowerCase() === BG[scheme], `system ${scheme}, no choice: one tag = ${BG[scheme]} (got ${s.metas})`);
    check('S2-theme-color', scheme === 'dark' ? s.darkNameVisible && !s.lightNameVisible : s.lightNameVisible && !s.darkNameVisible, `system ${scheme}: button shows that theme's name`);
    // adversarial: the system theme changes while the page is open
    const other = scheme === 'dark' ? 'light' : 'dark';
    await page.emulateMedia({ colorScheme: other });
    await page.waitForTimeout(200);
    const s2 = await themeState(page);
    check('S2-theme-color', s2.metas[0]?.toLowerCase() === BG[other], `system flips ${scheme}->${other} live: tag follows (got ${s2.metas})`);
    check('S2-theme-color', other === 'dark' ? s2.darkNameVisible : s2.lightNameVisible, `system flips ${scheme}->${other} live: button name follows`);
    await c.close();
  }
  // adversarial: a hand-picked theme wins over the system
  const c = await ctx({ colorScheme: 'dark' });
  await c.addInitScript(() => localStorage.

... [3070 bytes truncated] ...

 [label, url] of [['target', T], ['base', B]]) {
    const c = await ctx({ viewport: { width: 1280, height: 700 }, deviceScaleFactor: 2 });
    const page = await c.newPage();
    await page.goto(url + '/projects/design-system/');
    await page.waitForLoadState('load');
    const rows = [];
    for (const w of widths) {
      await page.setViewportSize({ width: w, height: 700 });
      await page.waitForTimeout(30);
      const m = await measure(page);
      rows.push({ w, ...m });
      if (label === 'target') {
        // no partial character: either hidden whole, or room for at least one char and the ellipsis
        const ok = !m.fileShown || m.innerWidth >= Math.floor(2 * m.ch) - 1 || !m.ellipsized;
        if (!ok || m.overflow > 0 || !m.themeInside) check('S4-status-path', false, `${w}px: ${JSON.stringify(m)}`);
      }
    }
    for (const w of [1280, 800, 420, 340, 300, 270]) {
      await page.setViewportSize({ width: w, height: 700 });
      await page.waitForTimeout(50);
      await page.locator('footer.ws-status-line').screenshot({ path: shot(`s4-${label}-statusline-${w}`) });
    }
    out[`S4-rows-${label}`] = rows
      .filter((r, i, a) => i === 0 || r.fileShown !== a[i - 1].fileShown || r.ellipsized !== a[i - 1].ellipsized || r.overflow > 0 || !r.themeInside)
      .map((r) => `${r.w}px shown=${r.fileShown} ellipsis=${r.ellipsized} inner=${r.innerWidth.toFixed(1)} ch=${r.ch.toFixed(2)} overflow=${r.overflow} themeInside=${r.themeInside}`);
    await c.close();
  }
  if (!(out['S4-status-path'] ?? []).length) check('S4-status-path', true, 'sweep 260-560px: path ellipsizes then hides whole, no status line overflow, theme button always inside');
}

// ---------- S5: focus rings drawn inside the bars ----------
{
  for (const [label, url] of [['target', T], ['base', B]]) {
    const c = await ctx();
    const page = await c.newPage();
    await page.goto(url + '/');
    await page.waitForLoadState('load');
    const results = {};
    const targets = {
      tab: '.ws-tabs a',
      key: '.ws-status-line__keys :is(a,button)',
      switch: '.ws-status-line__switch',
      theme: label === 'target' ? '.ws-status-line__theme' : 'footer .theme',
    };
    for (let i = 0; i < 60; i++) {
      await page.keyboard.press('Tab');
      const hit = await page.evaluate((targets) => {
        const a = document.activeElement;
        for (const [k, sel] of Object.entries(targets)) {
          if (a?.matches(sel)) {
            const cs = getComputedStyle(a);
            return { k, offset: cs.outlineOffset, style: cs.outlineStyle, width: cs.outlineWidth };
          }
        }
        return null;
      }, targets);
      if (hit && !results[hit.k]) {
        results[hit.k] = hit;
        const box = await page.evaluate(() => {
          const r = document.activeElement.getBoundingClientRect();
          return { x: r.x, y: r.y, width: r.width, height: r.height };
        });
        const pad = 16;
        await page.screenshot({
          path: shot(`s5-${label}-focus-${hit.k}`),
          clip: { x: Math.max(0, box.x - pad), y: Math.max(0, box.y - pad), width: box.width + 2 * pad, height: box.height + 2 * pad },
        });
      }
    }
    out[`S5-${label}`] = Object.values(results).map((r) => `${r.k}: outline ${r.style} ${r.width} offset ${r.offset}`);
    if (label === 'target') {
      for (const k of ['tab', 'key', 'switch', 'theme']) {
        const r = results[k];
        check('S5-focus-ring', !!r && r.style !== 'none' && parseFloat(r.offset) === -parseFloat(r.width), `${k} focus ring drawn inside (offset = -width): ${JSON.stringify(r)}`);
      }
    }
    await c.close();
  }
}

// ---------- S6: ghost compact size, tagline, prompt wrap, state dot ----------
{
  const sizes = {};
  for (const [label, url] of [['target', T], ['base', B]]) {
    const c = await ctx({ deviceScaleFactor: 2 });
    const page = await c.newPage();
    await page.goto(url + '/');
    await page.waitForLoadState('load');
    for (const w of [1280, 1024, 1023, 375]) {
      await page.setViewportSize({ width: w, height: 800 });
      await page.waitForTimeout(50);
      const m = await page.evaluate(() => {
        const big = document.querySelector('.who ws-ghost .ws-ghost__sprite').getBoundingClientRect();
        const small = document.querySelector('.ws-tab-bar ws-ghost .ws-ghost__sprite')?.getBoundingClientRect();
        const role = getComputedStyle(document.querySelector('.role'));
        return {
          big: `${big.width}x${big.height}`,
          small: small ? `${small.width}x${small.height}` : null,
          role: `${role.fontSize}/${role.lineHeight} w${role.fontWeight} ls=${role.letterSpacing} ${role.fontFamily.split(',')[0]}`,
        };
      });
      sizes[`${label}@${w}`] = m;
      if (w === 1280 || w === 375) await page.locator('.who').screenshot({ path: shot(`s6-${label}-who-${w}`) });
    }
    await c.close();
  }
  out['S6-sizes'] = sizes;
  check('S6-ghost-compact', sizes['target@1280'].big === '60x72' && sizes['target@1024'].big === '60x72', 'ghost is 6px/sprite-px (60x72) at >=64rem');
  check('S6-ghost-compact', sizes['target@1023'].big === '40x48' && sizes['target@375'].big === '40x48', 'ghost is 4px/sprite-px (40x48) below 64rem');
  check('S6-ghost-compact', ['target@1280', 'target@375'].every((k) => sizes[k].small === '20x24'), 'tab-bar ghost unaffected (20x24)');
  check('S6-ghost-compact', sizes['base@375'].big === sizes['target@375'].big && sizes['base@1280'].big === sizes['target@1280'].big, 'ghost sizes match base workaround');

  // prompt that wraps keeps its chevron on the first line; state dot centered
  for (const [label, url] of [['target', T], ['base', B]]) {
    const c = await ctx({ viewport: { width: 375, height: 800 }, deviceScaleFactor: 3 });
    const page = await c.newPage();
    await page.goto(url + '/');
    await page.waitForLoadState('load');
    // fixture text in the test browser only: make a real prompt heading wrap over 3 lines
    await page.evaluate(() => {
      document.querySelector('#projects').textContent = 'ls ~/projects --long --all --sort=time --reverse --color=never';
    });
    const lines = await page.evaluate(() => {
      const h = document.querySelector('#projects');
      const lh = parseFloat(getComputedStyle(h).lineHeight);
      return Math.round(h.getBoundingClientRect().height / lh);
    });
    out[`S6-prompt-lines-${label}`] = lines;
    await page.locator('#projects').screenshot({ path: shot(`s6-${label}-prompt-wrapped`) });
    const meta = page.locator('.meta:has(.ws-state)').first();
    if (await meta.count()) await meta.screenshot({ path: shot(`s6-${label}-entry-state`) });
    await c.close();
  }
}

// ---------- S7: every page renders without errors, frame + status line present ----------
{
  const routes = ['/', '/projects/', '/ideas/', '/projects/design-system/', '/projects/form-builder/', '/projects/building-blocks/', '/projects/dotfiles/', '/ideas/react-component-library/', '/ideas/vue-component-library/', '/does-not-exist/'];
  const c = await ctx();
  const page = await c.newPage();
  const errors = [];
  page.on('pageerror', (e) => errors.push(e.message));
  page.on('console', (m) => m.type() === 'error' && !/404/.test(m.text()) && errors.push(m.text()));
  for (const r of routes) {
    await page.goto(T + r);
    await page.waitForLoadState('load');
    const ok = await page.evaluate(() => !!document.querySelector('.ws-status-line__theme') && document.querySelectorAll('meta[name="theme-color"]').length === 1 && document.querySelector('.ws-status-line__path') !== null);
    check('S7-all-pages', ok, `${r}: status line with theme button + path and one theme-color tag`);
  }
  check('S7-all-pages', errors.length === 0, `no console/page errors across pages: ${JSON.stringify(errors)}`);
  await page.goto(T + '/projects/design-system/');
  await page.screenshot({ path: shot('s7-project-page-dark') });
  await c.close();
}

await browser.close();
fs.writeFileSync(`${EV}/results.json`, JSON.stringify({ out, fail }, null, 2));
console.log(JSON.stringify(out, null, 2));
console.log('FAILURES', fail.length, fail);
process.exit(fail.length ? 1 : 0);

Home in light theme after switching with the theme button (focus ring kept on it)

Status line with focused theme button, dark

Status line with focused theme button after switching, light

375px status line after tapping the theme button (light)

375px full home page in light theme

JavaScript off, light system: theme button reads rose-pine-dawn

JavaScript off, dark system: theme button reads rose-pine

Status line path at 300px, target vs base (ellipsis)

Status line path at 270px, target vs base (path hidden whole)

Status line at 1280px, target vs base

Focus ring on a tab, target vs base

Focus ring on a key hint, target vs base

Focus ring on the theme button in the window corner, target vs base

Wrapped prompt chevron on the first line, target vs base

Entry state dot alignment, target vs base

Ghost (compact-px=4) and tagline at 375px, target vs base

Ghost and tagline at 1280px, target vs base

Pipeline

Updates from git push no-mistakes

✅ **Intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

⚠️ **Review** - 1 info
  • ℹ️ src/layouts/Base.astro:43 - The served HTML no longer has a &lt;meta name=&#34;theme-color&#34;&gt;. The base version rendered two static tags, one per theme, with media queries and hex colors from the tokens resolver. Now the design system's head script creates the tag at runtime, on the first animation frame (dist/theme/color.js). For JS-enabled browsers this is covered: the tag is set before first paint and follows data-theme, the class, and system changes, which is the reason for the removal. Two consumers that don't run the script lose the color: visitors with JS disabled, and link unfurlers that read theme-color from the raw HTML (Discord, for example, uses it for the embed's side stripe). This follows the 0.6.1 usage docs ("the head needs no tag of its own and no color in it"), so it is a deliberate tradeoff. The only remedy would be keeping static tags with resolver-derived colors, which brings back part of the removed workaround. Confirm whether losing the no-JS/unfurl color is acceptable.
✅ **Test** - passed

✅ No issues found.

  • Live validation: ✅ go - 9 of 9 scenarios driven live against the product
Scenario Result Live Evidence
The site builds and serves on design-system 0.6.1 (all 10 pages render with the new status line, path and one theme-color tag, and no console errors) ✅ pass live pnpm build built 10 pages; S7-all-pages in results.json (10 routes, no errors); s7-project-page-dark.png
The theme button switches the theme with keyboard (Tab, Enter, Space) and keeps the focus; its accessible name and visible name follow; the choice survives a reload; the t shortcut still works ✅ pass live S1-theme-button in results.json; s1-statusline-*-theme-btn-focused.png; s1-home-light-after-toggle.png
On a 375px phone, with the key hints hidden, the theme button stays fully inside the status line and a tap switches the theme ✅ pass live S1b-narrow-theme-button in results.json; s1b-375-statusline-dark.png, s1b-375-statusline-light.png, s1b-375-home-light.png
Browser bar color: the head script keeps one theme-color tag at the token background (#191724 / #faf4ed) for a hand-picked theme, for the system theme, and when the system theme changes, while a hand-… ✅ pass live S2-theme-color in results.json (13 checks against the token resolver's colors)
With JavaScript disabled, the theme button shows the name of the system theme (rose-pine on dark, rose-pine-dawn on light) and has the right accessible name ✅ pass live S3-no-js in results.json; s3-nojs-dark-statusline.png, s3-nojs-light-statusline.png
At narrow widths (260-560px sweep), the status line path shortens with an ellipsis and then hides whole, never showing part of a character, with no overflow and the theme button always inside, the sam… ✅ pass live S4-status-path and S4-rows-target/base in results.json; compare-s4-X-statusline-300.png, compare-s4-X-statusline-270.png
Keyboard focus rings on tabs, key hints, the keys switch and the theme button are drawn inside their bars and are not clipped ✅ pass live S5-focus-ring in results.json (offset -2px equals -width); compare-s5-X-focus-tab.png, compare-s5-X-focus-key.png, compare-s5-X-focus-theme.png
The large ghost uses compact-px=4 below 64rem (40x48 at 1023px and 375px, 60x72 at 1024px and wider), and the tab-bar ghost is unchanged ✅ pass live S6-ghost-compact and S6-sizes in results.json; compare-s6-X-who-375.png, compare-s6-X-who-1280.png
A prompt that wraps keeps its chevron on the first line, and Entry state dots stay aligned with their word, now from the design system's CSS instead of local rules ✅ pass live compare-s6-X-prompt-wrapped.png, compare-s6-X-entry-state.png (target and base look the same)
  • pnpm install --frozen-lockfile (resolves @whatsaaaa/design-system 0.6.1) and pnpm build: 10 pages built
  • Base commit 5ee1238 rebuilt in a temporary folder (git archive + pnpm install --frozen-lockfile + pnpm build, exit 0) for a side-by-side comparison
  • astro preview on 127.0.0.1:4401 (target) and 127.0.0.1:4402 (base)
  • node drive.mjs (Playwright + Chrome for Testing 1254): 12 checks across 8 scenario groups, 0 failures, exit 0
  • Theme button: Tab to it, Enter, Space, the t shortcut, a reload, and a tap at 375px, checking data-theme, localStorage, which name shows, where the focus is, and the accessible name
  • theme-color: no static tag in the served HTML; system dark and light with no choice; the system theme changing while the page is open; a stored light theme on a dark system resisting a system change
  • JavaScript disabled with dark and light system themes: the theme button shows the right name
  • Status line path sweep from 260 to 560px in 4px steps on target and base: ellipsis, hiding whole, overflow, and the theme button staying inside
  • Focus rings via Tab on a tab, a key hint, the keys switch and the theme button: outline-offset equals the negative outline width, with crops from target and base
  • Ghost sprite size at 1280, 1024, 1023 and 375px; tagline computed font on target and base
  • Wrapped prompt (long text injected in the test browser) and Entry state dot: target vs base screenshots
  • All 10 routes: status line, theme button, path and a single theme-color tag present, no console or page errors
  • node montage.mjs: combined target and base screenshots into the compare-*.png images
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

@whatsaaaa
whatsaaaa merged commit 8784875 into main Nov 15, 2026
1 check passed
@whatsaaaa
whatsaaaa deleted the fm/ds-adopt-site branch November 15, 2026 11:08
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