feat(tokens): name the letterspacing scale and ratchet the arbitrary family - #1663
Conversation
…family Section D, the half that carries no conflict with the two open PRs: this touches only `src/app/globals.css` and the contract scripts, none of which #1655 or #1658 holds. Corrects the measurement first. The backlog and the audit both quote the letterspacing sprawl as ~371 sites across 31 values; that number counts `*-mockups.tsx`, which is design scratch and gate-exempt by policy. Production only: 110 sites across 18 values. The gate's AST pass — which sees statically resolvable class roots — counts 68 across 40 files, and that is the number a ratchet can act on. The real defect turns out to be sharper than sprawl. 57 of the 110 production sites are one value, 0.06em, while the single pre-existing token `--tracking-eyebrow` is declared at 0.08em. The token has almost no consumers because it was named for a number nobody writes. Adds five named roles sized to the measured production mass, not to the mockup-inflated spread: --tracking-display -0.02em absorbs the six-site negative cluster --tracking-normal 0 --tracking-label 0.06em absorbs 66 sites including the 57-site mass --tracking-eyebrow 0.08em pre-existing, value deliberately unchanged --tracking-kicker 0.12em absorbs 23 sites Five roles rather than seven: production does not justify a second wide step or a separate tight-display step. No fold moves a call site by more than 0.04em. `--tracking-eyebrow` keeps 0.08em on purpose. Retuning it to the more common 0.06em would silently move every current consumer of the token — a different change from naming the scale, and one that wants its own measured step. Adds an `arbitraryTracking` metric to the design-system contract, mirroring the existing literal-shadow ratchet exactly, baselined per path at today's 68 so the family cannot regrow while the call-site migration waits for the open PRs to land. `tracking-[var(--…)]` is the sanctioned token form and is not counted, the same exemption `text-[color:var(--…)]` has in the type-scale check. No call sites migrated in this commit — that is 40 files including `ui-primitives.tsx`, which #1655 owns. Ratchet proven to bite, not assumed: injecting `tracking-[0.077em]` into mode-nav.tsx failed the checker with "arbitraryTracking increased from 68 to 69" and the per-path line, then the file was restored clean. Verification: check:design-system-contract exit 0 · typecheck 0 · lint 0 · ckb-v2-token-contract + design-token-contract + design-system-contract-utils 85 passed. Pre-existing baseline metrics were asserted unchanged before the baseline was rewritten; only `arbitraryTracking` was introduced. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 41 minutes Your organization has reached its usage spending cap. Adjust your spending cap in the billing tab. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
Comment |
Mirror the literal-shadow AST/text parity guard so unresolved or dynamic class strings cannot silently bypass the tracking-[…] debt ratchet. Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Empty commit to re-fire pull_request synchronize for the current tip after stale/queued runs were cancelled during the Actions major outage. Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Empty commit to fire pull_request synchronize after head had no Actions runs. Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Summary
Section D, restricted to the half that shares no file with the two open design-system PRs (#1655 owns
ui-primitives.tsx, #1658 owns the answer surface; this touches onlyglobals.cssand the contract scripts).Corrects the measurement the backlog is built on. The letterspacing sprawl is quoted everywhere as ~371 sites across 31 values. That count includes
*-mockups.tsx, which is design scratch and gate-exempt by policy. Production only: 110 sites across 18 values. The contract's AST pass — which sees statically resolvable class roots — counts 68 across 40 files, and that is the number a ratchet can actually act on. All three numbers are true of different things; only the last one is actionable.The real defect is sharper than sprawl. 57 of the 110 production sites are a single value,
0.06em, while the one pre-existing token--tracking-eyebrowis declared at0.08em. The token has almost no consumers because it was named for a number nobody writes. That is a more useful finding than "31 values", and it changes what the fix should be.Five named roles, sized to the measured production mass rather than the mockup-inflated spread:
--tracking-display-0.02em--tracking-normal0--tracking-label0.06em--tracking-eyebrow0.08em--tracking-kicker0.12emFive roles rather than seven: production does not justify a second wide step or a separate tight-display step. No fold moves a call site by more than 0.04em, most by 0.01–0.02em.
--tracking-eyebrowdeliberately keeps0.08em. Retuning it to the more common0.06emwould silently move every current consumer of the token. That is a different change from naming the scale and wants its own measured step.Adds an
arbitraryTrackingratchet to the design-system contract, mirroring the existing literal-shadow ratchet exactly, baselined per path at today's 68 so the family cannot regrow while the call-site migration waits for fix(design-system): correct three false gate/ledger claims; retire the left/right knob #1655 and feat(answer): adopt AnswerCard on the live answer surface; resolve #207 vs #227 #1658 to land.tracking-[var(--…)]is the sanctioned token form and is not counted — the same exemptiontext-[color:var(--…)]already has in the type-scale check.No call sites are migrated in this commit. That is 40 files including
ui-primitives.tsx, which #1655 owns; doing it now would guarantee a rebase across both open PRs.Verification
npm run check:design-system-contract— exit 0,design-sync contract checked: 53 components and 7 guidelinesnpm run typecheck— exit 0npm run lint— exit 0tests/ckb-v2-token-contract.test.ts,tests/design-token-contract.test.ts,tests/design-system-contract-utils.test.ts— 85 passedThe ratchet was proven to bite, not assumed. Injecting
tracking-[0.077em]intomode-nav.tsxfailed the checker witharbitraryTracking increased from 68 to 69plus the per-path lineat src/components/mode-nav/mode-nav.tsx increased from 1 to 2; the file was then restored clean. A first attempt againstquantity.tsxdid not fire — that file yields no statically resolvable class root for the injected string, which is a bad test target rather than a gate defect, and is the same reason the gate counts 68 of the 110 production occurrences.Before rewriting the baseline, every pre-existing metric was asserted unchanged; the write was scripted to refuse if any had moved. Only
arbitraryTrackingwas introduced.Not run:
verify:ui— no rendered output changes in this diff (five new custom properties with no consumers yet, plus contract-script changes), so there is nothing for a Chromium run to observe.RAG impact: no retrieval behaviour change — this diff touches only design tokens and design-system contract tooling. No file under
src/lib/rag/**, clinical-search, retrieval-selection, ranking-config, answer-ranking, the eval harness, or the golden fixture is modified.🤖 Generated with Claude Code