UI overhaul Phase 0: style-discipline guard + tokenize ui/ primitive type sizes - #165
Merged
Merged
Conversation
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
This was referenced Jun 19, 2026
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>
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.
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.csstoken layer, the 16components/ui/primitives) is strong and is being built on, not replaced.Changes
apps/ui/scripts/check-style-discipline.mjs— fails on arbitrarytext-[Npx]font sizes and raw#hexcolor literals undersrc/components/**. Scoped tocomponents/ui/first;ENFORCED_DIRSis widened directory-by-directory as later phases clear each area. Allowlists canvas/color-math modules,*.stories.tsx,colorScales.ts, and the off-systemDenseDawConceptdemo. Wired intoverifyaslint:style.--text-nano(8px) and--text-micro(9px) to theindex.css@themescale so the small DAW label sizes finally have tokens (their absence was the main reason components reached for arbitrary values).text-[Npx]usages across theui/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:unit— 771/771 pass.npm run build— succeeds; confirmed.text-nano/.text-micro/.text-meta/.text-eyebroware emitted into the CSS bundle (Tailwind v4 generates them from the tokens, now actually used).npm run test:smokenot 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 competingMeasurementPrimitives.tsxlayer · 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