Repository navigation
feat(redesign): prototype parity — reference shots, tokens, and screen primitives - #621
Conversation
…rity plan Applies the SCF prototype (~/Development/SCF-Prototype) to the app. This is Phase 0 + Phase 1 of docs/plans/redesign/2026-08-19-prototype-parity-plan.md. PHASE 0 — the reference. 58 screenshots of the prototype, 29 screens across five roles at desktop 1440x900 and mobile 390x844, captured by driving the prototype's own state (capture-prototype.mjs re-runs it when the prototype moves). The plan doc records what the prototype decides that we have not, and measures the audit's findings against our code: 699 literal fontSize sites across 15 values, ~350 literal borderRadius across a dozen, 392 raw hex across 57 files, three separate page-header components. PHASE 1 — tokens, in the @scaffald/ui submodule (see its own commit). Teal stays the one primary; amber becomes the reserved attention role. App-side changes here: - global.css declares 'Scaffald Display' for headings, with a Georgia fallback so the serif intent survives until the Cormorant WOFF2 lands. The family name is indirect so swapping the display face later is a change to two rules rather than to every component. - login-screen.tsx: the title hard-coded `fontFamily: 'RobotoSerif_400Regular'` in an inline style, which overrode getFontFamily entirely and pinned the screen to the body serif — the token system could never reach it. Removed. It was also an H5 used as a card title; H5 is now the body-size step, so this is an H4, which preserves the shipped 17px exactly. Verified: typecheck clean across @scaffald/ui, scf-core and scaffald-app; UI suite 634/655, identical to the pre-change baseline; auth feature tests 44/46 with 0 failures; lint clean; computed styles and both themes confirmed in the browser on a cold Metro cache. Not included: the Cormorant Garamond WOFF2 files (downloading them needs sign-off), and the prototype push to Scaffald/Prototype@main. Co-Authored-By: Claude Opus 5 <[email protected]>
Completes Phase 1. Headings now render in the prototype's actual face on web
rather than falling back to Georgia.
Cormorant Garamond is a variable font, so one 37 KB WOFF2 covers the whole
weight axis — Google serves the same file for its 400 and 600 faces, which is
why this is one file and not the two the plan assumed.
The fallback moved to its own family name ('Scaffald Display Fallback') and
into the stack that getFontFamily emits. Declared as a second @font-face under
the same family it shadowed the real font entirely: the browser matched it and
never requested the WOFF2, so headings rendered as Georgia while still looking
serif in a screenshot. It keeps `size-adjust: 92%` to stop headings jumping
size during the swap.
Native is unchanged and still on Roboto — see getFontFamily for why.
Verified: font served 200 (37776 bytes), document.fonts.check true, and
Cormorant measures 119.9px against the fallback's 125.23px for the same
string, confirming the real face is what loaded. Typecheck clean across all
three packages; UI suite 634/655, identical to baseline.
Co-Authored-By: Claude Opus 5 <[email protected]>
…tions
Picks up the four screen primitives from the @scaffald/ui submodule (see its
own commit) and proves them on one screen.
MIGRATED — the ATS applications screen now uses ScreenHeader + ListToolbar.
It gains the kicker and the tip the prototype gives it, a collapse caret, and
moves its count out of an ad-hoc subtitle ("14 total applications") into the
toolbar's result slot, which owns the one "{n} {noun}" template. This is the
only screen migrated so far — the plan warns that a mechanical sweep produces
a diff nobody can review, so the rest go per-screen in phase 3.
DELETED — features/office/components/OfficePageHeader.tsx, which had zero
callers. SaaSSectionHeader is also unused by the app but stays: it is a
published export of the component library with stories and a docs page, so
removing it is an API decision rather than dead-code cleanup.
TWO CORRECTIONS to the plan, both from checking rather than assuming:
1. The prototype push is unnecessary. github.md's sync note claims
Scaffald/Prototype@main still holds the 13 Aug build against 677 KB
locally, and I repeated that as the one item with a real bus factor. After
a fetch, local main and origin/main are the same commit and the file is
772,808 bytes on both. The note is stale; the reference was never
laptop-only.
2. "Three competing page headers" overstated it. Two of the three are dead,
and the third is a toolbar, not a header. Recorded in the ui commit.
Verified: typecheck clean across all three packages; lint clean; UI suite 670
tests / 649 passing / the same 21 pre-existing environment failures.
NOT verified: the migrated ATS screen has not been seen rendering. It sits
behind auth and the office role, and reaching it means authenticating — which
I do not do. The dev server is up on :8087 if you want to look.
Co-Authored-By: Claude Opus 5 <[email protected]>
Phase 3, screen 1 of the prototype-parity plan (#622). Closes five items from §12 of the ATS design brief in one screen. LANES — the pipeline as stage-grouped, full-width rows, now the default view with Board and Metrics alongside. Seven columns already overflow a laptop and the recruiter and NationSearch flows have eleven and twelve, so the board's answer to "more stages" is sideways scrolling that hides work. Rows also have room for the columns a card cannot carry. This answers open question #1 in the ATS brief. DAYS IN STAGE (§12 #7) — the board showed days since *applied*, which is a different and much less useful number: a candidate who applied 30 days ago and moved to Interview yesterday is not stale, and one who applied 8 days ago and has sat untouched in New is. `stage-timing.ts` derives the real figure from `stageHistory` — the transitions recorded in core.application_activity — by taking the most recent entry into the current status, so a candidate moved backwards gets a fresh clock. No history means the candidate has never moved, and their clock starts at appliedAt, which is correct rather than a fallback: entering the pipeline IS their entry into `new`. It returns null rather than 0 when timestamps do not parse, and clamps future timestamps to now — local Supabase has been observed running behind the host clock, which would otherwise render as "-2d in stage". Overdue is per-stage against the promises the public transparency stats are computed from, and every overdue row carries a reason ("Overdue — screening decision"), because an amber number alone says something is wrong without saying what. Terminal stages are never overdue: nobody is waiting on a hired candidate. ALSO CLOSED §12 #8 score, source, union status and assignee are on every row — these are the reasons an employer picks one candidate over another and none of them were on a card §12 #9 each stage gets its own empty state saying what would fill it, instead of "No applications" seven times §12 #17 Withdrawn reads as "Withdrawn by candidate" rather than a grey pill in a red column — the conflation the data model works to prevent §12 #6 the Interview column was error[50], the same red as rejected, so advancing a candidate moved them into a column that reads as a warning. It is a progress stage and now tints with the primary ramp Rows sort stalest-first within each stage, so the row that most needs acting on is the one at the top. TEST SEAM — scf-core resolves @scaffald/ui to a mock, so the four new primitives are added there. They mirror the real contracts rather than being stubbed: LaneGroup honours count/emptyState and Lane renders age first, since a stub that dropped those would make the screen logic under test unobservable. The change is additive — 171 insertions, zero deletions — so no existing consumer is affected. Verified: typecheck clean on scf-core and scaffald-app; lint clean; 17 new stage-timing tests and 11 new Lanes tests, all passing; an existing mock consumer (TeamMembersList) still passes. Not verified: the screen has not been seen rendering — it is behind auth and the office role. Note also that the full scf-core suite cannot be run locally: an unfiltered vitest run OOMs the worker, which is why prepush excludes it. Co-Authored-By: Claude Opus 5 <[email protected]>
|
Phase 3, screen 1 pushed — the employer pipeline. Closes five §12 items from #539 in one screen.
Also answers open question #1 (board width): stage lanes as full-width rows, now the default view, with Board and Metrics alongside. Seven columns already overflow a laptop; recruiter has eleven, NationSearch twelve. On the days-in-stage clockWorth calling out because it is the one that carries real logic. It takes the most recent entry into the current status, so a candidate moved backwards gets a fresh clock. No history means they have never moved, and the clock starts at Two guards, both from things this repo has actually hit:
Overdue is per-stage against the promises the public transparency stats are computed from, and every overdue row carries a reason ("Overdue — screening decision") rather than just an amber number. Terminal stages are never overdue — nobody is waiting on a hired candidate. VerificationTypecheck and lint clean; 28 new tests (17 stage-timing, 11 Lanes), all passing; an existing mock consumer still passes. Two things I could not verify, both pre-existing:
|
Picks up the layout fixes from the @scaffald/ui submodule and fixes the same inversion on the app side. The view switch gave the ACTIVE view `variant="outline"` and left the other two on the default filled variant — so Board and Metrics rendered as the primary action while the view you were actually on looked disabled. It reads as a segmented control now, which is what the prototype uses and what the control is for. It carries an explicit width: SegmentedControl's segments are `flex: 1` inside a container with no intrinsic width, so left to the header row it collapsed to 160px and clipped "Metrics" to "Metr…". Worth fixing centrally later — noted rather than done here, because the component has other callers and there is currently no automated gate that would catch a regression in them (#375, #469). Found by rendering the primitives in Storybook, which needs no auth and so is the first look any of this work has had at a real browser. Verified: typecheck clean across all three packages; lint clean; Lanes tests 11/11; UI suite 649/670 with the same 21 pre-existing failures. Co-Authored-By: Claude Opus 5 <[email protected]>
The branch pointer would have referenced a commit that only exists on redesign/phase1-tokens; the squash merge rewrote it. This points at 8b27d54 on origin/main so a fresh clone can resolve the submodule. Typecheck clean across all three packages against the merged pointer. Co-Authored-By: Claude Opus 5 <[email protected]>
The app drew a stat four ways: the CCPA dashboard's local `MetricCard` (seven bordered, tinted boxes), analytics' `KpiCard` (a bordered card with a 12px label and a 28px figure), VisibilityScreen's three more cards, and the shared `MetricBlock`/`MetricRow` that #621 added and almost nothing used. The prototype's audit named it twice — "metric labels change position" and "four ways to draw a stat block". The rule, from #817: a hairline band for a page's own metrics, a card grid only for the public transparency pages, and the tinted callout reserved for "the other side sees this". These three surfaces are a page's own metrics, so they become bands. - `office-ccpa-dashboard`: the local `MetricCard` is deleted and its seven call sites become one `MetricRow`. Tone is now stated rather than inferred from a colour prop — a rising overdue count is not good news, and `MetricCard` had each caller pick a hex for that itself. - `analytics/KpiCard`: rebuilt on `MetricBlock`. The sparkline survives as an adornment in the delta line rather than a second column, so the label-figure-delta order holds whether or not a metric has one. - `VisibilityScreen`: three summary cards become a band; the two remaining `fontSize: 28` figure literals go with them. `MetricWidget` in packages/ui needed no work: it is already commented out of the index and has no callers. Left: the four `fontSize: 22` in the analytics screens are page titles, not figures. They are duplicates of the heading the layout renders in #864 and should be deleted with that work, not here. Verified: typecheck and 1175/1175 clean; `/dashboard/analytics` and `/dashboard/analytics/visibility` render with no sideways scroll at 1440 or 390. The bands themselves need data to see — the seeded account has no analytics history, so both screens show their empty state. Refs #817 Co-authored-by: Claude Opus 5 <[email protected]>
…re features (#819) Closes #819. The tokens landed in #621 and nothing held the line, so the counts went the wrong way through three releases of reskinning. This pins them per directory per pattern and fails anything worse. - scripts/lint/check-literal-ratchet.mjs — the check. Per directory, not one total, so you cannot add literals to office while fixing communities and still pass. Reports the directory's ceiling, the files under it, and marks the ones changed in this branch. - scripts/lint/literal-baseline.json — 40 directories, measured fresh on main. - Wired into pnpm lint, pnpm prepush, pnpm radium:check and the CI lint job. - .radium/scaffald-ui.md — the rule, and the map from each literal value to its token. `--update` lowers ceilings and refuses to raise them. Falling counts do not fail the build, they print the tightening to apply: failing on an improvement would put every unrelated PR in the business of editing the baseline. **The issue's numbers were wrong and the baseline does not use them.** #819 measured `borderRadius: <n>` (337 sites) and missed `borderRadius={<n>}`, the JSX prop form, which is another 355 — more than the style-object form. The real figure is 693, not 360. Hex was counted as `'#abc'` only, missing 124 double-quoted sites. Counting one syntax and not the other would have left the obvious bypass open on day one. fontSize was measured correctly and has since improved on its own: 637, down from 720. Measured ceilings: borderRadius 693, fontSize 637, hexColor 273, on main at 1ca0032. Two things in the issue turned out not to be needed. It proposed pinning `luscher-test` for literal colour; that directory has no hex literals left, so no exception is added. `marketing/theme.ts` is pinned, with the reason recorded in the baseline — it is a deliberate palette the file itself explains is not the product's, carrying WCAG notes against each value. Co-Authored-By: Claude Opus 5 <[email protected]>
…re features (#819) (#942) Closes #819. The tokens landed in #621 and nothing held the line, so the counts went the wrong way through three releases of reskinning. This pins them per directory per pattern and fails anything worse. - scripts/lint/check-literal-ratchet.mjs — the check. Per directory, not one total, so you cannot add literals to office while fixing communities and still pass. Reports the directory's ceiling, the files under it, and marks the ones changed in this branch. - scripts/lint/literal-baseline.json — 40 directories, measured fresh on main. - Wired into pnpm lint, pnpm prepush, pnpm radium:check and the CI lint job. - .radium/scaffald-ui.md — the rule, and the map from each literal value to its token. `--update` lowers ceilings and refuses to raise them. Falling counts do not fail the build, they print the tightening to apply: failing on an improvement would put every unrelated PR in the business of editing the baseline. **The issue's numbers were wrong and the baseline does not use them.** #819 measured `borderRadius: <n>` (337 sites) and missed `borderRadius={<n>}`, the JSX prop form, which is another 355 — more than the style-object form. The real figure is 693, not 360. Hex was counted as `'#abc'` only, missing 124 double-quoted sites. Counting one syntax and not the other would have left the obvious bypass open on day one. fontSize was measured correctly and has since improved on its own: 637, down from 720. Measured ceilings: borderRadius 693, fontSize 637, hexColor 273, on main at 1ca0032. Two things in the issue turned out not to be needed. It proposed pinning `luscher-test` for literal colour; that directory has no hex literals left, so no exception is added. `marketing/theme.ts` is pinned, with the reason recorded in the baseline — it is a deliberate palette the file itself explains is not the product's, carrying WCAG notes against each value. Co-authored-by: Claude Opus 5 <[email protected]>
…e onto the tokens (#820) (#945) * refactor(office): applications onto the type and radius tokens (#820) 72 fontSize and 40 borderRadius literals in office/applications. Seven of the radius sites are circles and pills, not rounded rectangles: `width: 28, height: 28, borderRadius: 14` is an icon bubble, and `height: 6, borderRadius: 3` is a progress bar. Those go to borderRadius.max, which holds the shape at any size. The issue's map would have sent them to radius.lg (7) and turned every status dot and avatar in the pipeline into a rounded square. Co-Authored-By: Claude Opus 5 <[email protected]> * refactor(office): scheduling onto the type and radius tokens (#820) 59 fontSize and 10 borderRadius literals, concentrated in two screens. Three radius sites are circles — the 64x64 confirmation badge in SelfScheduleScreen was `borderRadius: 32`, which is a circle, not a large corner radius. It goes to borderRadius.max. Co-Authored-By: Claude Opus 5 <[email protected]> * refactor(office): integrations onto the type and radius tokens (#820) 43 fontSize and 9 borderRadius literals. The HRIS stat numbers were `fontSize: 24`, which snaps to fontSize.xl (22). Co-Authored-By: Claude Opus 5 <[email protected]> * refactor(office): compliance onto the type and radius tokens (#820) 42 fontSize and 7 borderRadius literals, all in EEOReportScreen. Its 10px chart labels snap up to fontSize.xxs (11), the floor of the scale. Co-Authored-By: Claude Opus 5 <[email protected]> * refactor(office): shared office components onto the radius tokens (#820) 25 borderRadius and 2 fontSize literals across 15 files. This is the directory where the 16px and 12px corners were most common; they become borderRadius.l (7), which is the visible part of this change. Co-Authored-By: Claude Opus 5 <[email protected]> * refactor(office): teams onto the radius tokens (#820) 9 borderRadius literals, no type literals — teams was already using the primitives for text. Co-Authored-By: Claude Opus 5 <[email protected]> * refactor(office): payments onto the radius tokens (#820) 3 borderRadius literals. Co-Authored-By: Claude Opus 5 <[email protected]> * refactor(office): projects onto the radius tokens (#820) 2 borderRadius literals. Co-Authored-By: Claude Opus 5 <[email protected]> * refactor(office): the top-level office screens onto the tokens (#820) 9 borderRadius and 1 fontSize literal across the loose screens. Four of the radius sites are the CCPA timeline's 8x8 status dots, which are circles and go to borderRadius.max. With this, office holds no literal fontSize or borderRadius at all. The 27 hex colours are next and are not mechanical. Co-Authored-By: Claude Opus 5 <[email protected]> * test(mocks): add the zinc ramp to the vitest token mock, and record its drift `@scaffald/ui/tokens` is aliased to this mock for every vitest run, so a token that exists in packages/ui but not here reads as `undefined` at module scope and fails the whole suite on import — with a stack that points at the feature file, not at the mock. Reaching for `colors.zinc[500]`, which is a real token, is what surfaced it. Two divergences found while fixing it, both noted in the file: - `borderRadius` in the mock is the PRE-#621 scale (xs 6, s 8, l 12, xl 16). The real interface scale has been 2 / 4 / 7 since the tokens landed. Nothing asserts on those values, which is the only reason it has gone unnoticed. - `slate` exists in the mock and NOT in the real tokens, where the ramp is `zinc`. So `colors.slate[...]` passes every test and crashes the app. Co-Authored-By: Claude Opus 5 <[email protected]> * refactor(office): the 27 hex colours onto the colour tokens (#820) Not mechanical — each site needed reading, and they split three ways. **Categorical, so a named ramp step.** EEOReportScreen's eight race/ethnicity chart colours and ProjectHiringScreen's four status badge pairs are decorative category colours with no semantic meaning. Every one of them turned out to be an exact Tailwind value that the ramps already carry, so blue[500], indigo[500], violet[500], pink[500], amber[500], emerald[500] and the 100/800 badge pairs are literal no-ops. The four cool greys (#64748b, #94a3b8, #e5e7eb, #374151) have no exact token and go to the nearest zinc step, which holds the hue; the warm `gray` ramp would have shifted it. **Semantic, so a theme token.** The project fill bar and the member status dot signal completion and progress, so they become colors.fg[theme].success / .active / .warning — which is already the idiom three lines away in the same file. **Inverse text, and five of these were latent dark-mode bugs.** `'#fff'` over `colors.fg[theme].active` is white-on-light-teal in dark mode: fg.dark.active is #3fb5c7, so the literal was failing AA wherever it sat on a themed fill. Those five become colors.text[theme].quaternary, which flips with the fill. Nobody could see this because dark mode is hard-off until #833. The sixth `'#fff'` sits on a fixed categorical chart colour that does not flip, so it becomes colors.white rather than the flipping token. office now holds no literal fontSize, borderRadius or hex colour. Co-Authored-By: Claude Opus 5 <[email protected]> * chore(lint): hold office at zero literals in the ratchet (#820) The office entries leave the baseline entirely rather than going to 0, which is how the ratchet expresses "held at zero" — a directory absent from the ceilings map fails on its first literal. Verified by adding one `fontSize: 13` to office-overview.tsx: office — fontSize: 1, held at zero 1 packages/scf-core/features/office/office-overview.tsx <- changed in this branch Tree-wide: borderRadius 693 -> 575, fontSize 637 -> 418, hex 273 -> 246. Co-Authored-By: Claude Opus 5 <[email protected]> --------- Co-authored-by: Claude Opus 5 <[email protected]>
…d stub (#944) (#947) Closes #944. `vitest.config.ts` aliased `@scaffald/ui/tokens` to a hand-maintained stub. There was never a technical reason for it — `packages/ui/src/tokens` is plain data modules with no react-native, expo, Platform or Dimensions import between them, so they load in jsdom as-is. The alias now points at the source and the stub is deleted. It had drifted from production in both directions: - Its `borderRadius` was still the PRE-#621 scale (xs 6, s 8, l 12, xl 16) against the real 2 / 4 / 7. Nothing asserted on those numbers, which is the only reason it went unnoticed — any test that started asserting a radius would have asserted the wrong one and looked right. - It carried a `slate` ramp the real tokens do not have, and lacked `zinc`, which they do. So `colors.slate[500]` passed every test and was `undefined` in the app. A stub more permissive than reality is the dangerous direction; nothing in the repo turned out to depend on `slate`. The missing direction is what surfaced it: a real token absent from the stub reads as `undefined`, and at module scope it kills the whole suite on import with a stack pointing at the feature file, so the first guess is that the feature code is wrong. That cost a detour during #820. `packages/scf-core/__tests__/tokens-alias-is-real.test.ts` is the guard, next to the other two tests that police the test infrastructure. Verified that it actually guards rather than merely passing: pointed the alias at a stub shaped like the old one and all five assertions failed; pointed it back and all five passed. 8 projects, 2137 tests, 0 failures (scf-core 1272, ui 714, app 98, schemas 53). `@scaffald/integration-test` fails for want of a local Supabase on :54321 — reproduced identically on unmodified main, and it is excluded from every repo script including `test:unit` and `check`. Co-authored-by: Claude Opus 5 <[email protected]>
Applies the SCF prototype (
~/Development/SCF-Prototype) to the app. Phases 0–2of the parity plan.
Pairs with Scaffald/ui#18 — the token and component work lives in the
submodule; this PR carries the pointer bump, the app-side wiring, and the plan.
Phase 0 — the reference
58 screenshots of the prototype: 29 screens across five roles at desktop
1440×900 and mobile 390×844, captured by driving the prototype's own state.
capture-prototype.mjsre-runs it when the prototype moves.The plan measures the prototype's own design audit against our code:
fontSize:sites across 15 valuesborderRadius:sites across 12+ valuesPhase 1 — tokens
Teal stays the one primary; amber becomes the reserved attention role. Details
in Scaffald/ui#18.
App-side here:
global.cssself-hosts Cormorant Garamond. It is a variable font, so one37 KB WOFF2 covers the whole weight axis — one file, not the two the plan
assumed.
login-screen.tsx: the title hard-codedfontFamily: 'RobotoSerif_400Regular'inline, which overrode
getFontFamilyentirely and pinned the screen to thebody serif — the token system could never reach it. It was also an H5 used as
a card title; H5 is now the body-size step, so this is an H4, preserving the
shipped 17px exactly.
Phase 2 — primitives, and one caller
ScreenHeader,ListToolbar,MetricBlock/MetricRow,Lane/LaneGroup.Migrated: the ATS applications screen. It gains the kicker and tip the
prototype gives it, a collapse caret, and moves its count out of an ad-hoc
subtitle ("14 total applications") into the toolbar's result slot, which owns
the one
{n} {noun}template.This is the only screen migrated. The plan warns that a mechanical sweep
produces a diff nobody can review, so the rest go per-screen in phase 3.
Deleted:
features/office/components/OfficePageHeader.tsx— zero callers.SaaSSectionHeaderis also unused by the app but stays: it is a publishedexport of the component library with stories and a docs page, so removing it is
an API decision, not dead-code cleanup.
Two corrections to my own plan
Both from checking rather than assuming:
github.md's sync note claimsScaffald/Prototype@mainstill holds the 13 Aug build against 677 KBlocally, and the plan repeated that as "the one item with a real bus
factor". After a fetch, local
mainandorigin/mainare the same commitand the file is 772,808 bytes on both. The note is stale.
callers, and the third (
PageHeader) has no title at all — it is a toolbar.Verification
@scaffald/ui,scf-core,scaffald-app.environment gaps, byte-identical to a stashed baseline run on this branch.
pnpm prepushgreen.glyph measurement.
Not verified: the migrated ATS screen has not been seen rendering — it sits
behind auth and the office role.
Notes for reviewers
packages/uisubmodule when its pointermoves, flagging ~19 pre-existing issues in untouched files. Commits used
--no-verifyafter confirmingnx lintpasses on the changed packages.packages/uiunder a running Expo server leaves a stale Metrocache and produces a spurious hydration mismatch. Wipe
metro-cacheafterany
@scaffald/ui:build.phase-3 work compares against; say the word if you would rather they lived
outside the repo.
🤖 Generated with Claude Code