Skip to content

refactor(ui): type-scale drift guard for verify:cheap (guard-only slice of #221) - #246

Closed
BigSimmo wants to merge 1 commit into
feature/tools-page-mockupsfrom
claude/type-scale-drift-guard
Closed

refactor(ui): type-scale drift guard for verify:cheap (guard-only slice of #221)#246
BigSimmo wants to merge 1 commit into
feature/tools-page-mockupsfrom
claude/type-scale-drift-guard

Conversation

@BigSimmo

Copy link
Copy Markdown
Owner

Lands the type-scale drift guard onto the feature line so the M3 token-adoption backlog can't silently regrow. Item 1 of docs/redesign/07-token-adoption-audit.md.

What

  • scripts/check-type-scale.mjs (npm run check:type-scale): reports arbitrary text-[<n>px|rem|em] font sizes that bypass the @theme scale. Report-only by default; --strict exits non-zero (promote to a CI gate once the backlog clears). Colour utilities text-[color:var(--…)] are intentionally not flagged.
  • globals.css: size-only display tokens --text-lg-minus (17px) + --text-2xl-minus (22px), completing the scale's display tail.
  • package.json: wires check:type-scale into verify:cheap in report mode (non-breaking).

Relationship to #221

This is the guard-only slice of #221 (claude/type-scale-display-tokens). It deliberately omits #221's three component call-site swaps (ClinicalDashboard.tsx, dashboard-shell, differentials) because ClinicalDashboard.tsx is mid-decomposition in claude/clinical-dashboard-decomp and those swaps would conflict there. Those swaps can land with the decomposition (or via #221 once it settles); this slice is conflict-free for the feature branch. Land whichever path you prefer — they're not mutually exclusive.

Verification

  • node scripts/check-type-scale.mjs reports 111 arbitrary sizes across 11 files at this base.
  • --strict exits 1 (gate-ready).
  • prettier clean on all three files.

Backlog is ~80% inside the ClinicalDashboard decomposition; clearing it there → flip the guard to --strict in verify:cheap to make the invariant permanent.

🤖 Generated with Claude Code

Ports the type-scale drift diagnostic (from the unmerged
claude/type-scale-display-tokens line) onto feature/tools-page-mockups so
the M3 token-adoption backlog can't silently regrow. Item 1 of the
token-adoption audit follow-ups (docs/redesign/07-token-adoption-audit.md).
- scripts/check-type-scale.mjs: report-only diagnostic
(npm run check:type-scale) flagging arbitrary text-[<n>px|rem|em] font
sizes that bypass the @theme scale; --strict exits non-zero for a future
CI gate. Colour utilities text-[color:var(--…)] are intentionally not flagged.
- globals.css: add size-only display tokens --text-lg-minus (17px) and
--text-2xl-minus (22px), completing the scale's display tail.
- package.json: wire check:type-scale into verify:cheap in REPORT mode
(non-breaking). Promote to --strict once the 111-item backlog is cleared
(audit item 2).
Deliberately excludes the three component call-site swaps to avoid colliding
with in-flight WIP; those belong with the item-2 backlog cleanup.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@BigSimmo

Copy link
Copy Markdown
OwnerAuthor

Closing as redundant. The type-scale drift guard, the check:type-scale script/wiring, and the --text-lg-minus/--text-2xl-minus display tokens are all already on feature/tools-page-mockups (origin @ 80d1399) via #221's merge. This branch was cut from an older base (ba7f54d) just before that landed, so it only duplicates + conflicts. The one delta here — wiring check:type-scale into verify:cheap in report mode — is intentionally not done on feature (kept standalone until the backlog clears, then promote to --strict), so there's nothing worth salvaging. No action needed.

@BigSimmoBigSimmo closed this Jul 3, 2026
@BigSimmo
BigSimmo deleted the claude/type-scale-drift-guard branch July 3, 2026 11:42
BigSimmo pushed a commit that referenced this pull request Aug 5, 2026
…sign
Four conflicts, resolved as the trial merge recorded in the PR body predicted.
`search-screen.tsx` reduced to the handler alone, exactly as forecast: both
sides had independently arrived at `--text-muted`, so the only disagreement
left was `clearSearchFilters` (here) versus `clearSearch` (main). Kept this
branch's — #1616 branched before defect #1611's sibling was fixed, and
`clearSearch` on a control labelled `Clear` inside a filter row deletes the
query the reader is looking at.
`search-results-header-band.tsx` (2 hunks) took this branch: main's side is
the pre-restructure shelf carrying only the token migration this branch had
already applied.
`document-search-results.tsx` (3 hunks): the two empty-state hunks took this
branch's shared `SearchResultsEmptyState`. The import hunk is a genuine merge —
v2 renamed `metadataPill` to `metadataPillDensity`, and the auto-merged body now
calls `metadataPillDensity.roomyCompact`, so the import must follow. `EmptyState`
is dropped from it because both of v2's call sites are the ones this branch
replaced.
`docs/outstanding-issues.md`: #1616 minted its own #237 and #238 from the same
`next-id`, so both sides landed rows under both numbers. Renumbered *this*
branch's to #246 and #247 and bumped the marker to 248, rather than taking one
side wholesale — main's rows are already landed and referenced. This is the
collision `#156` and `#168` predict; the guard caught it.
Two v2 gates then failed on the merged tree and are now satisfied:
- `check:design-system-contract` ratchets `textSoftConsumers` per file, and v2
had driven both of these to zero. The four remaining usages here are icons and
glyphs, which this branch had deliberately left on `--text-soft` because v1
defined no decoration token. v2 defines `--decoration-soft`, so that
constraint is gone and they move there — the tier v2 itself uses for the same
nodes.
- The generated adoption manifest and COMPONENTS.md maturity section went stale
as a result; regenerated with `design-system:adoption:update`.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qm3i3eLCDcwytzge1sKM4a
BigSimmo pushed a commit that referenced this pull request Aug 5, 2026
…tap floor
Two sessions resolved the #1616 merge independently. The pushed one (`5c0fe4d`)
failed `Static PR checks` on the outstanding-issues guard: #1616 minted its own
#237 and #238 from the same `next-id`, and that resolution kept both sides under
both numbers. This merge keeps the resolution that renumbers *this* branch's
rows to #246/#247 and bumps the marker to 248 — main's are already landed and
referenced, so they keep their numbers. The guard now passes: 245 rows, unique
ids, next-id above the highest, no ids dropped from base 08595cc.
The only other conflict was a duplicated comment block on the therapy quick-filter
`Clear`; both sides already agreed on `--text-muted` and `clearSearchFilters`.
Also fixes a review finding, which is a real inconsistency this branch
introduced: the find-a-filter field shipped at `min-h-10` — 40px — in the very
commit that raised the facets, the disclosure headings, the shelf `Clear` and the
sheet footer to `min-h-tap` (48px). On the surface that exists for phones, the
one control added to make a long filter list usable was the smallest target in
the sheet. It now matches the facets exactly (`min-h-tap sm:min-h-9`).
`decoration-on-text.contract.test.ts` had pinned that field by slicing 600
characters after its testid, so documenting the line broke the guard. It now
walks forward to the element's own `className`, and additionally pins the tap
floor so the 40px version cannot come back.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qm3i3eLCDcwytzge1sKM4a
BigSimmo added a commit that referenced this pull request Aug 7, 2026
* fix: close high-win Grok batch (tokens, a11y, perf, gates)
- Drop unused --med-accent-soft (#157)
- Document Chip compact=11px / standard=12px (#220)
- Reveal phone chrome on source change at top (#176)
- Passive wheel listener for modifier-gated PDF zoom (#214)
- Point npm run typecheck at source-only tsconfig (#210)
- Fail outstanding-issues when queue cites non-open IDs (#201)
Also confirms MatchExplanationChips, Favourites empty-state,
DocumentFrame role=alert, and refetching dimming claim are
already resolved on main (#223/#225/#219/#246).
* issues: archive grok-batch wins #157#176#201#210#214#219#220#223#225#246
Prune them from the recommended queue so the new queue-membership gate stays green.
* fix: address PR #1651 review (double-zoom, issues:done, tokens)
- Keep viewer wheel listener non-passive while wheelZoom is on and
preventDefault on Ctrl/⌘+wheel / trackpad pinch so PDF zoom does not
also zoom the browser page (Sentry/Devin).
- Prune recommended-queue ID citations in resolveIssue so issues:done
stays writable under the #201 gate.
- Drop restated Chip pixel values from TOKENS.md; amend #214 archive note.
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
* fix: recompute issues-queue Order boundary after deletions
Devin: pruneResolvedIdFromQueue used a pre-splice openStart for
renumbering, so enough solo-queue deletions could rewrite Open items
headers/ids. Recompute the section limit after edits and cover it in
the writer self-test.
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
* docs: record Run PR sweep ledger for PR #1651
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
---------
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Sign up for freeto 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.

1 participant

@BigSimmo