Repository navigation
refactor(office): map the 364 literal styling sites in features/office onto the tokens (#820) - #945
Merged
Merged
Conversation
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]>
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]>
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]>
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]>
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]>
9 borderRadius literals, no type literals — teams was already using the primitives for text. Co-Authored-By: Claude Opus 5 <[email protected]>
3 borderRadius literals. Co-Authored-By: Claude Opus 5 <[email protected]>
2 borderRadius literals. Co-Authored-By: Claude Opus 5 <[email protected]>
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]>
…ts 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]>
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]>
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]>
Closed
5 of 7 tasks
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.
Closes #820. Second item of release 4 (#939), after #819 put the ratchet in place.
364 literal styling sites in
packages/scf-core/features/officeonto the tokens, one commit per sub-directory. office now holds no literalfontSize,borderRadiusor hex colour, and its ceilings leave the ratchet baseline entirely — which is how the ratchet expresses "held at zero".fontSizeborderRadiusThe issue's radius map would have broken 16 things
#820prescribesradius.lgfor everything from 7 to 16. But 16 of the radius sites are circles and pills, where the radius is deliberately half the box:Mapping those to 7px turns every avatar, status dot and progress bar in office into a rounded square. They are detected by checking whether the radius is exactly half a
widthorheightin the same style block, and go toborderRadius.maxinstead, which holds the shape at any size.I hand-read all 18 the first detector flagged, which is how I found that two of them were false positives —
borderRadius={8}on a badge whose only nearby number was an icon'ssize={16}. Narrowing the rule towidth/heightonly (never asizeprop) gives exactly the 16 real ones.Two other places the issue's instructions don't survive contact:
radius.smis 4, not 2. The issue says "radius.sm(≤3)", which would double every 2px radius. The file even says so:sm: borderRadius.s, // 4 — interface step 1 is xxxs (2).borderRadius.*is the house idiom, notradius.*.packages/uicomponents useborderRadius.*122 times againstradius.*twice.The hex pass was not mechanical
27 sites, split three ways:
blue[500],indigo[500],violet[500],pink[500],amber[500],emerald[500]and the 100/800 pairs are literal no-ops. The four cool greys have no exact token and go to the nearestzincstep, which holds the hue — the warmgrayramp would have shifted it.colors.fg[theme].success/.active/.warning, which is already the idiom three lines away in the same file.'#fff'overcolors.fg[theme].activeis white on#3fb5c7in dark mode: roughly 1.9:1, failing AA. Those becomecolors.text[theme].quaternary, which flips with the fill. Nobody could see this because dark mode is hard-off until feat(theme): re-enable dark mode behind a dev toggle, add the dark smoke pass, audit the redesign tokens in dark #833. The sixth'#fff'sits on a fixed categorical colour that doesn't flip, so it becomescolors.whiterather than the flipping token.A test-infrastructure bug this surfaced — #944
Using
colors.zinc[500], a real token, killed the EEOReportScreen suite on import:vitest.config.tsaliases@scaffald/ui/tokensto a hand-maintained mock that has drifted in both directions: itsborderRadiusis still the pre-#621 scale (xs 6, s 8, l 12, xl 16 instead of 2 / 4 / 7), and it carries aslateramp the real tokens don't have — socolors.slate[...]passes every test and isundefinedin the app. Addedzincand recorded both divergences in the file; filed #944 to stop hand-maintaining the surface.Verification
scf-core:typecheckclean. The first run failed on@scaffald/sdkexports — that was the stale submodule dist, not this change; green after building it.fontSize: 13tooffice-overview.tsx:pnpm prepushgreen.One acceptance box is unticked. The issue asks for before/after captures of
/office/applications,/office/ats/metricsand/office/cms/jobs. Those are protected routes needing a signed-in office user, which needs a local Supabase, which needs Docker — and the Docker daemon isn't running on this machine. I have not pretended otherwise. What I attached instead is a token-delta reference rendering the before/after values at real size, and the measured deltas are:Happy to run the real captures when Docker is up — say the word and I'll do it before this merges.
🤖 Generated with Claude Code