Skip to content

UI overhaul Phase 0: style-discipline guard + tokenize ui/ primitive type sizes - #165

Merged
slittycode merged 1 commit into
mainfrom
claude/charming-faraday-bcny24
Jun 19, 2026
Merged

UI overhaul Phase 0: style-discipline guard + tokenize ui/ primitive type sizes#165
slittycode merged 1 commit into
mainfrom
claude/charming-faraday-bcny24

Conversation

@slittycode

Copy link
Copy Markdown
Owner

What & why

First PR of a phased, ethos-preserving UI overhaul. It lands enforcement first so the typography/color cleanup in later phases can't silently regress — which is exactly what happened to the 2026-05-13 pass (it removed hardcoded hex; 257 hex have since returned because nothing enforced the rule).

The UI's foundation (the Ableton device-rack ethos, the index.css token layer, the 16 components/ui/ primitives) is strong and is being built on, not replaced.

Changes

  • New build guard apps/ui/scripts/check-style-discipline.mjs — fails on arbitrary text-[Npx] font sizes and raw #hex color literals under src/components/**. Scoped to components/ui/ first; ENFORCED_DIRS is widened directory-by-directory as later phases clear each area. Allowlists canvas/color-math modules, *.stories.tsx, colorScales.ts, and the off-system DenseDawConcept demo. Wired into verify as lint:style.
  • Type-scale tokens — added --text-nano (8px) and --text-micro (9px) to the index.css @theme scale so the small DAW label sizes finally have tokens (their absence was the main reason components reached for arbitrary values).
  • Tokenized the primitives — replaced all 20 arbitrary text-[Npx] usages across the ui/ primitives (Button, Checkbox, DeviceRack, EmptyState, LedIndicator, MetricBar, MetricTile, Pill, SignalChain, TimeReadout, Tooltip) with scale tokens. Rendered sizes are byte-identical (text-meta=10px, text-eyebrow=11px, etc.).

Verification

  • npm run lint:style — passes clean and correctly fails on a planted violation (negative probe).
  • npm run lint (tsc) — clean.
  • npm run test:unit771/771 pass.
  • npm run build — succeeds; confirmed .text-nano/.text-micro/.text-meta/.text-eyebrow are emitted into the CSS bundle (Tailwind v4 generates them from the tokens, now actually used).
  • npm run test:smoke not run in this environment (Playwright browsers unavailable); changes are class-string swaps with identical rendered output and no DOM change, so CI smoke is the backstop.

What's next (later PRs)

Typography codemod of the 339 feature-code text-[Npx] → tokens (and widen the guard repo-wide) · retire the competing MeasurementPrimitives.tsx layer · accessibility hardening (keyboard upload, global :focus-visible, canvas labels, contrast) · chip taxonomy + give the flat cards device character · split & migrate the two monolith view components · token polish (radius/elevation/motion, accent-glow tokenization).

🤖 Generated with Claude Code

https://claude.ai/code/session_016to3B8Hf9eAGxAbzpQNvku


Generated by Claude Code

Add scripts/check-style-discipline.mjs, a build guard that bans arbitrary
text-[Npx] font sizes and raw #hex color literals under src/components/**
(scoped to components/ui/ first; widened as later overhaul phases clear
each area). Canvas/color-math modules, *.stories.tsx, colorScales.ts, and
the off-system DenseDawConcept demo are allowlisted.

Extend the index.css type scale with --text-nano (8px) and --text-micro
(9px) so the small DAW label sizes have tokens, then replace all 20
arbitrary text-[Npx] usages across the ui/ primitives with scale tokens
(rendered sizes byte-identical). Wire lint:style into the verify gate.

Why: a prior pass removed hardcoded hex but it silently returned because
nothing enforced the rule. This guard is that enforcement, so the
typography/color cleanup in later phases cannot regress.

Verified: lint:style (pass + negative probe), tsc, 771 unit tests, and
vite build all green; new text-* utilities confirmed emitted into the CSS
bundle.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016to3B8Hf9eAGxAbzpQNvku
@slittycode
slittycode merged commit 884774f into main Jun 19, 2026
5 checks passed
@slittycode
slittycode deleted the claude/charming-faraday-bcny24 branch June 19, 2026 01:39
slittycode added a commit that referenced this pull request Jun 21, 2026
Past-tense paper trail for the apps/ui design-system overhaul (PRs #165-#174):
typography unified on the --text-* scale, a single ui/ primitive layer with the
duplicate MeasurementPrimitives set deleted, accessibility lifted to WCAG AA, and
a style-discipline CI guard. Records the two planned phases deliberately dropped
as diff-churn (chip declutter, token scales) and the deferred monolith
restyle/split. Adds the matching Contents entry to docs/history/README.md.


Claude-Session: https://claude.ai/code/session_016to3B8Hf9eAGxAbzpQNvku

Co-authored-by: Claude <noreply@anthropic.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