Repository navigation
feat(vue-event-registration): restyle the app on the Whatsaaaa design system - #3
Merged
Merged
Conversation
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: 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. Every color, font, size, space, radius and border comes from a design system token, in both themes. The form controls are styled from the system's roles: field borders for outlines, the interactive color for focus, checked controls and the primary button, mono labels, sans values, hints under the fields and no placeholders, errors with an icon and a word. The submitted JSON is a code block highlighted in the system's code theme. The head scripts that apply a remembered theme and keys before the first paint come from the package.
The date picker's icon is drawn like the select's arrow: in the theme's secondary text color, on the same edge. A long line of the submitted JSON, such as a typed note, wraps inside the code block and hangs under its own text, instead of running out of the block on a phone.
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.
Intent
Restyle the sample apps on the Whatsaaaa design system, which was finished and released on npm as
@whatsaaaa/design-systemfor this purpose, so the apps install it 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'ssrc/uifolder andsrc/styles.cssso the look could be swapped later.This pull request restyles the Vue app,
vue-event-registration. The React app,react-checkout, follows in its own pull request with the same look.What Changed
@whatsaaaa/design-system0.1.0 from npm (plusshiki) and rewritessrc/styles.csson its tokens.PageShellnow uses the system's terminal frame, with a newTabBar(brand mark, docs link, ghost link) andStatusLine. The status line shows a NORMAL/INSERT mode, a theme switch (rose-pine / rose-pine-dawn, also on thetkey) and an on/off switch for the shortcut keys. A Vite plugin puts the design system's theme and keys init scripts in the<head>, so a saved choice applies before the first paint. The engines field now asks for Node^22.18.0 || >=24.12.0, the range the design system supports.registration.json) highlighted with Shiki in the design system's code theme, and long lines wrap inside the block. Select boxes get a wrapper that draws their arrow. Steps already passed show a tick plus a visually hidden "(done)" label. Text inputs and textareas no longer render placeholders. The page has a new title and favicon set (.ico,.svg, apple-touch icon).e2e/frame.spec.tscovering theme switching and memory, thetshortcut, turning the keys off and on, and the status line fitting a narrow screen in both themes.registration.spec.tsgains checks that each step fits a narrow screen (with its errors) in both themes. The README now says the Vue app takes its look from the design system, while the React app stays plain until its own restyle.🤖 Generated with Claude Code
Risk Assessment
✅ Low: The change is a contained restyle of the Vue app's src/ui folder and styles.css onto @whatsaaaa/design-system 0.1.0, installed from npm with a registry integrity hash. The only new commit since the last review (c0ad5b1) is test-only. It correctly adds the "hidden only when it must" assertion against an independent probe-measured "~…" width. No new defects turned up.
Testing
I built the Vue app for production, served it withvite preview, and ran its Playwright e2e specs twice: 25 passed, and 1 is skipped by design on mobile. I also drove the running app in Chromium with my own capture scripts and saved screenshots and measurements to the evidence directory. Everything I tested passed: - Full flow: a business registration with every step completed in both themes, and the submitted JSON is correct. - Errors: pressing Next on an empty step keeps the user on that step and shows styled errors. - Theme and keys: the theme and keys switches keep their choice after a reload. - Narrow screens: at 320 px and on a Pixel 7 in both themes, the page doesn't scroll sideways and the status line doesn't overflow. At 320 px the path gives way and the theme name shows whole. - Forced colors: the checked boxes and ticks, the done-step tick and the current-step chip stay visible. - Console: the browser console showed no errors. One early screenshot showed a checked box without its tick. That was the tick's short scale animation still running; once it finished, the tick shows (its scale is 1), as the settled screenshots show. I stopped the preview server and deleted thetest-resultsfolder that Playwright created in the worktree.pnpm buildsucceeded; pnpm-lock.yaml resolves @whatsaaaa/design-system@0.1.0 by registry integrity (no tarball or link); the remembered-theme reload in frame.spec.ts:88 proves themeInitScript runs f…Evidence: Playwright e2e run (registration + frame specs, desktop + Pixel 7)
25 passed, 1 skipped (t-key test is skipped on mobile by design), exit=0Evidence: Measurements: tokens, fonts, mark visibility, overflow, forced-colors backgrounds, console errors, submitted JSON
Pipeline
Updates from git push no-mistakes
✅ **Intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
vue-event-registration/e2e/registration.spec.ts:314- The new 390 px test 'fits the screen at every step, with its errors' (and every other expectNoSidewaysScroll call) can no longer fail. The helper at registration.spec.ts:19 only measures document.documentElement.scrollWidth - clientWidth, but this change wraps the page in the design system's.ws-term(PageShell.vue:15), which hasoverflow: hidden. On wide screens.page__mainis alsooverflow: auto(styles.css:57). Any content wider than the window is clipped inside.pageor scrolled inside.page__main. It never reaches the document's scrollable overflow, so the assertion is always true. Before this change.pagehad no overflow clipping, so the check was meaningful. Public behavior: the form fits a 390 px screen with nothing cut off. Oracle: the window's own width. A wrong behavior the current test accepts: a long unbroken value in a summary row (e.g. without.summary__value { overflow-wrap: anywhere }) or a too-wide row runs past the window's right edge and is silently clipped, and the test still passes. Affected calls: new test lines 326, 335, 346, 352, 361, 374, 382, and the older calls at 61, 76, 97, 107, 120, 163, 177, 239. Fix: in the helper, also check the frame's own scrollers. Take the max of scrollWidth - clientWidth over documentElement,.pageand.page__main; an overflow:hidden element still reports clipped content in its scrollWidth. Or assert that no element's right edge passes the.pagebox.vue-event-registration/src/styles.css:107- The tab bar mark is swapped per theme by app-written@media (prefers-color-scheme: light)/@media not (prefers-color-scheme: light)rules (styles.css:102-117, with two <img> elements in TabBar.vue:16-29 and two copied SVG files). These rules are a parallel copy of the design system's theme-visibility rule for.ws-status-line__item--dark/--light. They also go against the design system's usage doc (section 3, Theme): "Do not write your ownprefers-color-schemerules: the tokens already switch." They are correct today, but if the system's theme selection changes, this copy drifts on its own. It also doesn't followdata-themeset on an inner element, which the tokens support. Narrower alternative: the kit's mark-on-dark (#e0def4 / #eb6f92) and mark-on-light (#575279 / #b4637a) differ only in colors that equal--ws-color-textand--ws-color-brandin each theme. One inline mark whose two paths take those tokens (asghostSvgdoes for the ghost) would draw the same pixels with no media rules, one element and no asset files. Trade-off: it would not use the kit files as shipped, and the design system's asset table suggests those two files for headers. This is a design-system policy decision, and the React restyle will copy whatever is settled here: keep the copied rule (or move it into the design system), or switch to the token-colored inline mark.🔧 Fix applied.
2 warnings still open:
vue-event-registration/src/styles.css:107- The tab bar mark is swapped per theme by app-written@media (prefers-color-scheme: light)/@media not (prefers-color-scheme: light)rules (styles.css:102-117, with two <img> elements in TabBar.vue:16-29 and two copied SVG files). These rules are a parallel copy of the design system's theme-visibility rule for.ws-status-line__item--dark/--light. They also go against the design system's usage doc (section 3, Theme): "Do not write your ownprefers-color-schemerules: the tokens already switch." They are correct today, but if the system's theme selection changes, this copy drifts on its own. It also doesn't followdata-themeset on an inner element, which the tokens support. Narrower alternative: the kit's mark-on-dark (#e0def4 / #eb6f92) and mark-on-light (#575279 / #b4637a) differ only in colors that equal--ws-color-textand--ws-color-brandin each theme. One inline mark whose two paths take those tokens (asghostSvgdoes for the ghost) would draw the same pixels with no media rules, one element and no asset files. Trade-off: it would not use the kit files as shipped, and the design system's asset table suggests those two files for headers. This is a design-system policy decision, and the React restyle will copy whatever is settled here: keep the copied rule (or move it into the design system), or switch to the token-colored inline mark.vue-event-registration/src/styles.css:441- In forced-colors mode (Windows high contrast), the checked state of every checkbox and radio disappears. The base used native inputs withaccent-color, which draw correctly in forced colors. This change setsappearance: noneon.choice__inputand draws the tick and the dot as::beforewithbackground: var(--ws-color-on-interactive)plus a mask (styles.css:441-468), and the checked fill asbackground: var(--ws-color-interactive)(styles.css:461). Forced colors repaints both backgrounds in the page color (Canvas). Repro with Playwright on the built app (forcedColors: 'active'): after checking 'Hands-on forms workshop', computed::beforebackground is rgb(255,255,255) on a white page, and the screenshot shows the checked box the same as the empty ones, with only a faint border tint. A forced-colors user cannot see which ticket, sessions or code-of-conduct box is selected. The same mask-drawn invariant also breaks at: styles.css:267.steps__item--done .steps__number::before. StepIndicator.vue:31-33 already blanks the number, so a done step shows an empty circle with no number and no tick. styles.css:281.steps__item--current .steps__number: the chip fill is lost, so only font weight marks the current step. styles.css:381.select::after: the select arrow vanishes, and the select hasappearance: none, so it has no arrow at all. styles.css:352.input::-webkit-calendar-picker-indicator: the calendar icon vanishes. styles.css:323.field__error::beforeand styles.css:694/710.notice__title::before: the icons vanish but their text remains, so these are lower impact. Fix: add one@media (forced-colors: active)block to styles.css. Give.choice__input:checkedborder-color: Highlight; background: Highlight. Give.choice__input:checked::beforebackground: HighlightText. Give the done-step tick, select arrow, calendar indicator and error/notice iconsbackground: CanvasText. Give the current step chipborder-color: Highlight; background: Highlight; color: HighlightText. Verified in Chromium forced-colors emulation: these rules bring back the tick, the done-step tick and the calendar icon. The current-step number may needforced-color-adjust: noneto stay readable on the Highlight chip.🔧 Fix applied.
2 warnings still open:
vue-event-registration/src/styles.css:107- The tab bar mark is swapped per theme by app-written@media (prefers-color-scheme: light)/@media not (prefers-color-scheme: light)rules (styles.css:102-117, with two <img> elements in TabBar.vue:16-29 and two copied SVG files). These rules are a parallel copy of the design system's theme-visibility rule for.ws-status-line__item--dark/--light. They also go against the design system's usage doc (section 3, Theme): "Do not write your ownprefers-color-schemerules: the tokens already switch." They are correct today, but if the system's theme selection changes, this copy drifts on its own. It also doesn't followdata-themeset on an inner element, which the tokens support. Narrower alternative: the kit's mark-on-dark (#e0def4 / #eb6f92) and mark-on-light (#575279 / #b4637a) differ only in colors that equal--ws-color-textand--ws-color-brandin each theme. One inline mark whose two paths take those tokens (asghostSvgdoes for the ghost) would draw the same pixels with no media rules, one element and no asset files. Trade-off: it would not use the kit files as shipped, and the design system's asset table suggests those two files for headers. This is a design-system policy decision, and the React restyle will copy whatever is settled here: keep the copied rule (or move it into the design system), or switch to the token-colored inline mark.vue-event-registration/src/ui/StatusLine.vue:74- On screens narrower than about 336 px, the status line cuts off the theme switch, which is the only theme control a narrow screen shows. The DS.ws-status-lineisoverflow: hidden; white-space: nowrap. The app puts these items in it: mode (74 px),~/vue-event-registration(it shrinks, but its 28 px of padding stays), the keys switch (78 px) and the theme name (StatusLine.vue:64-79). I measured the production build in Chromium. At 320x700 in the light theme the status line's right edge is at 307 px, therose-pine-dawnbutton runs from 193 to 323 px, andscrollWidth - clientWidthis 16. The screenshot shows 'rose-pine-dawr' cut mid-letter, and the button's edge and the window's rounded corner are missing. In the dark theme at 320 px it fits with exactly 0 px to spare, so 'keys off' (one character wider than 'on') or any wider font also clips it. 320 CSS px is the WCAG 1.4.10 reflow width: a 1280 px window at 400% zoom, or a small phone. The tests miss it for two reasons. They only run at 390 and 412 px. And the helper that round 1 fixed (registration.spec.ts:23) checks only 'html', '.page' and '.page__main', so it never sees clipping inside the frame's ownoverflow: hiddenparts:.ws-status-linehere, and the.ws-codefigure on the done page. Round 1 left this case out. Suggested fix: on narrow screens, drop the decorative file path (.ws-status-line__file) or zero its padding, so the mode, keys switch and theme name always fit at 320 px. Then add '.ws-status-line' to the helper's selector list and run the narrow test at 320 px as well as 390. This is ask-user because the fix decides what the status line leaves out on small screens, which is a design call.🔧 Fix applied.
2 warnings still open:
vue-event-registration/src/styles.css:107- The tab bar mark is swapped per theme by app-written@media (prefers-color-scheme: light)/@media not (prefers-color-scheme: light)rules (styles.css:102-117, with two <img> elements in TabBar.vue:16-29 and two copied SVG files). These rules are a parallel copy of the design system's theme-visibility rule for.ws-status-line__item--dark/--light. They also go against the design system's usage doc (section 3, Theme): "Do not write your ownprefers-color-schemerules: the tokens already switch." They are correct today, but if the system's theme selection changes, this copy drifts on its own. It also doesn't followdata-themeset on an inner element, which the tokens support. Narrower alternative: the kit's mark-on-dark (#e0def4 / #eb6f92) and mark-on-light (#575279 / #b4637a) differ only in colors that equal--ws-color-textand--ws-color-brandin each theme. One inline mark whose two paths take those tokens (asghostSvgdoes for the ghost) would draw the same pixels with no media rules, one element and no asset files. Trade-off: it would not use the kit files as shipped, and the design system's asset table suggests those two files for headers. This is a design-system policy decision, and the React restyle will copy whatever is settled here: keep the copied rule (or move it into the design system), or switch to the token-colored inline mark.vue-event-registration/src/styles.css:136- This comes from the round-3 fix (27653b0). It removed the cut-off theme name, but the mid-glyph cut now appears in the status-line path at a band of widths just above 320 px. The inner span.ws-status-line__file > spangetsoverflow: hidden; text-overflow: ellipsisfrom the design system and now also carries both paddings.overflow: hiddenclips at the padding box, not the content box. So once the content box is narrower than "…", the text runs into the span's right padding, and the outer box's clip cuts it off right at the keys switch's border. I measured this in Chromium on the production build, light theme, keys off, against a status line with no overflow. At 332 px there is a sliver of "". At 338 px "/" is cut through the slash and touches the keys switch's border. At 344 px "…" touches the border with no end padding. From about 350 px "…" sits inside its padding as intended. With keys on, the light theme shows the same thing at about 322-343 px. The dark theme shows it only below 320 px (about 286-314 px). These widths happen in practice: a 1366 px window at 400% zoom is about 341 CSS px. This misses the round-3 decision that the path "shrinks with its ellipsis and, when there is no room left, collapses to nothing including its padding".…" fits. That is a width threshold, which the round-3 instructions steered away from (no new breakpoint).expectNoSidewaysScrollcannot see it, because the clipping is inside an intended overflow-hidden box. There are two ways to fix it, and picking one is a design call. (a) Move the span's end spacing to a margin (padding-inline: var(--ws-space-14) 0; margin-inline-end: var(--ws-space-14)), so the clip sits at the text's own edge and the gap before the switch stays. I tried this in Chromium: 326-338 px then show an empty raised box, but around 344 px a sliver narrower than one glyph still shows at the text edge, as any text-overflow clip does once the ellipsis no longer fits. (b) Hide the path with a container query on.ws-status-linebelow the width where "🔧 Fix applied.
2 issues (1 warning, 1 info) still open:
vue-event-registration/src/styles.css:107- The tab bar mark is swapped per theme by app-written@media (prefers-color-scheme: light)/@media not (prefers-color-scheme: light)rules (styles.css:102-117, with two <img> elements in TabBar.vue:16-29 and two copied SVG files). These rules are a parallel copy of the design system's theme-visibility rule for.ws-status-line__item--dark/--light. They also go against the design system's usage doc (section 3, Theme): "Do not write your ownprefers-color-schemerules: the tokens already switch." They are correct today, but if the system's theme selection changes, this copy drifts on its own. It also doesn't followdata-themeset on an inner element, which the tokens support. Narrower alternative: the kit's mark-on-dark (#e0def4 / #eb6f92) and mark-on-light (#575279 / #b4637a) differ only in colors that equal--ws-color-textand--ws-color-brandin each theme. One inline mark whose two paths take those tokens (asghostSvgdoes for the ghost) would draw the same pixels with no media rules, one element and no asset files. Trade-off: it would not use the kit files as shipped, and the design system's asset table suggests those two files for headers. This is a design-system policy decision, and the React restyle will copy whatever is settled here: keep the copied rule (or move it into the design system), or switch to the token-colored inline mark.vue-event-registration/e2e/frame.spec.ts:191- Round 4 (3faafe0) added the sweep test. Its last assertion,expect(shown).toBeGreaterThan(0), has the comment "The path gives way only when it must", but it does not check that. It only proves the path shows at one or more of the swept widths. Example: if the container-query threshold in styles.css:139 grew from2ch + 2 * 0.875rem(42.4 px) to10ch + 2 * 0.875rem(100 px), the dark theme at 400 px (container about 128 px) would still show the path. The test would pass even though the path now hides from roughly 350 px up to 410 px when "…" would fit. The other assertions in this test do use an independent oracle: the probe-measured "…" width at lines 36-41, which catches a cut glyph. The "only when it must" side has no such check. Suggested fix: inexpectStatusLineWhole, when.ws-status-line__fileis hidden, also measure the.status-line__pathwidth and the file's computed padding-left and padding-right (getComputedStyle still reports them under display:none). Then assert that the container width is less than the probe's "…" width plus both paddings. With that in place, the…". There is no overflow at 320 px or wider. Today's behavior is correct; only the test is weaker than its comment says.shown > 0check is only a guard against a test that checks nothing. For the record, I measured the current code live in Chromium (DPR 1 and 2.625, every 1 px from 300 to 420 px, both themes, keys on and off). It hides the path only when the container is under 42.4 px. When the path shows, its text box is at least the 14.406 px of "🔧 Fix applied.
1 warning still open:
vue-event-registration/src/styles.css:107- The tab bar mark is swapped per theme by app-written@media (prefers-color-scheme: light)/@media not (prefers-color-scheme: light)rules (styles.css:102-117, with two <img> elements in TabBar.vue:16-29 and two copied SVG files). These rules are a parallel copy of the design system's theme-visibility rule for.ws-status-line__item--dark/--light. They also go against the design system's usage doc (section 3, Theme): "Do not write your ownprefers-color-schemerules: the tokens already switch." They are correct today, but if the system's theme selection changes, this copy drifts on its own. It also doesn't followdata-themeset on an inner element, which the tokens support. Narrower alternative: the kit's mark-on-dark (#e0def4 / #eb6f92) and mark-on-light (#575279 / #b4637a) differ only in colors that equal--ws-color-textand--ws-color-brandin each theme. One inline mark whose two paths take those tokens (asghostSvgdoes for the ghost) would draw the same pixels with no media rules, one element and no asset files. Trade-off: it would not use the kit files as shipped, and the design system's asset table suggests those two files for headers. This is a design-system policy decision, and the React restyle will copy whatever is settled here: keep the copied rule (or move it into the design system), or switch to the token-colored inline mark.✅ **Test** - passed
✅ No issues found.
pnpm buildsucceeded; pnpm-lock.yaml resolves @whatsaaaa/design-system@0.1.0 by registry integrity (no tarball or link); the remembered-theme reload in frame.spec.ts:88 proves themeInitScript runs f…pnpm build(vue-tsc + vite production build against @whatsaaaa/design-system 0.1.0 from the npm registry, lockfile integrity sha512-ZqYSDs...)pnpm exec vite preview --port 4273 --strictPort(served the production build locally)pnpm exec playwright test --reporter=list(the app's e2e/registration.spec.ts + e2e/frame.spec.ts, desktop and Pixel 7 projects) - ran twice, 25 passed, 1 skipped by design (thetkey test is skipped on mobile)node capture.cjs- Playwright Chromium script: full business registration (all 6 views) in the dark and light themes with screenshots; Next on an empty step for the error state; theme switch and keys switch, each checked after a reload; 320 px and Pixel 7 in both themes; forced-colors probe of the checked tick, the done-step tick and the select arrow; browser console error capturenode capture-settled.cjs- screenshots after animations finish: the ticks once their scale transition ends, the step indicator with done steps, and the top of the done page with the highlighted registration.json code blocknode capture-forced.cjs- forced-colors (Chromium emulation) screenshots of the step indicator and checked boxes in both themesLooked through every screenshot by eye: Rose Pine tokens, Inter and JetBrains Mono fonts, tab bar mark and ghost, status line, error icons, and the code block's file header✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.