Local-first AI coding agent desktop: Electron + Rust host core + pi Agent Harness + user-installable plugins
TypeScript ai-agentcoding-agentdesktop-appelectronglobali18nlocal-firstmcppipi-agentpi-desktoppluginsreactrusttypescript
Renderer & UI — Agent Rules
Scoped rules for apps/desktop/src/. These tighten the root AGENTS.md;
on conflict the rules here win.
Shared UI primitives are mandatory
Every renderer component must use the shared primitives from
components/ui.tsx and components/settings/. Inline reimplementation
of any shared primitive is a spec violation.
Primitive catalog
| Need | Component | Source |
|---|---|---|
| Button | Button |
components/ui.tsx |
| Text input | Input |
components/ui.tsx |
| Password input | PasswordInput |
components/ui.tsx |
| Textarea | Textarea |
components/ui.tsx |
| Form field (label + hint) | Field |
components/ui.tsx |
| Boolean toggle (switch) | SettingsToggle |
components/ui.tsx |
| Multi-option segment | SegmentedControl |
components/ui.tsx |
| Checkbox | Checkbox |
components/ui.tsx |
| Checkbox group (array multi-select) | CheckboxGroup |
components/ui.tsx |
| Native dropdown (non-Settings) | Select |
components/ui.tsx |
| Settings dropdown | SettingsMenuSelect |
components/settings/SettingsMenuSelect.tsx |
| Status badge | Badge |
components/ui.tsx |
| Card container | Panel |
components/ui.tsx |
| Icon-only button with tooltip | TooltipButton |
components/ui.tsx |
| Inline help | HelpIcon |
components/ui.tsx |
| Settings layout | SettingsCard, SettingsRow |
features/settings/primitives.tsx |
Prohibited patterns
<button role="switch">with manualsettings-toggleclass → useSettingsToggle<div className="settings-segment">with manual button loop → useSegmentedControl<label><input type="checkbox"/>…</label>→ useCheckbox<select>orSelectin Settings pages → useSettingsMenuSelect<button className="btn-*">with manual class assembly → useButton<span className="badge-*">with manual class assembly → useBadge
When to add a new primitive
Add to components/ui.tsx when the same pattern appears (or will appear)
in three or more files. The new component must:
- Use existing CSS classes from
styles/ui-kit.cssorstyles/settings.css - Accept
classNamefor composition - Include proper ARIA attributes
- Be exported from
components/ui.tsx(orcomponents/settings/for Settings-specific primitives) - Be documented in
docs/spec/04-ux/07-ui-design-system.md§11