Skip to content

feat(web): design system with token utilities, owned primitives and guard - #103

Merged
flexdinesh merged 14 commits into
mainfrom
design-system
Oct 23, 2026
Merged

flexdinesh merged 14 commits into
mainfrom
design-system

Conversation

@flexdinesh

Copy link
Copy Markdown
Owner
  • Token architecture: style.css clears Tailwind's default scales and exposes each semantic token from tokens.css/typography.css as a same-name utility (bg-panel, border-control, h-control, rounded-round, …). Markup and tokens now share one vocabulary and the arbitrary [var(--x)] values are gone.
  • Primitives own visuals: components/ui/* (Button, Toggle, Tabs, Dialog, Separator, Skeleton, …) carry color, border, radius, height, padding and states as cva variants. Feature code only arranges components, so a visual change propagates from one place.
  • Shared composites in components/ (IconButton with tooltip, SplitButton, SegmentedControl, SearchField, ListRow, PanelHeader, CollapsibleSection, EmptyState/ErrorState/Notice, ConfirmDialog, CountBadge, StatusDot, Shortcut, KeyValueList, ContextIcon, Scrim) replace per-feature copies.
  • Shell, picker, account, navigation, review and diff toolbar migrated onto primitives and composites. Feature CSS keeps only shell layout, dynamic geometry and the Pierre boundary. Copy and tone fixes: sentence case, no titles duplicating visible text, quiet bulk delete, revoke token now confirms.
  • Design guard (tools/check-design.ts) enforces ownership: it rejects token-shadowing arbitrary values, off-scale spacing, [data-slot]/ID selectors, visual classNames on components and hook-class restyling. oxlint react/forbid-elements blocks raw form controls in feature files. Contract tests cover each rule; stale exceptions are removed.
  • Dev-only gallery (/design.html, excluded from the build) renders every variant in both themes. The Playwright gallery project compares exact Chromium/Linux goldens and checks 44px touch targets at 390px.
  • Browser tests use role/label locators instead of styling hooks.
  • DESIGN.md documents the ownership rule, the utility table, the component inventory, the guard rules and the gallery; docs/development.md covers gallery and golden updates.

Validation: mise run check passes (Go, contracts, static, 105 browser tests including the gallery). Computed-style parity against main was checked for the touched surfaces. Intended visual changes: SearchField and the hide-reviewed toggle are 32px (were 28/36), and dialogs share a 1px --border frame.

flexdinesh and others added 14 commits October 23, 2026 17:26
Reset Tailwind's default scales and register only canonical tokens, so
utilities cannot resolve to off-system values. Add icon stroke, motion,
panel-header, drawer-width and count-fill tokens; drop unused
--toolbar-height and --border-strong, redundant [hidden] rules and dead
CSS. Align DESIGN.md radii with shipped values.
Tokenize shadcn primitives against the theme bridge; one color vocabulary.
Move element defaults to @layer base so primitive utilities win.
Add tooltip, popover, checkbox, kbd, button-group, input-group primitives.
Guard derives allowed utilities from style.css @theme blocks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
IconButton, SplitButton, SegmentedControl, SearchField, PanelHeader,
CollapsibleSection, DisclosureIcon, ListRow, EmptyState, ErrorState, Notice,
ConfirmDialog, CountBadge, StatusDot, Shortcut, KeyValueList, ContextIcon.
format.ts holds count, plural, progress and shortcut formats.
Topbar dedupes the review and session-shell headers; TooltipProvider at root.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Header, activity rail, theme, account and sync actions use IconButton
with shell/rail variants and touch sizing; shortcuts show in tooltips via
formatShortcut. Server status and diff comparison popovers use Popover
and KeyValueList. Session status uses EmptyState. Skeletons take shapes
from the primitive. Delete the topbar, rail, popover, spinner and
skeleton CSS these replace. Tests use roles, labels and tooltips.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Picker: SearchField (32px) with IconButton back/filters/close, ListRow
option rows with ContextIcon, CountBadge change counts, SegmentedControl
freshness, Checkbox, EmptyState for empty list and filter menus, Shortcut
footer hints. Account: Select for access/expiry, Input/Button touch sizing,
ErrorState for errors, EmptyState for identity status. Delete replaced
picker and account CSS; tests use role/text locators.

Additive: ListRow variant "option", SearchField leading, CountBadge unit,
Input touch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Token list load failure uses ErrorState's shared "Retry" label instead of
"Retry loading tokens", with a touch-sized Retry (ErrorState touch prop).
Test covers the retry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Repos, file tree, sidebar tabs, summary and review tools use PanelHeader,
ListRow, IconButton, SearchField, CollapsibleSection, KeyValueList,
CountBadge, StatusDot, EmptyState, ErrorState, Notice and SplitButton.
Delete the replaced feature CSS; tests use role and label locators.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sentence case for review tool labels, drop titles that visible text
covers, and drop the copy-review id in favor of role locators.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review panel, comment cards, delete flows, diff toolbar and Pierre file
header slots now compose primitives and composites. Feature CSS keeps
only layout, shell islands and the Pierre boundary.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Bulk delete rests quiet; the confirm dialog carries the destructive
fill. Sidebar and inline comment cards show the same labeled actions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Guard rejects token-shadowing arbitrary values, off-scale spacing, slot
and ID selectors, visual classNames on components and hook-class
restyling; oxlint forbids raw form controls in feature files. Remaining
violations move into variants: ContextIcon size/tone, Separator chrome,
DialogContent command, Toggle icon, Scrim. SearchField restores the
shipped muted border; dead CSS and stale exceptions removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
/design.html renders every primitive and composite variant in both
themes. A Playwright gallery project compares exact Chromium/Linux
goldens and checks 44px touch targets at 390px.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
DESIGN.md gains the ownership rule, token utility table, component
inventory, new guard rules and current exceptions; the picker search is
32px. development.md covers the gallery and goldens.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Revoke opens the shared confirm dialog; failures stay in the dialog.
Destructive menu triggers show the open fill like other variants.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@flexdinesh
flexdinesh merged commit 0b848db into main Oct 23, 2026
2 checks passed
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