Skip to main content

ADR 0002: Use React for the Desktop UI


Context​

The UI must support calm, keyboard-friendly flows: Applications, Queue, Follow-ups, Preferences, Agent, Timeline — dark mode first, Jj* components, accessibility, and reduced motion. The renderer is presentation-only; domain and egress stay in the host.

Alternatives considered:

OptionProsCons
ReactEcosystem, a11y patterns, hiring familiarityFootgun if business logic leaks into UI
SvelteSmaller runtimeSmaller shared design-system ecosystem
SolidFine-grained perfLess common for contributors
Immediate-mode native UIMax native widgetsFights web design-system docs

Decision​

Use React (TypeScript) for app/ui, consuming shared primitives from packages/ui.

  • Components follow Jj{Domain}{Element} naming.
  • Tokens: Midnight Ink, Electric Teal, Inter — per brand guidelines.
  • UI talks to the host only via the narrow IPC bridge (ADR 0013).
  • Prefer modern React patterns already adopted by the team; avoid premature memoization theater.

Consequences​

Positive​

  • Maps cleanly to design-system and copy guidelines.
  • Strong a11y and testing options for privacy chrome and live regions.
  • Contributors can work on UI without touching Rust host.

Negative / tradeoffs​

  • Discipline required so React does not become a second data plane.
  • Bundle size must stay humble inside Tauri webview.

Follow-ups​

  • packages/ui owns tokens and Jj* primitives; feature views live in app/ui.
  • Storybook (or equivalent) optional later — not a Horizon 1 blocker.