feat(design): registry binding + PR-diff bot + strict lint gate#5
Merged
Conversation
stream-ui is rendered by an agent, so component copy is part of the design system alongside colors/typography. Adds a `voice:` section to DESIGN.md with six tokens: formality, density, capitalization, emoji, errorTone, ctaStyle. Each has a prose entry with a concrete do/don't example. Voice is a namespaced extension (unknown-but-preserved per the spec — linter accepts it, emits no CSS vars). The agent reads DESIGN.md at cold start and honors the guidance in streamed copy. Verified with a live probe: prompt: "primary CTA for saving, plus error alert if save fails" → button: "Save" (short-verb CTA ✓) → alert: "Couldn't save — name is required." (matter-of-fact ✓) Agent's own narration cited "matter-of-fact copy", "short-verb CTA", "sentence-case labels" — the voice tokens are reaching the system prompt and shaping output.
Three Phase-4 tooling wins on top of the voice-tokens landing: 1. Registry binding — consumer renderers honor DESIGN.md by reading CSS custom properties directly; no separate "register with DESIGN.md" step. Refactored playground's kanban-card from hardcoded rgb to var(--sui-colors-*) + var(--sui-rounded-*) + var(--sui-spacing-*). Verified: left-border accents reskin across System/Light/Dark/Heritage (todo→neutral, doing→warning, done→success). DESIGN.md gains a short "## Custom components" section showing the pattern so consumers know the contract. 2. PR-diff auto-comment — .github/workflows/design-diff.yml runs on PRs that touch DESIGN.md, extracts the base file via git show, runs `@google/design.md diff --format=json` and posts a structured token delta (added/removed/modified per group) as a PR comment. Updates the existing bot comment on re-runs instead of spamming. 3. Strict gate — scripts/lint-design.ts now fails the build on warnings as well as errors. Baseline is 0/0 so any new "unused token" or "contrast below AA" warning blocks the PR until fixed.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
DESIGN.md token deltaNo token-level changes detected (prose-only edits). |
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.
Summary
Finishes the Phase 4 tooling on top of the voice-tokens PR (#4).
1. Registry binding
Custom components registered via stream-ui's
register()API inherit theming by reading DESIGN.md tokens directly — no separate "register with DESIGN.md" step. Refactored playground's kanban-card from hardcodedrgb(...)tovar(--sui-colors-*) / var(--sui-rounded-*) / var(--sui-spacing-*). Added a Custom components section to DESIGN.md so consumers know the pattern.2. PR-diff auto-comment
.github/workflows/design-diff.ymlruns on PRs that touch DESIGN.md, extracts the base file, runs@google/design.md diff --format=json, and posts a structured token delta (added/removed/modified per group) as a PR comment. Updates the existing bot comment on re-runs.3. Strict lint gate
scripts/lint-design.tsnow fails on warnings as well as errors. Baseline is 0/0 so any new "unused token" or "contrast below AA" finding blocks the PR. Raise the bar while it's clean.Test plan
bun run lint:design→ 0/0/1 (still passes)bun run lint·typecheck·test(97/97) ·buildall greenrgb(...)left in the kanban-card blocklint:design) passes on this PR