Skip to content

feat(tokens): name the letterspacing scale and ratchet the arbitrary family - #1663

Merged
BigSimmo merged 11 commits into
mainfrom
claude/ds-token-tracking-scale
Aug 7, 2026
Merged

feat(tokens): name the letterspacing scale and ratchet the arbitrary family#1663
BigSimmo merged 11 commits into
mainfrom
claude/ds-token-tracking-scale

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Aug 6, 2026

Copy link
Copy Markdown
Owner

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 only globals.css and 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-eyebrow is declared at 0.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:

    Token Value Production sites absorbed
    --tracking-display -0.02em the six-site negative cluster
    --tracking-normal 0 3
    --tracking-label 0.06em 66, including the 57-site mass
    --tracking-eyebrow 0.08em 9 — pre-existing, value unchanged
    --tracking-kicker 0.12em 23

    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, most by 0.01–0.02em.

  • --tracking-eyebrow deliberately keeps 0.08em. Retuning it to the more common 0.06em would 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 arbitraryTracking ratchet 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 exemption text-[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 guidelines
  • npm run typecheck — exit 0
  • npm run lint — exit 0
  • tests/ckb-v2-token-contract.test.ts, tests/design-token-contract.test.ts, tests/design-system-contract-utils.test.ts85 passed

The ratchet was proven to bite, not assumed. Injecting tracking-[0.077em] into mode-nav.tsx failed the checker with arbitraryTracking increased from 68 to 69 plus the per-path line at src/components/mode-nav/mode-nav.tsx increased from 1 to 2; the file was then restored clean. A first attempt against quantity.tsx did 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 arbitraryTracking was 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

…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>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@supabase

supabase Bot commented Aug 6, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project sjrfecxgysukkwxsowpy because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 77a881dd-4817-44e3-9b0a-799bcb056b3b

📥 Commits

Reviewing files that changed from the base of the PR and between 47cffe5 and ec0b03c.

📒 Files selected for processing (4)
  • scripts/check-design-system-contract.mjs
  • scripts/design-system-contract-baseline.json
  • scripts/design-system-contract-utils.mjs
  • src/app/globals.css

Comment @coderabbitai help to get the list of available commands.

Comment thread scripts/design-system-contract-utils.mjs
@BigSimmo
BigSimmo enabled auto-merge (squash) August 6, 2026 18:13
cursoragent and others added 10 commits August 6, 2026 18:18
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>
@BigSimmo
BigSimmo merged commit 82b6f5a into main Aug 7, 2026
25 checks passed
@BigSimmo
BigSimmo deleted the claude/ds-token-tracking-scale branch August 7, 2026 02:21
cursor Bot pushed a commit that referenced this pull request Aug 7, 2026
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
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.

2 participants