Skip to content

refactor(ui): design system audit — score 12→19/20#93

Open
paulovitin wants to merge 2 commits into
sstraus:mainfrom
paulovitin:refactor/design-system-audit-fixes
Open

refactor(ui): design system audit — score 12→19/20#93
paulovitin wants to merge 2 commits into
sstraus:mainfrom
paulovitin:refactor/design-system-audit-fixes

Conversation

@paulovitin

@paulovitin paulovitin commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Summary

Systematic design-system audit across accessibility, performance, theming, and anti-pattern compliance. Took the impeccable audit score from 12/20 (Acceptable) to 19/20 (Excellent) in a single pass.

This PR enforces the design principles documented in DESIGN.md — specifically the absolute bans on side-stripe borders, glassmorphism, and layout-property animations — while completing the semantic token migration and adding keyboard accessibility to all interactive elements.

Why these changes matter

Side-stripe borders removed (7 instances)

The left-border accent pattern (border-left: 3px solid var(--accent)) is an absolute ban in our design system. It's a common AI-generated cliché that signals "someone used a template." Our active states now use background tints with subtle border rings — visually distinctive without the stripe.

Impact: Every active/selected state in Settings, FileBrowser, Sidebar, ActivityDashboard, WorktreeManager, and PromptDrawer now respects the design spec.

Glassmorphism eliminated (3 mobile overlays)

backdrop-filter: blur(12px) on mobile is both a design-ban violation AND a performance problem. Each blur composites the entire underlying layer on the GPU every frame. Replaced with opaque backgrounds + elevation shadows per DESIGN.md's shadow vocabulary.

Impact: CommandWidget, NewSessionSheet, IdeasOverlay — smoother rendering on mobile, spec-compliant.

Layout animations → GPU transforms (9 components)

Progress bars used transition: width 0.3s which forces the browser to recalculate layout on every frame (reflow). Converted to transform: scaleX() which runs entirely on the GPU compositor — zero layout cost.

Same treatment for TriStateToggle (lefttranslateX).

Impact: Eliminates layout thrashing during progress animations across TabBar, ClaudeUsageDashboard, ProcessManager, UpdateProgress, DictationSettings, SessionCard, SessionDetail, and Settings.

Token system completed — zero orphan hex

Before this PR, ~50 hard-coded hex values and ~35 var(--token, #fallback) redundancies existed across the CSS. All resolved:

  • Created missing tokens: --changes, --urgent, --search-match, --search-match-active, --search-match-border, --tweak-highlight
  • Fixed wrong token names: --green/--red/--yellow/--danger/--ok/--color-error → proper --success/--error/--changes
  • Converted raw rgba(r,g,b,a)color-mix(in srgb, var(--token) N%, transparent)

Impact: The entire desktop CSS now uses the token vocabulary exclusively. Theme changes propagate consistently. No more drift.

Keyboard accessibility (26 interactive divs)

Interactive <div onClick={...}> elements are invisible to keyboard navigation and screen readers. Added role="button" tabIndex={0} onKeyDown={Enter/Space} to all collapsible headers, clickable rows, and toggle elements.

Created src/utils/a11y.ts with a reusable onClickKeyDown helper.

Impact: Full keyboard navigation for GitPanel sections, Sidebar headers, Settings tabs, MCP items, commit rows, toast dismiss, task queue items, and more. WCAG 2.1.1 (Keyboard) and 4.1.2 (Name/Role/Value) compliance.

Visual diff

Before After
Side-stripe border-left: 3px accent Background tint + border ring
backdrop-filter: blur(12px) Opaque var(--bg-secondary) + shadow
transition: width 0.3s transition: transform 0.3s (GPU)
var(--green, #3fb950) var(--success)
No keyboard handlers on divs role="button" tabIndex={0} onKeyDown
visual-diff-full

Test plan

  • bun run build passes clean (TypeScript + Vite)
  • Visual verification: Settings nav active state
  • Visual verification: FileBrowser active entry
  • Visual verification: Sidebar branch active state
  • Visual verification: Progress bar animation smoothness
  • Visual verification: Toast styling
  • Keyboard test: Tab through GitPanel section headers, press Enter/Space
  • Mobile: CommandWidget/NewSessionSheet render without blur artifacts

🤖 Generated with Claude Code

paulovitin and others added 2 commits June 27, 2026 22:58
Systematic pass across 5 audit dimensions: accessibility, performance,
theming, anti-patterns, and design-system alignment. Addresses all P0/P1
issues and most P2/P3 items identified by the impeccable audit tool.

## Side-stripe borders eliminated (DESIGN.md absolute ban)

- Settings navItem.active: inset box-shadow → accent-tinted background
- FileBrowser entryActive: inset box-shadow → border ring
- Sidebar branchItem.active: border-left → background tint
- ActivityDashboard row: border-left → removed
- WorktreeManager: border-left → removed
- PromptDrawer selected: border-left → background tint
- Sidebar globalWorkspaceEntry: transparent border-left → padding

## Glassmorphism removed (DESIGN.md absolute ban)

- Mobile CommandWidget: backdrop-filter blur → opaque bg + shadow
- Mobile NewSessionSheet: backdrop-filter blur → opaque bg + shadow
- Mobile IdeasOverlay: backdrop-filter blur → opaque bg + shadow

## Performance: layout animations → GPU-composited transforms

- 8 progress bars: transition width → transform scaleX()
- TriStateToggle knob: transition left → transform translateX()
- Eliminates layout recalculation on every animation frame

## Token system completed — zero orphan hex remaining

- Migrated ~50 hard-coded hex colors → semantic tokens
- Created new tokens: --changes, --urgent, --search-match,
  --search-match-active, --search-match-border, --tweak-highlight
- Removed all var(--token, #fallback) redundancies (~35 instances)
- Fixed wrong token names: --green/--red/--yellow → --success/--error/--changes,
  --danger → --error, --ok → --success, --color-error → --error
- Converted rgba() patterns → color-mix(in srgb, var(--token) N%, transparent)

## Keyboard accessibility hardened (WCAG 2.1.1, 4.1.2)

- Added role="button" tabIndex={0} onKeyDown to 26 interactive divs
- Created src/utils/a11y.ts utility (onClickKeyDown helper)
- Components: GitPanel (7), Sidebar (5), Settings (3), SmartPromptsTab (2),
  AIChatPanel, McpPopup, CommandOverview, Terminal, DiffFileList,
  PrDetailContent, PromptOption, FileBrowser, Toast, TaskQueue,
  AiTriage, ReferencesPanel

## Documentation

- PRODUCT.md: added Platform section (desktop-only, Tauri v2)
- DESIGN.md: added Platform note (no responsive/touch-target scope)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- TabBar.test: assert transform scaleX() instead of width %
- BottomTabs.test: assert absence of backdrop-filter (design ban)

Co-Authored-By: Claude Opus 4.6 (1M context) <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.

1 participant