Skip to content

feat(design): registry binding + PR-diff bot + strict lint gate#5

Merged
BaruchEric merged 2 commits into
mainfrom
claude/design-phase-4-finish
Apr 23, 2026
Merged

feat(design): registry binding + PR-diff bot + strict lint gate#5
BaruchEric merged 2 commits into
mainfrom
claude/design-phase-4-finish

Conversation

@BaruchEric
Copy link
Copy Markdown
Owner

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 hardcoded rgb(...) to var(--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.yml runs 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.ts now 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) · build all green
  • Browser: kanban-card left-border reskins per theme — todo→neutral, doing→warning, done→success, all mapped to DESIGN.md tokens
  • No raw rgb(...) left in the kanban-card block
  • CI gate (lint:design) passes on this PR
  • The diff workflow should post a token delta comment on this PR since DESIGN.md is touched

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.
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 23, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
stream-ui Ready Ready Preview, Comment Apr 23, 2026 1:47am

Request Review

@github-actions
Copy link
Copy Markdown

DESIGN.md token delta

No token-level changes detected (prose-only edits).

@BaruchEric BaruchEric merged commit 6d436b4 into main Apr 23, 2026
4 checks passed
@BaruchEric BaruchEric deleted the claude/design-phase-4-finish branch April 23, 2026 01:47
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.

1 participant