Files
paseo/docs/design.md
T
Mohamed Boudra d5d385afa7 Show each provider's state in the list and open one provider page everywhere (#9661)
* fix(app): leave providers that are not installed out of the model picker

An agent's own provider stays in its selector, labelled Unavailable.

* feat(app): open a provider's detail as a Settings page or a sheet

Settings → Providers now pushes a provider page, like Projects and Plugins;
the model picker gear and setup keep a sheet. Both frame one body, ordered
error, Enabled, Installation, Models, Troubleshooting, Danger zone, so the
old sheet's sticky footer and Retry button are gone. Refresh lives once, in
the Troubleshooting status row.

The page header (back link, icon, title) moves into the shared settings kit
so projects, plugins and providers line up on the same rails.

* feat(app): show each provider's version, updates and faults in the list

Each row now says how its provider is: version and model count, Update
available, a spinner while an update runs, a red dot with the error, or
Not installed / Disabled. Only a broken provider gets a dot, and a
provider that is not installed has no switch, since the model picker
already leaves it out. The kebab is gone; Remove lives on the detail.

Rows read the same installation and update queries as the detail, so
opening a provider costs no new requests. Hosts without
providerInstallation still get a correct list from the snapshot alone.

Add provider is a "+ Provider" button in the header and a muted last row;
both open one sheet with search and catalog rows, replacing the tile grid.
After Add, the new provider's detail opens.

The row is the settings kit's detail row, which gains a leading icon, a
hint status (spinner, error dot, or a held line) and a control before the
chevron. The Unistyles test stub now applies withUnistyles theme mappings,
so browser tests render components that read colours through the theme.

* feat(app): open setup's provider pages over the setup card

The detail and Add provider sheets take the setup card's frame and a back
arrow, so they read as pages of setup instead of a sheet over it. The step
is renamed "Your providers" to match the list it shows.

* docs: describe the provider list and pages as they are now

* fix(app): keep settings rows one height and on one icon rail on phones

On touch layouts a switch reserves a 44px control, so in the provider list
rows with a switch stood 10px taller than "Not installed" rows without one.
Card rows now reserve a default control's height, the rule nested rows
already follow.

A compact SettingsRow wrapped with a full `gap`, which added 12px on top of
the leading slot's margin: catalog icons sat 24px from their labels instead
of 12px. The wrap only needs space between lines, so it uses `rowGap`.

* fix(app): keep a provider row's error to one line

A long or multi-line error wrapped the hint to two lines with the dot
centred between them. The row cuts it to one line; the provider's page
shows it in full.

* fix(app): title a provider's Settings page like a project's

The page title and the detail header both named the provider. The screen
now titles it "Providers" and the page names the provider once, the way a
project's page does.

* fix(app): keep a settings row's switch out of the row's button

The provider row's switch rendered inside the row's <button>. That is
invalid markup, and keys reached both: Enter on the switch toggled it and
also opened the provider's page, and Space on it opened the page without
toggling.

SettingsRowHeader now lays its press target under the row's content as a
sibling of the control. The content lets presses through to the button and
stays out of the accessibility tree, where the button's label already names
the row. Hover is tracked on the row, so it holds over the switch.

* fix(app): reserve a control's height only on rows that open something

The previous change gave every card row a control's minimum height and
the design doc said so, but rows built directly on settingsStyles.row
(66 uses) never got it: a single-line row was 48px or 64px depending on
which code path built it.

The minimum now belongs to SettingsRowHeader, the row with an optional
control slot, so a list where only some rows carry a switch keeps one
height. SettingsRow and hand-built rows take their content's height again,
as on the base branch, and the doc states the narrower rule.

* test(app): give the Unistyles stub the light theme's full colours

Since the stub started applying withUnistyles theme mappings, a mapping
reading a colour the stub's theme lacked crashed: the markdown styles read
colors.terminal and failed the plan card disclosure tests. The stub's
colours now start from the light theme, with its own values pinned on top.

* test(app): find the provider page's buttons in the compact sheet

On compact layouts AdaptiveModalSheet puts its testID on the header only,
so buttons in the page body cannot be found inside it. The spec looks them
up on the page, as it did before the page moved into the sheet.

* fix(app): let screen readers read a settings row's state line

The row's button carries the row's name as its label, so only the title is hidden from assistive tech now; the hint below it (a provider's version, error or Not installed) is read again.

The Enter-on-switch test now dispatches its key events synchronously inside one act. An awaited keyboard call let the Switch's animation run a frame after the test, which Vitest reported as an unhandled error and failed the run.

* fix(app): don't open a provider's page after its Add sheet was closed

Adding a provider waits for the daemon to probe it. If the user closed the sheet during that wait, the completed add still navigated to the provider's page. The add now remembers which sheet session started it and only opens the page if that session is still current.

* fix(app): say Not installed for a disabled provider that is not installed

A disabled provider's snapshot status is unavailable, so the row said Disabled even when the binary was missing. The installation inspection is checked first, so Not installed wins over Disabled.

* fix(app): keep a saved provider choice visible when it is not installed

The provider picker drops unavailable providers. A schedule or metadata-generation setting saved against such a provider then showed Select model. The picker now keeps the saved provider, labelled Unavailable, so the user sees what is set and can change it.

* test(app): wait for an added catalog provider's probe before continuing

Adding a provider opens its page only after the daemon probes it, which can outlast the default expect timeout on CI.

* refactor(app): name the provider picker's connection and saved-choice options

Callers passed a bare true to reach the saved-choice argument.

* fix(app): show a provider page's loading and not-found states

A provider page opened from its URL (a reload, a cold start, a shared link) rendered its title over nothing until the host's providers arrived, and forever when the id named a provider the host doesn't have. The page body now says Loading..., that the host is offline, that the providers couldn't be read, or that the provider isn't on this host, in the same notice card the provider list uses when it is offline. The page and both sheet frames share the body.

* fix(app): don't call a just-removed provider missing while its page closes

The daemon can publish the provider list without the removed provider before it answers the config patch, so the page said "This provider isn't on this host" until the answer arrived and it navigated away; in a sheet, through the exit animation as well. A page that has shown its provider now shows nothing once it leaves the list. The not-found notice is for a page that never found its provider. The removal e2e holds the config answer so it always sees that order.

* fix(app): show the not-found notice when a provider is removed elsewhere

The page hid the notice for any provider it had shown before, to cover its own Remove. A removal from another client, the CLI or a plugin then left the page blank with no way to tell why. The page now owns its Remove: while that runs and once it succeeds the body shows nothing, and any other absence says the provider isn't on this host.

The removal e2e routes only the e2e daemon's socket, so the fixture's port-6767 guard stays in force.

* fix(app): show progress on the provider page's in-flight buttons

Remove, Add model and the diagnostic re-run now show their work on the
pressed control, like the page's Refresh and Update: a spinner, no
further presses and, on a labelled button, "Removing..." or "Adding...".

Remove kept its label and only disabled itself, and the page went blank
mid-removal: the daemon publishes the provider list without the removed
provider before it answers the config patch, so the body had nothing to
show and each frame's title fell back to the raw id. The removal now
keeps the entry the user confirmed, and one hook feeds the frame's title
and the body, so both keep showing the provider until the page closes.
The in-flight state also starts after confirmation, not while the
dialog is open.

The diagnostic sheet's header icon buttons had lost the base branch's
spinner and dimming; SheetHeaderIconButton now takes loading and
disabled, the way Button does.

* fix(app): don't leave a re-added provider's sheet stuck on Removing...

The setup step and the model picker's gear keep a provider's sheet
mounted after it closes, keyed by provider. A finished removal stayed
set in that sheet, so adding the same provider back reopened it with
Remove spinning and disabled. A finished removal now ends when the host
lists the provider again.

* fix(app): keep the composer's remembered provider in its picker

The picker leaves out providers that aren't installed, except the one
holding the picker's current choice. The schedule form and metadata page
passed that choice; the new-agent composer didn't, so a remembered
provider not installed on this host vanished from the picker and the
trigger read "Select model" with no reason given. The builder now requires
every caller to say what its current choice is, or null.

* fix(app): guide a missing catalog provider's install and keep custom models while one fails

A provider added from the Add provider catalog runs through the generic ACP client, which reports
no installation, so its page said nothing when the CLI was missing. The page now shows the
Installation section's Not installed row with Install opening the catalog's guide. A link the
host supplies still wins.

Custom models live in config, so the page lists them and offers Add model whenever the provider
is enabled and installed, including while it fails. The provider's own models, and the search
over them, still show only while it runs.

* fix(app): make settings rows pressable on iOS and Android

React Native 0.86 no longer exports StyleSheet.absoluteFillObject, and
Unistyles' native StyleSheet copies it from React Native, so the spread
was empty there. The row's press target then had no size: on Android,
tapping a provider row or a Voice row did nothing. Web was unaffected
because Unistyles' web StyleSheet still defines the key. Use
StyleSheet.absoluteFill, as the rest of the app does.

* fix(app): let setup's provider sheets leave out the close button again

The base's sheet header rewrite dropped SheetHeaderView's showCloseButton,
which the provider page and Add provider sheets pass when setup's back
arrow is the only way out. Restore it on the header.

* test(app): prove a refresh clears a failed update from the provider's row

The update-failure journey now also walks the provider list: after Refresh
on the page the row reads its version and model count with no error dot,
and a refresh from another client clears a row that is open in the list.
Without the provider.installation.update.cleared handling both row checks
fail. The helper's Refresh now uses the page's Troubleshooting button,
since Settings opens the provider as a page, not a sheet.

* fix(app): show a catalog provider's install guide on hosts that cannot report installations

A host without providerInstallation returns an unsupported installation,
which the page passed through, so a catalog provider whose CLI is missing
showed no Installation section and no guide anywhere. The guide is the
app's own catalog data, so the page builds the same Not installed row
from it on those hosts.
2026-11-19 21:30:31 +07:00

46 KiB
Raw Blame History

Design

Tokens — every color, font size, weight, spacing step, radius, icon size — live in packages/app/src/styles/theme.ts.


1. Character

Paseo is minimal, spacious, quiet, confident. Whitespace is deliberate. Nothing crowds, nothing decorates, nothing apologizes. A row, a label, a control. That is the bar.

The app is calm so the user's work is not. Every visual decision serves either act on this or understand this — never look at this.

Consistency comes from component reuse, not from hand-matching styles across surfaces. A row in the projects list, a row in settings, and a row in a modal are the same component, not three implementations that happen to look alike. When two surfaces do the same semantic thing in two different ways, one of them is wrong.


2. Component reuse

A semantic element used in three or more places is a primitive. One of a kind is a screen.

Primitives live in packages/app/src/components/ui/ and packages/app/src/components/headers/. Card and row layout live in packages/app/src/styles/settings.ts. Section structure lives in packages/app/src/screens/settings/settings-section.tsx.

A pressable styled to look like a button is wrong; the button is <Button> (packages/app/src/components/ui/button.tsx). A pressable wrapping an icon is wrong; the icon action is <ToolbarButton> (packages/app/src/components/ui/pane-content-toolbar.tsx), which owns the hitbox, the rounded interactionHighlight fill on hover and press, the compact size, and the tooltip. Rows on a menu surface are <MenuItem>, or <ComposerTrackRow> in a track panel; other rows are <PressHighlight> (packages/app/src/components/ui/press-highlight.tsx), which owns the pressed feedback: pass the pressed fill as highlightStyle and never paint it in your own style. iOS and web paint that fill; Android draws the platform ripple over the content instead, clipped to the row's corners. On native, feedback waits for a short press delay so a scroll that claims the touch shows none. Content that knocks out of the row's surface, such as a badge ring, follows the fill through onHighlightChange. A bare <Text> styled to look like a section header is wrong; the section header is <SettingsSection> (packages/app/src/components/settings/headings/settings-section.tsx). A docs link in its header is its link prop, which renders Label ↗ on the title's rail; a ghost button with an arrow is wrong. A custom Modal for a confirmation is wrong; the confirmation is confirmDialog (packages/app/src/utils/confirm-dialog.ts). A hand-rolled overflow menu is wrong; the menu is <DropdownMenu> (packages/app/src/components/ui/dropdown-menu.tsx). A hand-rolled status pill is wrong; the pill is <StatusBadge> (packages/app/src/components/ui/status-badge.tsx). A circle pinned over a scrolling surface is wrong; the floating action is <FloatingActionButton> (packages/app/src/components/ui/floating-action-button.tsx), one per surface, and the surface reserves FLOATING_ACTION_BUTTON_CLEARANCE below its content so the button never traps the last row.

Before adding a new component, read components/ui/. The primitive usually exists.


3. Hierarchy

Hierarchy is conveyed through weight and color, not size. Most interface text is fontSize.base; compact metadata and hints use fontSize.sm. The distinction between a row's primary line and its secondary line is foreground versus foregroundMuted.

The authored interface ramp uses a 14px base. New native installs default to 15px; web and desktop default to 14px. The Appearance Interface size setting is the rendered fontSize.base value and scales the rest of the UI ramp proportionally. Primary readable content has its own fontSize.content, which defaults to 16px on native and 15px on web and desktop. It owns message bodies, composer input, Markdown, and PR prose. Controls, navigation, metadata, tool chrome, code, diffs, editors, and terminals stay on their interface or code tokens. Code size remains independent.

Weight has three tiers, applied by role:

  • Screen titles — the title in app chrome — use <ScreenTitle> (packages/app/src/components/headers/screen-title.tsx), which renders fontSize.base at weight 400 on compact and 300 on desktop. The New workspace hero is the only larger product title; it uses fontSize["2xl"] (packages/app/src/screens/new-workspace-screen.tsx).
  • Structural labels use fontWeight.medium. This applies to section labels above a stack of rows (packages/app/src/components/agent-list.tsx:519-523, packages/app/src/components/keyboard-shortcuts-dialog.tsx:63-67), form field labels above an input inside a modal (packages/app/src/hosts/add-host/internal/add-host-modal.tsx:19-23, packages/app/src/hosts/add-host/internal/pair-link-modal.tsx:24-28), the title at the top of a modal/sheet/dialog (packages/app/src/components/adaptive-modal-sheet.tsx:90-94, packages/app/src/components/ui/combobox.tsx:1607-1611, packages/app/src/components/welcome-screen.tsx:48-53), action button labels in tight components such as the sidebar callout actions (packages/app/src/components/sidebar-callout.tsx:218-221), and inline data emphasis on dense metadata rows (packages/app/src/components/git-diff-pane.tsx:2322-2327, packages/app/src/components/file-explorer-pane.tsx:1115-1122).
  • Content uses fontWeight.normal. This applies to settings rows (packages/app/src/styles/settings.ts), sidebar primary list-item titles (packages/app/src/components/sidebar-workspace-list.tsx:2680-2686, packages/app/src/components/agent-list.tsx:572-578), <StatusBadge> text (packages/app/src/components/ui/status-badge.tsx:56-60), and <SidebarCallout> titles (packages/app/src/components/sidebar-callout.tsx:175-180).

The rule, condensed: text that names a surface or a group is medium. Text that lives inside a surface or a group is normal. Top-of-screen titles are <ScreenTitle>, which is lighter still.

Foreground is for the thing being acted on: row titles, section headings, the selected sidebar item. foregroundMuted is for context: hints, descriptions, secondary metadata, idle sidebar items, placeholders, status text. The composer's empty placeholder is quieter; it uses foregroundExtraMuted.

foregroundExtraMuted is reserved for passive chrome that must sit behind muted text, such as an always-visible window control, and for the composer's empty placeholder. Use the solid token instead of lowering SVG opacity; per-path opacity makes overlapping icon strokes render unevenly. Interactive hover and pressed states return to foreground.

A theme states places and identity; packages/app/src/styles/derive-colors.ts derives their relationships. Sidebar hover and selected fills step from the sidebar toward the foreground. For plugin themes, passive text on those states derives against the actual state surface; page tertiary text is a separate relationship. Explicit plugin semantic overrides take precedence over derived defaults. Built-in themes retain their chosen passive text. packages/app/src/styles/theme-contrast.test.ts checks the built-in and representative plugin palettes against contrast floors.

Accent is the one CTA per surface. A <Button variant="default"> filled with accent appears at most once on a page. Most pages have zero — settings is mostly toggles and text, the workspace pane is mostly content, the chat composer is the input itself.

Destructive is a color, not a click. Restart-daemon and remove-host are <Button variant="outline"> in the row trailing slot; the destructive surface only appears inside the confirmDialog (packages/app/src/screens/settings/host-page.tsx:541-547). Workspace archive opens a confirm dialog before any red appears (packages/app/src/components/sidebar-workspace-list.tsx). Red appears after the user has indicated intent.


4. Buttons

The button is <Button> (packages/app/src/components/ui/button.tsx). It has five variants. Each has one job.

default is the one primary action on a surface — filled with accent. At most one per page. The primary slot inside an <AdaptiveModalSheet> and the highlighted action on the welcome screen are the canonical uses.

secondary is the paired action when two actions carry equal weight — filled with surface3. The component default is secondary, which matches its frequency in the codebase.

outline is the low-frequency action that lives on a row — transparent with borderAccent. Restart, Remove, Update on host detail (packages/app/src/screens/settings/host-page.tsx:585-594).

ghost is structural and non-committal — no border, no fill. Back arrows, header toggles, "Load more" footers (packages/app/src/screens/sessions-screen.tsx:54-63), more-affordances. Ghost is used when the affordance is part of the chrome, not a decision.

Header and toolbar controls use interactionHighlight for hovered, pressed, open, and selected backgrounds. It is a translucent semantic fill so the same control works over the main surface and the sidebar. Apply it as backgroundColor; setting opacity on the control also fades its content.

destructive is filled with destructive. It only appears inside a confirm. The button on the page is outline; the destructive button is the confirm button inside the dialog.

Controls come in two sizes, defined once in control-geometry.ts. The default is the right size almost everywhere — pages, dialogs, forms, settings rows, the setup flow — so don't pass a size. It is 32px tall where a pointer drives it and 44px where controls are touch-sized, so every touch control meets the iOS HIG's 44pt hit region. sm is 28px pointer and 32px touch, with fontSize.sm labels, and is for tight chrome only: toolbars, nested settings rows, dense inline row actions. A size="sm" on an ordinary page or dialog is wrong, and so is choosing a size from useIsCompactFormFactor().

Dense toolbar rows, such as the composer's, are the exception to the 44pt control. Touch-sized the row is 44pt tall and each control is a 36pt circle (TOOLBAR_DISC_SIZE): send and stop fill it, and every other control's pressed highlight fills it, so every highlight is the same fully rounded shape. Labelled pickers are 36pt pills. A control lays out at its full highlight (toolbarSlot, toolbarContentSlot) with no gap between controls (TOOLBAR_CONTROL_GAP), so neighbouring highlights touch and never overlap. Touch-sized toolbar glyphs are 20pt at the app's 1.5px stroke. An icon-only control's glyph matches the header icons and rests at foreground; a glyph beside a label rests at foregroundMuted so the two read as one quiet unit (toolbarGlyphsFor). The context ring is 18pt with a 2px stroke (TOOLBAR_RINGS): a circle fills its box where an outline glyph does not, and a thin circle reads lighter than a glyph at the same stroke. A disc's solid glyph, such as the stop square, stays at the md size (TOOLBAR_DISC_GLYPH_SIZES). Pointer-sized toolbars keep 28px controls, a 4px gap, and a 16pt muted glyph that brightens on hover.

In the composer, the first glyph's ink starts on the text column's edge, and the trailing control is always a disc, so the row does not shift as it changes between voice mode, send and stop. The disc nests into the corner, as far from the right edge as from the bottom, and touch-sized the composer's corner radius is concentric with it (packages/app/src/composer/input/toolbar-rails.ts). Touch-sized the disc keeps a 6pt clearance from its neighbour, because it is always painted and a pressed neighbour would merge with it. The attach button sits 2pt closer to the picker than its highlight would put it: the plus is all thin arms, so the full gap reads wide. That offset is set by eye.

One gate, resolveControlSizing, picks touch or pointer sizing: touch when the layout is compact or touch is the primary input. An iPad with the sidebar docked is wide and touch-sized; a desktop is pointer-sized; a phone is both compact and touch. The primary input comes from (pointer: coarse) (hasTouchPrimaryPointer in hooks/pointer-capabilities.ts), not from whether a touch screen exists: WebKit keeps touch primary on an iPad with a trackpad attached, and Chromium reports a fine primary pointer for a laptop with a touch screen that its trackpad drives. The fact is read once at startup: attaching a pointer to a tablet does not shrink its controls, and a 2-in-1 launched with a pointer keeps pointer sizes after it switches to tablet mode until the app reloads. Stylesheets take sizes from bySizing({ touch, pointer }), which resolves to a breakpoint value, so a caller never sees which sizing it got. Rows, icon buttons and icon slots take theirs from styles/density.ts, which uses the same gate. An { xs, md } literal for a hit target or glyph is wrong: on an iPad it yields the pointer size.

Buttons are pills (borderRadius.full) with medium-weight labels; an icon-only button is a circle. <Switch> follows the same two sizes: a 34×20 track by default and in sm, 44×26 where controls are touch-sized, and it reserves its size's control height so a row holding one lines up with a row holding a button. Buttons, text fields, dropdown triggers, and <SegmentedControl> (packages/app/src/components/ui/segmented-control.tsx) share the size contract — the same size name means the same height and label size on every control kind, so controls in one row line up. Segments run tighter than a button, because the gap between segments already reads as padding. The selected segment is a surface3 fill with foreground text, not an inverted one — inverting it inside thin chrome puts a white slab in the toolbar. A settings row sizes the controls in its trailing slot itself, default in a card and sm when nested (packages/app/src/components/ui/control-size.tsx), so don't pass a size to a button, dropdown or field placed in a row. Code that computes with a control's height outside a stylesheet uses controlHeightForLayout. Never shrink a control's font or padding locally to fit a context — if the context needs a smaller control, the size tier is missing or the wrong one is in use.

A <Pressable> wrapping a <Text> is a sixth variant. It is wrong. <Button> accepts style, textStyle, leftIcon, disabled, size, and variant.


5. Borders

Borders group, separate, or rarely emphasize.

A logical block of related rows lives inside a card — one border around the whole group. The card primitive is settingsStyles.card; the keyboard-shortcuts dialog uses the same shape inline (packages/app/src/components/keyboard-shortcuts-dialog.tsx:68-73). The border defines what belongs together.

Rows after the first inside a card carry settingsStyles.rowBorder — a single top border. The first row never has one. The same divider pattern appears in the keyboard-shortcuts dialog rows (packages/app/src/components/keyboard-shortcuts-dialog.tsx:74-83). Rows do not need their own background to feel separated.

A list that is itself the page content — sidebar items in sidebar-workspace-list.tsx, the workspace list, the agent list (packages/app/src/components/agent-list.tsx) — uses spacing and surface, not borders, to separate items. Rows-in-a-card is an interior pattern; lists-as-pages are not.

Pane chrome — the workspace pane header, the file-explorer header, the diff pane header — uses a single bottom border to separate the header from the content (packages/app/src/components/git-diff-pane.tsx:2328-2331). One border, no shadow.

borderAccent is reserved for the outline button. Inputs use border. Single-thing borders are wrong; a single bordered element is either a card with one row (use the card) or it does not need a border.


6. Pickers

Five primitives. The pick is determined by option count, the need to search, and how the picker is anchored.

<DropdownMenu> is for a small fixed set anchored to a trigger. Theme picker, kebab menus on workspace and project rows (packages/app/src/components/sidebar-workspace-list.tsx:684-770), row "more" menus. Items can be async (status: "pending") and can include destructive entries. Under ~10 options where the user knows what they're looking for.

<Combobox> is for a large or searchable list. Host switcher in the sidebar footer, model selector in the composer, branch switcher in the workspace header (packages/app/src/components/branch-switcher.tsx). The user types to find the option, or the list is long enough to scroll.

<ContextMenu> is for right-click and long-press on a target. The row is the trigger; there is no visible affordance. Used for incidental actions on workspace rows in the sidebar (packages/app/src/components/sidebar-workspace-list.tsx).

<AdaptiveModalSheet> is for a focused task. Multi-field forms (packages/app/src/hosts/add-host/internal/add-host-modal.tsx, packages/app/src/hosts/add-host/internal/pair-link-modal.tsx, packages/app/src/components/project-picker-modal.tsx), confirmations with detail, anything that earns a backdrop. Bottom sheet on compact, centered card on desktop. Both sit on surface0, the same base as a screen, so settings cards and inputs inside a modal read the way they do on the Settings screen. Raw Modal is wrong for any of these.

<AdaptiveModalSheet> owns the presentation. Its content inset — the gutter that puts sheet content on the same rails as the sheet header — and compact bottom safe-area padding are the sheet's, not the caller's. A caller declares layout intent through contentStyle and never branches on form factor to add its own margins. If a sheet's first snap point is shorter than its header, content, and safe-area clearance, raise that snap point rather than moving the sheet container.

The sheet header (SheetHeaderView) is the only sheet title row. A sheet that brings its own Gorhom modal still renders it. Back, Close and every action passed through header.actions are SheetHeaderIconButton, so all of them get the header island's chrome, as CompactHeader does: one frame, glyph, colour and hover. The first and last buttons hang into the row's padding, so their glyphs sit on the content rail.

confirmDialog is for destructive yes/no and imperative confirmation. Promise-based: await confirmDialog({ destructive: true, ... }). Anything where a wrong click loses work.

Three themes is DropdownMenu. Thirty hosts is Combobox. A label and a value is AdaptiveModalSheet. "Are you sure?" is confirmDialog.


7. Density and rhythm

Settings detail pages, the projects detail page, and any list+detail content sit inside a centered, max-width 720 column (packages/app/src/screens/settings-screen.tsx, packages/app/src/screens/projects-screen.tsx). Lines stay readable, the eye does not have to track wide horizontal distances. Form modals carry their own narrower content frame (packages/app/src/hosts/add-host/internal/add-host-modal.tsx).

Workspace and chat surfaces use the full width — these are working surfaces, not reading surfaces. The composer carries MAX_CONTENT_WIDTH from packages/app/src/constants/layout.ts to keep lines readable while letting the workspace pane fill the rest.

Sections sit apart. <SettingsSection> owns its own bottom margin; the next thing is wrapped in another <SettingsSection>. The agent-list sectionHeading carries the same marginTop/marginBottom rhythm (packages/app/src/components/agent-list.tsx:511-517). Adding marginBottom to a section is wrong.

A section or group explains itself through the info prop on <SettingsSection> or <SettingsGroup> — an info icon beside the header that opens a tooltip (packages/app/src/components/settings/headings/settings-info-tip.tsx). A muted paragraph between the header and the card is wrong: it sits in the section's own gap, so it reads as a second heading rather than as prose belonging to the header. Explanatory copy that describes one row belongs to that row, as settingsStyles.rowHint inside the card.

Cards inside a section sit closer than sections. Rows inside a card touch — only the divider separates them. The rhythm is page → spacious; section → spacious; card → tight.

Rows have generous vertical padding: roughly 16px of content plus 16px of vertical padding for settings rows, 8–12px for sidebar list items where many rows must fit. A row that opens something (<SettingsDetailRow>, a collapsible row's header) is at least as tall as one holding a default control, so a list where only some of those rows carry a switch keeps one row height. Other rows take their content's height. Compressing rows below the established density to fit more on the screen is wrong. Too many rows means more cards or more sections, not smaller rows.

Rows revealed under a <SettingsCollapsibleRow> are nested rows, one step smaller than card rows: 8px of vertical padding, fontSize.sm text, sm controls, and one fixed height so rows with and without a trailing button line up. The collapsible row sets this for everything under it (packages/app/src/components/settings/row-density.tsx). Never pass a density to a row, and never pad or resize a nested row by hand. Settings rows that share a menu surface with menu rows, such as Usage's options, go inside <MenuSettingsRows>, which puts their labels on the menu rows' label rail (menuRowContentInset).

The whitespace is the design.


8. Alignment

Things align to their glyphs, not to their boxes. A row's leading icon, its title, and the label of the button in its trailing slot sit on the same rails — the ink lines up, not the padding, not the touch target, not the hover background.

Pick the rails from the content, then hold them. A settings card establishes a leading rail at the icon's left edge and a trailing rail at the last glyph's right edge; every row in that card uses the same two. A row whose icon is absent still starts its title on the leading rail. Indentation is a new rail, not an arbitrary offset.

The pressable is bigger than the glyph, and that is fine. Hit areas grow outward from the aligned content — they never move it. A button that looks two pixels off because its padding is asymmetric is misaligned even though its box is correct. The composer toolbar is the worked example: its outermost ink, the attach + on the left and the trailing glyph or send/stop disc on the right, sits on the text column's edges, and touch-sized the end highlights overhang into the composer padding by each end control's ink inset (composerToolbarOverhang).

Optical alignment beats arithmetic when a glyph disagrees with its bounding box. Icons with visual weight on one side, chevrons, and single-character labels usually need a small nudge to look centered. Trust the eye, then leave a comment saying the offset is optical.

One row off the rail makes the whole card look unconsidered.


9. Responsiveness

Compact-first. The small case is designed; the large case adds chrome around it.

Use md: 600 for the compact/wide layout boundary, in logical points on native and CSS pixels on web. Do not add a separate density breakpoint; touch sizing comes from the control sizing gate in Buttons. Measured content constraints remain independent: composer controls use COMPACT_CONTENT_WIDTH (500), so a narrow pane can keep compact controls inside a wide window.

The settings shell (packages/app/src/screens/settings-screen.tsx) and the projects screen (packages/app/src/screens/projects-screen.tsx) share the canonical list+detail navigation pattern:

  • On compact: full-screen list with <BackHeader> at the top. Tapping a row pushes a full-screen detail with its own <BackHeader> that returns to the list.
  • On wide layouts: a sidebar on the left holds the list with surfaceSidebar background. The content pane on the right holds the selected detail with <ScreenHeader>, <HeaderIconBadge>, and <ScreenTitle>.

The branching is one useIsCompactFormFactor() check at the top of the screen component. The list and the detail are the same components in both layouts; only the framing changes.

The workspace screen (packages/app/src/screens/workspace/workspace-screen.tsx) follows a different but parallel rule: tabs collapse on compact, panes split on desktop. The sidebar (packages/app/src/components/left-sidebar.tsx) is overlaid on compact and pinned on desktop.

On a narrow window using the wide layout, app navigation yields when the remaining width cannot accommodate the content topology. Settings prefers a 720px split (320px list + 400px detail); its list shrinks first to keep forms readable without reducing the detail below 400px. Explorer reserves at least 240px plus a 360px workspace. These are local space budgets, not compact breakpoints. The app sidebar shrinks from its preferred 320px toward a 200px minimum to leave a 400px center target; its preferred width fits at 720px. Temporary width clamps are render-only; widening restores the user's saved sidebar widths.

Electron window controls are top-corner obstructions, not a compact-layout condition. Rendered surfaces declare which top corners they physically occupy; only those corners receive clearance. Full-window overlays redeclare both corners. A focused split pane owns both corners; if focus restoration temporarily exposes the full split tree, the split boundary reserves one top strip instead of assigning a control rectangle to an arbitrarily narrow leaf.

Windows and Linux controls are fixed window chrome, outside scrolling header content. A tab rail that reaches them ends at their obstruction and shows the shared overflow fade. On macOS, the Explorer toggle occupies a fixed top-right window slot so opening and closing Explorer does not move the pointer target.

Each window edge has one safe-area owner. WindowLayoutProvider publishes the bottom inset that every surface reads through useSafeAreaInsets(): on iOS 27.1 and later it is UIKit's bottom-bar clearance, which refines the rectangular home-indicator inset to the screen's corners, and elsewhere the system inset. Surfaces apply that value once and never stack their own spacing under it; WindowLayoutSurface owns the horizontal insets the same way.

A new list+detail feature copies the settings shell. A new workspace-shaped feature copies the workspace shell. Inventing a third shape happens in design review, not in a PR.


10. Copy and voice

Sentence case. "Pair a device", "Danger zone", "Restart daemon", "Inject Paseo tools", "No sessions yet", "Load more". Proper nouns retain casing — Paseo, Beta, Stable, Local. Title case is wrong.

No trailing periods on row titles, labels, or buttons. No trailing period on a single-clause hint: "What happens when you press Enter while the agent is running" (packages/app/src/screens/settings-screen.tsx:271-272). Periods exist inside multi-sentence prose: "Restarts the daemon process. The app will reconnect automatically."

Empty-state strings are short noun phrases or short sentences: "No projects yet", "Select a project", "No sessions yet" (packages/app/src/screens/sessions-screen.tsx:74-76), "Host not found".

Buttons are imperative: Save, Cancel, Restart, Remove, Update, Install update, Add host, Load more. In-flight labels are present-participle with a literal three-dot ellipsis: "Saving...", "Restarting...", "Removing...", "Loading...".

Error copy is direct. "Unable to remove host" (packages/app/src/screens/settings/host-page.tsx:697), not "Sorry, we couldn't remove the host." Recovery instructions are concrete: "Wait for it to come online before restarting." Errors describe state; they do not editorialize.

Terminology:

  • Workspace, never "checkout".
  • Host, except where the user-facing concept is the daemon process itself ("Restart daemon").
  • Project, not "repo" or "repository".
  • Provider, not "model provider".
  • Session and agent are distinct: a session is a historical entry in sessions-screen.tsx; an agent is a live entity in the workspace.

11. States

Loading is inline by default. <LoadingSpinner size={14} color={foregroundMuted} /> leads the line it relates to, never trails a label: a settings row's hint takes hintStatus="busy" while its work runs, and hintStatus="pending" holds the line with a skeleton until its value is read (packages/app/src/components/settings/row-header.tsx). Page-level loading is a centered <LoadingSpinner size="large"> (packages/app/src/screens/sessions-screen.tsx:69-72). Card-level loading is a single short line, not a spinner. In-row dropdown items use <DropdownMenuItem status="pending" pendingLabel="Removing...">; the menu item handles its own pending state.

Screen-level empty states use a centered, muted noun phrase and at most one ghost button (packages/app/src/screens/sessions-screen.tsx). Sidebar list empty states use a quiet bordered card with a left-aligned sm title, a muted sm description, and sm <Button> actions. Use secondary for the primary action and outline for a secondary action (packages/app/src/components/sidebar/empty-states.tsx). Keep both forms short and free of illustrations.

Inline errors are a single sentence in palette.red[300] xs, sitting under the field or inside the card it relates to (packages/app/src/components/ui/form-field.tsx). A settings row that is broken says so in its hint with hintStatus="error": a red dot and the error in statusDanger.

Page-level alerts — informational notices, success confirmations, warnings, or recoverable errors that need a small visible block on the page — use <Alert> (packages/app/src/components/ui/alert.tsx). Variants: default, info, success, warning, error. The chrome is quiet by design: a 1px tinted border, transparent background, a small variant-tinted icon, the title in the variant accent, the description in foregroundMuted. Actions go in the children slot as <Button variant="outline"> — recovery actions are low-frequency and outline keeps them quiet alongside the alert's accent (packages/app/src/screens/project-settings-screen.tsx). One <Alert> at a time per region.

Sidebar callouts — cross-cutting alerts that apply across the whole app, like worktree setup, Rosetta install, and desktop update available — register through useSidebarCallouts() and render in the left sidebar via <SidebarCallout> (packages/app/src/components/sidebar-callout.tsx). The chrome (top-border-only, full-width action buttons) is tuned for that ~280px column. Canonical sources: packages/app/src/components/worktree-setup-callout-source.tsx, packages/app/src/desktop/updates/rosetta-callout-source.tsx, packages/app/src/desktop/updates/update-callout-source.tsx. Never import <SidebarCallout> into a page — that's what <Alert> is for.

Imperative errors are Alert.alert("Error", "Unable to ...") (the React Native Alert API, not this component) for failures that interrupt the flow and have no place on the page.

Disabled state is opacity: theme.opacity[50] on the outer pressable. Color changes for disabled state are wrong; a disabled button is the same button, dimmer.

Partial failure (a list mostly fine but one source errored) is a bordered banner above the list, listing each failure in red-300 xs (packages/app/src/screens/projects-screen.tsx:151-159). The list still renders.

State surfaces at the smallest scope it affects. Field error stays under the field; page error is a banner; flow-stopping error is an Alert.

Changing state must not move the layout. A row that grows when its badge arrives, a card that reflows when a count resolves, a list that jumps as data streams in — all wrong. Reserve the space the loaded state will need, so the skeleton, the spinner, and the content occupy the same box. A surface that shifts under the user stops feeling calm.


12. List rows

The row anatomy is a content column with an optional trailing slot. Inside a card the row is settingsStyles.row. Inside a sidebar list the row carries its own padding and borderRadius.lg per item (packages/app/src/components/sidebar-workspace-list.tsx:2614-2625).

A trailing chevron opens a detail, as a page or a sheet (ChevronRight, iconSize.sm, foregroundMuted). The whole row is the pressable; use <SettingsDetailRow>. Pair-device row (packages/app/src/screens/settings/host-page.tsx), provider row (packages/app/src/provider-settings/internal/provider-row.tsx), project row in the projects list. A fixed right chevron means navigation. An expandable row uses a trailing right chevron that rotates down when expanded (SettingsCollapsibleRow); pressing the row reveals its child rows in place.

Kebab menus (<DropdownMenu> with <MoreVertical size={14} /> trigger) are for actions on the row, not navigation. Trigger style: padding: 2, borderRadius: 4, hover background surface2. Menu position: align="end". Items use <DropdownMenuItem leading={<Icon size={14} color={foregroundMuted} />} ...>. Visibility is isHovered || isTouchPlatform — hover-revealed on web, always visible on native (packages/app/src/components/sidebar-workspace-list.tsx:684-770).

A row may carry both a chevron and a kebab when both navigation and row-level actions apply. Chevron sits at the end; kebab sits before it.

Switches and segmented controls also sit in the trailing slot. A row that both navigates and toggles passes its <Switch> as the control of <SettingsDetailRow>, before the chevron; the switch stops the press from reaching the row (packages/app/src/provider-settings/internal/provider-row.tsx). A list the user adds to ends with a muted <SettingsAddRow>. Sidebar items that hold a status dot, a count, and a kebab follow the same rule (packages/app/src/components/sidebar-workspace-list.tsx).

Selected state on rows in a desktop list+detail uses surfaceSidebarHover as the background (packages/app/src/screens/projects-screen.tsx). Selected state on rows in the sidebar list uses surface2 (packages/app/src/components/agent-list.tsx:563-571).


13. Status pills and badges

There is exactly one token per status signal — statusSuccess, statusDanger, statusWarning, statusMerged — and every status surface uses it: PR state icons, CI check icons and pies, diff stats, file-change icons, status pills, usage bars. A surface does not get a quieter or louder variant because of where it sits. If a dense list feels loud, that is a density or weight problem; fix the density, not the color. The tokens are generated, not hand-picked — see the rule in packages/app/src/styles/theme.ts and regenerate rather than nudging one value. The level is set by the densest consumer, the sidebar workspace list.

Status dots are the one exception, and they are a family of their own — statusDotSuccess, statusDotDanger, statusDotWarning, statusDotRunning, read only by getStatusDotColor (packages/app/src/utils/status-dot-color.ts). Same hues and the same generation rule, but their own band: 90% of gamut chroma against the status family's 55–60%. A dot is a few points of solid color with no shape to read and no label attached, and the running one pulses, so at the status band's chroma the dots read dimmer than the metadata beside them — backwards, since the dot is the row's state. Lightness is set by hue separation rather than by distance from the surface: at 6pt four dark hues on a light surface all read as one dark blob no matter how much contrast they have. So the light band runs as bright as the contrast floor allows at L=0.62, the last step where all four clear 3:1 against the sidebar's surface2; the dark band sits at L=0.72, where danger turns pink above. All four move together; regenerate the set, never one hue.

Status pills use the status token for text on the shared surface3 and border shell. The neutral shell keeps the signal legible without manufacturing translucent colors outside the theme. The <StatusBadge> primitive (packages/app/src/components/ui/status-badge.tsx) is canonical; a pill never reaches into palette.

Status dots — the small filled circles next to a host or agent name — are borderRadius.full filled with the status token. Which token a given agent state maps to is owned by getStatusDotColor (packages/app/src/utils/status-dot-color.ts); a row, a group header, and a project icon all call it rather than restating the mapping. They sit in the trailing slot of a sidebar row or as a leading marker on a status pill.

Identity badges — the project icon, the sidebar host badge, and the PR-panel participant avatar — do not use the theme palette. They draw from the fixed ten-color identity table in packages/app/src/styles/identity-colors.ts, whose hexes are held to one contrast band so a color identifies rather than ranks. Project icons and PR avatars use it as a fill with a white letter — that is identityColor, one theme-independent hex per identity. Host badges use it as a foreground on both the glyph and the label, which is a different contrast problem that the fill table cannot solve: no single hex clears 4.5:1 against both a near-white and a dark sidebar. Foregrounds therefore come from identityForeground(name, colorScheme), one set per scheme, hue unchanged. That set is generated on the status family's lightness and chroma fraction, because a meta row puts a host badge beside a CI check and a diff stat, and two families at different lightness make the brighter one shout. Change the status band and this one changes with it. A host with no color assigned falls back to foregroundMuted. The table is theme-independent by design; do not fork it per theme, and do not add hexes to it without recomputing the band.

New status pills use <StatusBadge>. Identity, shortcut, and interactive link badges remain separate because color does not encode status there.


14. Forbidden

  • fontWeight.medium on row titles, body text, badge text, or <SidebarCallout> titles. Medium is reserved for the structural-label tier described in §3 — section labels, modal/sheet titles, dense metadata emphasis, and tight action labels. Anything else is normal. <ScreenTitle> is responsive 400/300 and is never overridden.
  • <Pressable> wrapping <Text> to make a button. <Button> exists.
  • Importing Pressable or a Touchable* outside components/ui/. A raw pressable has no standard press or hover feedback, so every one drifts. paseo/no-raw-pressable reports it; the files on its burn-down list in .oxlintrc.json may only leave it.
  • Bare <Text> for a section header inside settings. <SettingsSection> exists.
  • A muted paragraph between a section header and its card. Section-level explanation is the header's info tooltip (§7).
  • A "Settings" CTA on a detail page. Detail pages are settings; settings is reached from the sidebar, the host entry, or a row's kebab menu.
  • The word "checkout" in UI strings or identifiers. The term is "workspace".
  • New color tokens or hardcoded hex outside the palette. The identity color table is the documented exception (§13), not a license.
  • Placeholder text dimmed beyond foregroundMuted, except the composer's empty placeholder, which uses foregroundExtraMuted. No extra opacity, no italics, no ghost-text.
  • onPointerEnter and onPointerLeave. They do not fire on native iOS. Hover uses Pressable's onHoverIn/onHoverOut gated with isHovered || isCompact || isNative.
  • Raw DOM APIs without an isWeb guard.
  • Spacing values outside the scale. padding: 20 and gap: 10 are wrong.
  • Color changes for disabled state. Opacity only.
  • Destructive actions without confirmDialog. Restart, remove, and future destructive actions are confirmed. Archive workspace is confirmed only when its worktree backing reports uncommitted changes or unpushed commits; otherwise it archives immediately.
  • Bespoke status pills. <StatusBadge> is the pill primitive.
  • Raw Modal for a focused task. <AdaptiveModalSheet> is the modal primitive.
  • Importing ActivityIndicator directly. <LoadingSpinner> is the loading primitive.

15. Canonical surfaces by pattern

Pattern Reference
List+detail (compact stack, desktop sidebar+pane) packages/app/src/screens/settings-screen.tsx, packages/app/src/screens/projects-screen.tsx
Detail card+row packages/app/src/screens/settings/host-page.tsx, packages/app/src/provider-settings/internal/provider-list.tsx
Section grouping inside a card list packages/app/src/screens/settings/settings-section.tsx
Form modal (label + input fields, primary + cancel) packages/app/src/hosts/add-host/internal/add-host-modal.tsx, packages/app/src/hosts/add-host/internal/pair-link-modal.tsx, packages/app/src/components/project-picker-modal.tsx
Destructive confirmation confirmDialog invoked from packages/app/src/screens/settings/host-page.tsx:541-547
Centered hero / first-run packages/app/src/components/welcome-screen.tsx
Sidebar list (workspaces, hosts) packages/app/src/components/sidebar-workspace-list.tsx, packages/app/src/components/left-sidebar.tsx
Live list of items with sections (agents) packages/app/src/components/agent-list.tsx
Historical list (sessions) packages/app/src/screens/sessions-screen.tsx
Workspace pane (multi-tab, split) packages/app/src/screens/workspace/workspace-screen.tsx
Composer / message input packages/app/src/components/composer.tsx, packages/app/src/components/message-input.tsx
Pane chrome with single bottom border packages/app/src/components/git-diff-pane.tsx, packages/app/src/components/file-explorer-pane.tsx, packages/app/src/components/terminal-pane.tsx
Page-level alert (info / success / warning / error) packages/app/src/components/ui/alert.tsx, packages/app/src/screens/project-settings-screen.tsx
Sidebar callout (cross-cutting alert) packages/app/src/components/sidebar-callout.tsx, packages/app/src/contexts/sidebar-callout-context.tsx, packages/app/src/components/worktree-setup-callout-source.tsx, packages/app/src/desktop/updates/rosetta-callout-source.tsx, packages/app/src/desktop/updates/update-callout-source.tsx
Searchable picker packages/app/src/components/ui/combobox.tsx, packages/app/src/components/branch-switcher.tsx
Trigger-anchored menu packages/app/src/components/ui/dropdown-menu.tsx (used in sidebar-workspace-list.tsx, theme picker)
Right-click / long-press menu packages/app/src/components/ui/context-menu.tsx (used in sidebar-workspace-list.tsx)
Headers (back, screen, menu) packages/app/src/components/headers/back-header.tsx, screen-header.tsx, menu-header.tsx