The rules the web UI is built to, and the reason behind each one. A rule without a reason gets ignored the first time it is inconvenient, so every rule here carries its argument and, where one exists, its measurement.
Scope: web/src/ only — the bridge has no UI. ARCHITECTURE.md says
what the pieces are; CLAUDE.md says how to work in the repo. Neither is
restated here. The values live in web/src/index.css and its
comments are the ground truth for every number; this file holds the rules that span more
than one file, which a comment cannot.
The rules are seen at work in the design reference (web/design.html, cd web && bun run design):
every final state of the UI, mounted from the real components, one entry per state, found with its
search field. It holds only what ships or what the owner approved. A choice between options is a
round declared under web/src/pick/rounds/, and only the chosen state moves into the reference. CLAUDE.md has how to add either.
Before writing a visual component, open web/src/components/ui/
and look for the primitive. If one exists, use it. If two or more places need the same
visual idea, it becomes a primitive there — it does not get copy-pasted a third time.
Why this is rule one: a primitive is where a fix lands once and reaches every call site.
ui/button.tsx proves it — one edit, moving border border-transparent into the base
string, repaired six call sites that had been silently changing their own box on every press
(nav-tray.tsx ×5, quick-actions.tsx) and closed the same bug for every button written
afterwards. A copy-paste gives you six places to remember instead.
| Primitive | What it is FOR |
|---|---|
ui/add-button.tsx |
The "+" at the end of a row that makes one more of what the row holds: a space, a tab. The one look for New is a dashed circle, 28px or 32px; the busy spinner swaps in place. One exception: in the pane screen's 30px tab row the "+" is a bare glyph in a 24px box (face="bare"), drawn like the fold chevron beside it, because there the ring read as a placeholder (decided 2026-11-06). The caller passes the tap reach, because only the call site can measure what sits around it. |
ui/branch-label.tsx |
The branch a pane's folder is on, on one line: a branch glyph and the name in 11px mono, or a commit glyph and detached @abc1234. A long name gives way in the middle and keeps its last eight characters. The screen reader hears the whole name in words. Owns no tap and no height of its own; the caller's line box holds it. ranges marks matched letters through MatchText and follows the split to the half a mark falls in. The dashboard row's line 2, the pane header's workspace line, and the Files header. |
ui/button.tsx |
Every clickable control with a label. Six variants, one box. Exports buttonVariants so a real <a> can wear the clothes, and the shared marks: FOCUS_RING (and FOCUS_RING_INSET for a row against a clipping edge), HOVER_FILL, and TRIGGER_OPEN, the one look of a control whose menu, dock or dialog is open (see "An open menu shows on its button", section 2). |
ui/badge.tsx |
A small static label pill. Not a status chip — it carries no dot and no tap floor. The ok variant (the done token on a 15 percent ground of itself) marks a thing settled, as Morph's "Answered". The value variant (the foreground at medium weight on muted, one --border hairline) is a VALUE a person set or reads a row for, on a trick's detail pages: the timer, the places, the run line, a path, a setting. components/trick-value.tsx wraps it and lets it wrap inside a sentence. |
ui/card.tsx |
A filled panel on --card with its own edge. The Settings surface. |
ui/bottom-bar.tsx |
The band at the foot of a screen that holds its own controls: a rule above, the page colour, the safe area under the buttons. It owns the band and nothing in it. The Changes screen's Previous / Next pair, the Back it repeats on a phone (§12), and the New page's summary line and Start. |
ui/chip.tsx |
The pill in a strip: label, optional leading glyph and status dot, 44px hit box, and an optional name that says its act (the status words then become its description). radio makes it one choice of a set: role="radio" and aria-checked instead of aria-current, same box. Space and tab strips. |
ui/collapse.tsx |
The only sanctioned way an in-flow surface appears or disappears: an eased 240ms height+opacity slide that holds its last child through the exit. Styles nothing. |
ui/collapse.tsx → CollapseSwap |
Two surfaces taking turns in ONE band, as one motion: a single-cell grid, one height animation (the tall one's), and the short stand-in pinned in the cell fading over it. The fix for two sibling collapses on opposite gates, where the leaving surface is pushed the height of the band by the arriving one. The stand-in must be the shorter of the two. |
ui/presence.tsx → PresenceList |
Keyed items that arrive and leave a list without a jump: <PresenceList gap={12} itemAs="div"|"li">{items.map((x) => <Row key={x.id} …/>)}</PresenceList> inside the caller's own flex column. An item whose key leaves stays drawn in its old place, showing its last drawing and out of reach (inert), while its height (grid-template-rows 1fr→0fr), its opacity and a 2 percent scale toward its top ease out over 240ms on the standard curve cubic-bezier(0.4, 0, 0.2, 1) (PRESENCE_MS, PRESENCE_EASE); gap is the container's gap in px, which the item takes along as an easing negative bottom margin, so nothing below moves at the unmount and the item's own top stays put. A new key grows in the same way; the first paint does not animate. A group whose last item leaves is an item of an outer list and leaves with it as one motion. Reduced motion: opacity only, 120ms, and the layout settles in one step. Renders the item wrappers only (li in a ul). The Hill's cards, priority groups and closed rows; a list that removes rows (a clear) gets the same collapse by rendering through it. |
ui/presence.tsx → HeightSwap |
One band, several contents, one shown, and the band's height eased between theirs (measured at the swap, eased on the same 240ms curve, handed back to auto after): <HeightSwap active="receipt" options={[{ key, node }…]}/>. Either side may be the taller, unlike CollapseSwap; the leaving content fades out on top in 120ms (held, inert) while the new one fades in. Reduced motion: no height motion, a 120ms fade-in. The Decision card's options giving way to "Sending…" and the receipt. |
ui/keyed-flow.tsx → KeyedFlow |
A column of keyed blocks that an outside hand rewrites while you read it: <KeyedFlow gap={12} items={[{ key, version, node }…]}/>, drawing its own flex column. Built on the two above: a block arrives and leaves through PresenceList, a new version cross-fades the block through HeightSwap. It adds three things. A change of order glides each moved block from where it stood, a transform on the block's own wrapper (FLIP with the Web Animations API, FLIP_MS and FLIP_EASE from hooks/use-flip.ts). The first blocks after none come in 40ms apart (six beats at most, then together), each a fade and a 6px rise. A finger down inside the column holds what it draws until the finger lifts anywhere, or 5s at most, so nothing moves away under a tap. Reduced motion: no glide, no stagger, the presence primitives' own fades. The Morph screen's blocks. |
ui/copyable-block.tsx |
Any block with a caller-supplied literal to copy. Owns an always-visible, opaque Copy icon over the block's top-right corner and the success or failure status, never the content's formatting. The icon itself confirms the outcome on every screen, including History and Files, which have no status line: a check (--status-working) or an X (--status-blocked) for 1.5s, then the Copy glyph again, in the same 24px box. Its transparent 44px tap target may extend beyond the block; it reserves no gutter or height and deliberately covers text beneath it. Without a clipboard API it draws the content alone. A copy that worked flashes the block itself (data-copied, below), not the button; the outcome state is hooks/use-copy-feedback.ts. |
ui/diff-lines.tsx |
A few lines of a diff as one mono block: + added, - removed, @@ a hunk head, the rest context, in the Changes view's own tints and sign inks (DIFF_ROW_TONE, DIFF_SIGN_TONE, a minus drawn as −). Long lines never wrap: the block scrolls sideways inside its own frame and the page never overflows. An optional file name sits small over the lines. Owns no words. A trick's and a Decision view's diff (2026-11-10). The Changes view and Chat's diff card still carry their own copy of the tints. |
ui/crossfade-text.tsx → CrossfadeText |
A NAME that a rename changes, faded instead of swapped: <CrossfadeText text={name} identity={paneRowKey(pane)} />, or fade={identity} on MatchText, Chip and SectionHeader. The same identity with a new text crossfades over 200ms (CROSSFADE_MS, ease-out): the new words stay in the flow, so the box takes its new width at once, and the old words are an out-of-flow copy with no offsets, left at its static position, the start of the same line (aria-hidden; a top-0 left-0 sat half a leading off the new words), both fading in opacity only, no drift (.crossfade-in, .crossfade-out; the two copies share one line, measured in the engine). A new identity (another pane in the same place), the first draw and reduced motion swap at once, and so does a change that comes less than 1s (CROSSFADE_QUIET_MS) after the identity's last change, mount or switch (a terminal title that the process rewrites every turn must not hold the name half transparent). Inline spans only, so the caller's truncate or line-clamp still ends in its ellipsis. Identities: paneRowKey, spaceKey, tabKey (lib/hosts.ts). Never for agent-written text that is no name (terminal output, chat, a live title, a path). The session header's name and Space, the dashboard row, the switcher, the Space and tab strips, Space lists. |
ui/divided-line.tsx |
A quiet line of the thread: centred 11px muted text between two hairlines. Chat's notices, compaction marker and top-of-thread line, and History's day divider and compaction marker. Owns no words. |
ui/draft-mark.tsx → DraftMark |
The pencil on the row of a pane that holds an unsent draft on this device (lib/drafts.ts): lucide's Pencil under the icon key pane-draft, 12px, text-muted-foreground, never the blocked red, with no dot, no count and no motion. The one mark every list of panes draws (AgentCard, PaneRow in the sidebar, the Switch pane sheet and the Actions palette), after the name and the program's badge, so the name is what gives way. reserve keeps its slot, drawn invisible, as the unseen mark does, so nothing shifts when it comes or goes; off is the row of the open pane. Live through useHasDraft(scope, paneId). Named "Unsent draft" (pane.draftMark) while drawn. |
ui/fab.tsx |
The floating New button: a 48px-tall "+ New" pill in the outline-button look (page fill, a uniform 1px --border edge, foreground ink, shadow-md; dark:bg-card lifts it off the near-black page; hover and press take --accent) with the house 2px corner, that folds to a 48px round "+" once the list scrolls (collapsed) and opens out again at the top; width and corner move on one transition that motion-reduce turns off. It is fixed at the right edge of the content column (the phone's 640px, or on the large-screen dashboard the grid's own column through columnWidth, 24px inside its edge), portalled to <body>, at z-30 (under the toast's z-40 and the sheets' z-50). The one floating CONTROL, the exception to "the sheet is the app's only floating layer that holds a task", and only on the dashboard's Dashboard tab. It owns the look, the busy spinner swap and the name; the caller owns whether it is drawn and the bottom- that clears its footer. The look is also exported alone as FabButton, which the Switch pane sheet wears in its title row at size="compact" (32px, no shadow, a 44px hit area; not floating). Exception rules below the table. |
ui/focus-image.tsx |
A picture in a frame of a stated ratio and an optional height cap, on the muted ground with a thin border and the house corner (FocusFrame), filled by FocusImage: fit contain or cover, and a focus point in percent with a zoom about it (focusStyle), so a crop keeps the named point in view. With onOpen the frame is a button named by label. A trick's image, and a Decision view's placed image and compare (2026-11-10). |
ui/fold-toggle.tsx |
A quiet tap that opens a part of a card in place, and the part: MoreToggle ("More" and "Less" in one OneOf slot, the chevron that turns), NoteToggle (the note glyph and the caller's words, for an optional text answer; a required one is drawn open, never behind it) and FoldPanel (the part, through Collapse). A 44px ghost button in muted ink with aria-expanded, and aria-controls only while the part is drawn. Owns no words. The Decision card's More and Add a note (M96). |
ui/image-card.tsx |
One journal picture, framed, as an anchor to its bytes, with a caption saying where it came from. The mirror's placeholder clusters, and the newest turn's picture right after the mirror. Every element is a <span>, so it may sit inside the mirror's <pre>. surface picks the frame: dark-space inside the mirror, the app's tokens on the page. |
ui/image-frame.tsx |
One picture shown whole in the content column: at most the column's width and 70% of the screen's height, centred, on a checkerboard of --card and --muted that shows transparency in both themes, with one caption line under it that is always there, so filling it moves nothing. The Files view's picture and SVG previews (ADR 0090). Not for a journal picture, which is ImageCard. |
ui/image-strip.tsx |
Pictures in one row at one height that scrolls sideways inside the house fade (OverflowEdges, cue="none"). The height comes from the shapes (stripSize): 112px when any picture is landscape, square or unknown; tall (240px, at most 45% of the screen's height) when every picture is portrait, so a phone screenshot reads; a single picture is tall and may use the row's whole width. Each item is as wide as its picture's known shape at that height (clamped, square when unknown), in CSS with no measuring, so the box is the same while it loads, once it loads and after it failed (fallback). A caption takes up to two lines under its own picture, and an item with one is at least 96px wide; the picture sits whole in its box. A tap opens the picture in ImageSheet. ref reaches the outer box, so a caller can watch the ROW for nearness. Owns no words and no loading. The Decision card's images (M96). |
ui/inline-editor.tsx |
A short text the person types on the card itself: a bordered box with a labelled textarea, a help line, Cancel and a Send that can spin; plus the dashed offer button that opens it. Owns no words and no network. The plan card's feedback, and AskUserQuestion's typed answer. |
ui/list-group.tsx |
A run of flat rows drawn as ONE bordered region. Gives a divide-y list a first and last edge. |
ui/mini-table.tsx |
A small table that fits a phone: one to four columns, heads in small muted words over a rule, rows parted by hairlines. It never scrolls sideways (table-fixed); a cell takes at most two lines, the rest cut with the whole words in title; an end-aligned column sets tabular figures. rowClassName fixes a row's height where the place has a fixed band. Owns no words and no colour. A trick's and a Decision view's table (2026-11-10). |
ui/labelled-strip.tsx |
The structure of a named, horizontally scrolling pill row: non-scrolling label, aria-labelledby, edge-to-edge scroller. Also exports STRIP_TAP_TARGET. |
ui/match-text.tsx |
A text with the matched letters marked: MatchText({ text, ranges }) wraps each [start, end) range in a <mark> on --find (rounded-sm bg-find text-inherit, the theme token for a found piece of text; no padding, weight, size or border, so a match repaints and never re-lays-out, §2). With no range it returns the bare string, so the caller's element is the same DOM as before. Owns no matching and no words; a bad range is clamped, never thrown on. Find in Chat's hits and the session filter's matched letters. |
ui/one-of.tsx |
One box, several alternatives, exactly one shown — all of them stacked in a single grid cell, so the box is sized by the widest and a swap is paint, not layout. The §2 technique for a run of text whose WORD changes with the state. |
ui/pager-sheet.tsx |
Pictures at full size, one at a time, in BottomSheet (size="viewer"; on a wide window its stage is the dialog's whole room, so Previous and Next stay put), portalled to <body>: Previous and Next under the picture (44px each, ends stop, no wrap round) with the position between them ("1 of 2"); one picture draws no pager row. Owns no words and no loading. A Decision view's compare and placed image (2026-11-10). One picture from the row is still ImageSheet. The picture is a ZoomPicture, keyed by its page, so a new page opens fitted. |
ui/notice.tsx |
The app's ONE notice look: five tones × two placements (strip, box), each on its own height floor, and the single table the tint recipe may appear in. Owns shape, tone and live-region semantics; owns no words and no visibility. |
ui/pane-glyph.tsx |
A pane's glyph: the agent's logo, or the terminal square for a bare shell. With markOn (the surface under it), the pane's status mark sits on its bottom-right corner, backed with that surface, and absolute, so the box never changes. named gives the mark the status word, for a control that says the status nowhere else. The closed rail, a strip column's header, and the rows of the open sidebar and the Switch pane sheet. |
ui/peak-glyph.tsx |
A small range of three peaks, one to three of them filled: a level that reads without colour, the count of filled peaks first and the caller's ink second, every level in one 18 x 12 box. An empty peak is filled with the surface under it (surface). Named with label, else aria-hidden. The Hill's priority (Now three, Today two, Later one) on a Decision card and the Hill's group headings (M96). |
ui/segmented.tsx |
Two or three labelled segments in one row, exactly one selected: Diff | Source | Preview, the Files screen's All files | Changes, the 1 h / 24 h chart switch, the alert threshold and duration choices. Values are strings or numbers. Every segment reserves its 1px border and the selected one only recolours it, so a switch moves nothing (§2), and a tap on the selected segment does nothing. semantics picks a tab list (a switch between screens) or a radio group (one setting); disabled makes the row inert. A segment may carry a count (badge, with badgeLabel for the screen reader), floated on its top-right corner like the toggle button's, as the Files screen's Changes segment does. Under a pointer an enabled segment that is not chosen takes the plane's --state-hover and the full ink (colour only, so nothing moves, and a phone has no hover); the chosen one and a disabled segment keep their look. Theme and Belt size predate it and still carry their own copy. |
ui/progress.tsx |
How far something is, as one bar: a width inside a box whose height is stated, so a moving value repaints and never re-lays-out. thin is a 4px bar on a --muted track (Chat's progress row); hairline is a 1px line with no track (the bottom edge of a pane card). The house 2px corner, progressbar role, clamped 0 to 100. Owns no words. |
ui/row-open.ts |
A row whose whole face opens one thing, while the controls in it keep their own taps. Class strings, not a component: ROW_OPEN_ROW on the row (the positioned box, and the press tint on its own ground through :has(), hover only for a pointer that hovers), ROW_OPEN_BUTTON on the ONE open button (its ::after stretched over the row, the focus ring drawn on that layer inside the row's edge), ROW_OPEN_CONTROL and ROW_OPEN_SWITCH on each control beside it (lifted above the layer; the switch reaches the 44px floor). No control is nested in the button: a switch, an Add or an Undo is its sibling. Settings, Tricks: a trick's row, an official entry before Add (the Hill's row left on 2026-11-13). e2e/tricks-row-taps.spec.ts aims the taps. |
ui/search-field.tsx |
The search box: a 44px text field with a magnifier inside its left edge, 16px type so iOS does not zoom, every keyboard correction off, inputMode="search". Forwards its ref to the <input> so a sheet can focus it on open. Owns the look and the field, not the list under it or the filtering. trailing puts a caller's 44px control in the right edge, and the text stops short of it whether it shows or is kept invisible, so it never moves the text. The command palette's, the Sent sheet's and the session filter's (session-filter-field.tsx, with its clear button there). |
ui/section-label.tsx |
The small word that names a section, as typed under the default labels: sentence and in capitals under caps. Type only, it renders a <span> and owns no structure. |
ui/select.tsx |
A form select: a NATIVE <select> in a 44px box with our own chevron (appearance-none), a full --border edge and the house corner, so a phone draws its own picker and no sheet is needed. lead puts an inert glyph before the text; the caller's className sizes the box (flex-1 min-w-0 for the flexible one, shrink-0 for the compact one). The New page's machine, agent and command selects (routes/new.tsx), and the dashboard's order select (dash-selects.tsx). The dashboard's workspace filter there draws the same box as a button, because it chooses several workspaces in a sheet of checks (issue #527). The four Settings selects (language, typeface, terminal font, theme) carry the same construction by hand and have not been moved onto it. valueChip draws the box as a value (muted ground, medium weight), for a trick's settings. |
ui/sheet.tsx |
BottomSheet. The floating layer that holds a task. On a phone and a small tablet it comes up from the bottom edge with a grab handle and a pull down to close; on the expanded width class with the screen flat, and with an expanded room for its own fixed layer (a phone frame in a page, the website's or the design reference's, keeps the bottom sheet), it stands as a centred dialog in the modal's look (four round corners, a uniform --border edge, the soft shadow, no handle, no pull, as tall as its content and at most 82% of the window), the same sheet drawn for a wide window. A sheet opened by a tap on its button (anchor: the pane's ⋮, a tab, a space) is drawn there as a menu beside that button instead, no dimming, no entrance, no title row (lib/menu-place.ts). presentation="sheet" keeps a full-screen sheet a bottom sheet on every width (the tour, its one caller) (ADR 0167, addendum 2026-11-20). Its size="viewer" opens a picture or a document page as wide as the picture, up to min(92vw, 1200px). A decision that blocks until it is answered, and the Actions palette, float in ui/modal.tsx instead (below). One exception for a control: the dashboard's floating New button (ui/fab.tsx, below). The pane navigation overlay floats too, but takes no touch (below). The terminal draft notice and the held-send card float too, over the mirror's bottom edge, and hold no space. The one-time keyboard hint (components/keyboard-hint-card.tsx) floats too, at the top right under the header's bottom edge (measured), at z-25 under the strip band, and holds no space. There is no popover and no tooltip, and no dialog beside the modal. It also exports useAnySheetOpen, the count of open sheets that button hides itself on, and SHEET_BODY_STICKY, where a block in the body sticks: under the head, across the panel (the switcher's filter field). Its optional action slot holds one control at the title row's trailing end, before the close button; the slot adds no height, so a control in it is no taller than the 32px close button. A scroll area inside the body marked data-sheet-scroll (the block text sheet's text, components/block-text-sheet.tsx) owns a downward touch while it is scrolled, so the pull to close starts only from its top. |
ui/modal.tsx |
Modal. A panel over a dimmed scrim for a DECISION that blocks until it is answered, and for the Actions palette (ADR 0167); a task is a sheet. It owns the shell only: role="dialog" and aria-modal, the scrim (a tap that went down and up on it closes), Escape, the focus in on open (the caller's initialFocus, else the panel) and back on close, the portal to <body> at z-50, and the room above the soft keyboard (--modal-room, the visible height, beside --app-h). The panel: --card with the house 2px radius, a uniform --border edge on all four sides and shadow-2xl, never an accent edge. placement="top" hangs it from the top (the palette: the keyboard owns the bottom half and its field keeps it up); "center" centres it in the room, and moves the focus to the panel, so a soft keyboard goes down. The caller gives the panel's size and owns every word. The palette, the Send Protocol's draft offers (send-offer-modal.tsx) and the confirm of a trick's Remove (trick-remove-section.tsx, ADR 0168). It exports its frame, look, entrance, scrim and room (useModalRoom), which BottomSheet wears when it is drawn as a centred dialog. |
ui/spark-line.tsx |
A trend as one small line, scaled to its own numbers, the last point marked, no axes and no grid; the ink is the caller's through currentColor, the screen reader hears the caller's label. A trick's and a Decision view's spark (2026-11-10). The machine card's machine-spark.tsx is the other spark, on a fixed 0 to 100% scale. |
ui/strip-host.tsx |
The ribbon band, an overlay hung from the header bar's bottom edge. Renders ONE StripSlot at a time, the highest priority, and keeps the two permanent sr-only live regions. It reserves no space: a zero-height anchor sits right after the header, and the band floats from it at z-30 over the top of the route, on the page colour with a shadow-md. Domain-blind: a bigger number wins, and it does not know what a connection is. flow paints it in flow instead, for a playground stage with no route under it; the app never sets it. |
ui/switch.tsx |
A boolean toggle, role="switch". No Radix. |
ui/switch-row.tsx |
A sheet row that holds a switch: icon, label, an optional second line and the switch at the end, the whole row its label inside the 44px floor. onChange writes and answers the failure's words; the switch holds the value asked for while it runs and puts the old one back with the words under the row. Owns no words. The session sheet's agent view switches. |
ui/tab-bar.tsx |
A bottom tab bar: icon-over-word tabs on the page colour, a rule above, the safe area below. The active mark is a reserved 2px top edge, and a count badge floats on the icon, so a switch or a count never moves a word. links are fixed items after the tabs that open a route, never the selected tab on the Dashboard (the Hill, with the red count of open Decisions, and its mountain with a snow cap in the warm accent while a now Decision is open). Two modes, one 56px height: with no extras every item shares the width equally; with extras the tabs and links are pinned at 64px and the extras (TabBarExtraItem, a quiet outlined badge, never red) scroll after a thin divider under OverflowEdges. The dashboard footer (ADR 0066, ADR 0085, both amended 2026-11-10): Crew, Dashboard, Files, then the Hill at the right end, then a trick's tabbar items. The Dashboard tab is no longer in the middle. The same footer stays on the Hill's route and on a trick's Session (components/dashboard-route-bar.tsx, one reading in hooks/use-dashboard-bar.ts): no tab selected, the route's own link or extra drawn current (the filled edge and aria-current), and hidden while the keyboard is up. |
ui/tile-strip.tsx |
A row of round tiles that scrolls sideways with no scrollbar under the OverflowEdges fade: each tile a 48px round face, a truncated 11px word under it and an optional quiet outlined badge of at most three characters (a longer one draws none on the face, as option A5 has it; the tile's name still says it), 60px wide and above the 44px floor. A tile with a tap is a button, one without is no control. The Dashboard's strip of a trick's dashboard tiles is its caller. |
ui/toggle-button.tsx |
An icon toggle button: a setting that is on or off, with aria-pressed, drawn as a 44px square (icon only) or 44px tall with a word. Owns the one pressed look, the primary tint plus the hairline ring-primary/40, so a pressed toggle never reads like a selected bg-muted segment beside it. An optional badge count sits on the square's corner, absolute, so a count that comes or goes moves nothing (§2). The dashboard's needs-you switch, the Changes tree's Ignored toggle, the Changes list's Tree toggle, the Changes only toggle with its badge, and the Dashboard's filter magnifier (pressed while a query is set). Not for a multi-select filter chip, and not for the role="switch" track of ui/switch.tsx. |
ui/tap-target.ts |
The composer's 44px hit-area extension for a 36px round face (TOOLBAR_TAP_TARGET): a transparent ::before four pixels larger on every side. Not a component, a class string. The composer's round buttons and the voice takeover's OK and bin, so OK stands on the mic's own reach. |
ui/toast-viewport.tsx |
Where a transient event floats: dock="bottom" fixed to the viewport, dock="top" absolute inside a route's content region. Owns position and nothing else. |
ui/zoom-picture.tsx |
A picture you can zoom, in a box that never grows: fitted at 1×, two fingers pinch it up to 6× about their midpoint, one finger pans it while zoomed and stops at its edges, a double tap toggles 1× and 2.5× about the tapped point (eased, at once under reduced motion), and a trackpad pinch and the wheel do the same. The math is lib/zoom-gesture.ts, shared with the zoomed output. touch-action lets the browser scroll at 1× and never zoom the page; a move it claims is preventDefaulted, which BottomSheet reads as "not a pull to close". PICTURE_SHEET is the panel class of a sheet that shows one. Every picture in ImageSheet and PagerSheet (2026-11-11). No visible control. |
ui/chat/chat-input.tsx |
The composer's text box shell. |
ui/chat/chat-message-list.tsx |
The transcript's scrolling list. |
If the thing you need is not in that table, say so in the diff and put it in that folder.
BottomSheet is the floating layer that holds a task, and ui/modal.tsx the one that holds a blocking decision (and the Actions palette), with exactly one exception for a control: the dashboard's
floating New button (ui/fab.tsx, mounted by routes/home.tsx on the Dashboard tab only, never on Crew or Files). Two notices also float, in the one slot over the pane view's mirror at its bottom edge, and hold no space and move nothing: the terminal draft notice and the held-send card (components/composer-held.tsx, ADR 0061). Why the button: the
only create control on the dashboard was a FolderPlus in the Spaces section header, low on a long
scrolling page and out of reach of the thumb, and a worktree was two taps behind it. One create entry
under the thumb was the pick (card 1.3, 2026-10-08; it opened a sheet then). Since M48 (1.19.0) it opens
the one New page (routes/new.tsx, /new; a sheet could not hold a form that long): the machine on a
crew, Again, an Agent or Command select, Folder, "New worktree", then the summary line and Start pinned
in a bottom bar. What cannot run stays in its select, disabled, with the reason in brackets. The exception is bounded by these rules, and a second floating control must change this
section first:
- It reserves nothing in flow. It is
fixed, so showing, hiding or going busy moves no content (§2). The dashboard's scroll content ends with enough bottom padding that the last row scrolls clear of it, set by whether the button is offered (which includes being on the Dashboard tab) and never by its transient hides. - Toasts clear it. The dashboard's
ToastViewportis lifted by the footer, the button's gap and the button's face (bottom-[calc(3.5rem+1px+1rem+3rem)]against the Fab'sbottom-[calc(3.5rem+1px+safe-area+1rem)]), so a toast floats above the button's top edge and never covers it. The two sums live side by side inroutes/home.tsx; change one, change both. - It hides, it does not dim, while any
BottomSheetis open (useAnySheetOpen) and while the on-screen keyboard is up (useKeyboardOpen). Under a sheet's backdrop it would be a second create entry beside the one in use; over the keyboard it would ride up onto the list. - It is drawn only if a row could work. Not on a device that may not write, and not when the
multiplexer cannot make a space, no launcher is configured and no repo is open. On a saved copy it
stays drawn and refuses on the tap, as
workspace-new-tab.tsxdoes. - It reads "+ New" at the top and folds to "+" on scroll. The word is the label a first-time
reader needs; once the list moves, the round "+" covers less of it. The pill takes the 2px corner,
because it is wider than it is tall; only the folded circle is full-round. The accessible name is
"New" in both shapes, and the word is
aria-hidden. - The Spaces header's FolderPlus stays, and opens the same page. So does the empty dashboard's "Start your first agent" card. The button adds an entry; it removes none.
components/pane-nav-overlay.tsx (ADR 0121) is drawn
only while a pane navigation gesture is armed: the target pane's name and the map at the top, and the
four-arrow pad where the second finger first landed. It is not a control, so it does not count against
the rule above, and it is bounded the same way:
- It holds no space and takes no touch. Portalled to
<body>,fixed,pointer-events-none,aria-hidden, atz-40: over the band, under the sheets. Its coming and going moves nothing (§2). - It lives only while the mode is armed, and leaves on the commit, the cancel or an unmount. It is never a standing condition.
- Tokens only:
--cardwith a uniform--ruleedge andshadow-md, the house 2px corner, the status marks fromStatusDotandUnseenMark, the lit arrow in--primary. Its step pulse is.pane-nav-pulsein index.css, which reduced motion turns off.
There was no alert primitive, and the app grew six hand-rolled ones instead — three heights,
three gutters, two radii, and two different ideas about whether a notice has an edge at all.
read-only-banner and host-stale-banner were the same class string with a different status
token. Each was built without checking whether the previous one existed, and together they are why
the top of the app moved when its state changed.
The primitive now exists: ui/notice.tsx, plus ui/collapse.tsx, ui/strip-host.tsx and
ui/toast-viewport.tsx around it. §11 is the system they make. The band is converted —
read-only-banner.tsx was the pilot, and routes/root.tsx now mounts the one StripHost with
update-ribbon.tsx and both of connection-banner.tsx's rows registering into it. Four surfaces
are still hand-rolled, and §10 gap 1 lists each with what it owns; until they land, this app runs
two alert systems at once.
So: no seventh one. A new notice is a Notice. If it appears or disappears, it does so through
Collapse. If it competes for the band under the header, it registers a StripSlot. The two
placements (§4) are now the variant prop and there is no third: strip is viewport chrome hung under
the header, full-bleed with a border-b, floating over the top of the route; box is content in the column, inset on the page gutter
with a full border and the house radius.
The operator's constraint, verbatim:
"when adding borders the elements need to stay on the point on the x axis to not disturb the reading flow"
A state change may repaint. It may not re-lay-out. A row's text left edge and right edge must be pixel-identical whether it is resting, selected, alerting or focused, and its height must not change either. A column of names that zig-zags as one row gains a border is the failure this rule exists to stop.
Reserve the border in the base string, transparent, and let the variant recolour it.
Never add border in a state.
base: "… border border-transparent …"
outline: "border-border bg-background …" ← colour only
default: "bg-primary …" ← inherits the transparent edge
Canonical example: ui/button.tsx. ui/badge.tsx
had always done it this way; ui/chip.tsx, ui/switch.tsx and the tab and pane pills now
do too.
A ring and an outline also avoid reflow; the border wins on three counts. An outside mark
composites over the parent's background, so a /40 state mark on a /15 chip changes
colour with whatever it sits on. An outside mark is clipped by any ancestor scroller
(ui/sheet.tsx, the strips' overflow-x-auto) and overpainted by a later sibling's opaque
background in a divide-y list. And outline follows border-radius only from Safari
16.4 — this is an iOS PWA. A border is inside the box, so none of that can happen.
focus-visible:outline-2 outline-offset-2 outline-ring. The 2px offset leaves a gap of
surface between the 1px state border and the focus mark, so the two read as two marks
rather than one 4px smear. Outline is the right tool here for the same reasons it is the
wrong tool for state: it never reflows, it paints above everything, and it is transient.
Outside ring-* for state is retired.
A control that opens a menu, a dock or a dialog carries aria-expanded and, while that is true, wears the
"on" look (bg-control-on text-control-on-foreground, the belt's open dock) through TRIGGER_OPEN in
ui/button.tsx: one constant, fill and ink only, no border and no size, in both themes, and it wins over
hover. It follows the open state on every width: the pane's three dots, the open tab and the open Space
chip stay lit while their menu stands beside them on a wide window or their sheet covers the page on a phone.
A press held toward the 500ms long-press mark carries data-holding, set by
hooks/use-long-press.ts 250ms after the finger lands, so a plain tap never flashes. While it is
set, index.css ("THE HOLD, SHOWN") eases the element to a 97% scale and a 12% tint of its own ink,
over exactly the time left to the mark, and drops both the moment the hold fires or is cancelled.
Scale is a transform and the tint an inset shadow, so nothing around it moves; under reduced
motion the tint alone. Every surface that spreads the hook's props gets it. Do not give a hold
surface a look of its own.
A Chat block draws that same 12% tint twice more. While its actions sheet is open it carries data-active
(the tint at full strength). After a copy that worked, whatever was copied carries data-copied for 700ms
(lib/copied-flash.ts, "A COPY SHOWS WHAT IT COPIED" in index.css): the tint is there at once and fades out.
It is an overlay (::after) that takes no pointer and no space, so no box moves; under reduced motion it shows
without the fade for the same time. The thing flashed is positioned (relative). A failed copy shows none.
The transparent-border technique reserves an edge. It has nothing to say about a caption whose text changes with the state — and that is the same fault: at 390px "needs you" is 54.6px and "done" is 27.9px, so a strip holding the word plus a host name moved the host name 33px sideways every time the pane changed state. A hard-coded width is not the fix either: the same slot is "braucht dich" (72.2px) in German and "desconocido" (70.0px) in Spanish, so any constant clips one locale or wastes another's space.
Reserve the SLOT, sized by the widest word in the active locale. ui/one-of.tsx renders every
alternative in one grid cell and shows one; the layout engine measures the real glyphs of the real
dictionary, so a new translation is correct on arrival. Call sites:
status-badge.tsx's StatusWordSlot (the composer's status band) and ui/strip-host.tsx (the
band under the header, where the same idiom was first written). A state with nothing to say —
a gone pane, showing no word at all — keeps the slot rather than collapsing it, because
"shows nothing" is a state too.
Anything that changes a box is a state that moves content. Also forbidden in a state:
font weight, size or tracking (bold glyphs are wider, so a chip that gains font-medium
when it becomes current pushes every chip after it); border-radius; padding or a
differing fixed size; and a conditional element — a label a strip draws in one state
and not another is a row with two heights. That last one is why LabelledStrip's label is
required and never conditional, and why a route unpaints every strip's label at once
through CompactStripLabels rather than per-strip.
This principle is also why the alert work in §1 is happening: six notices with six heights appearing and disappearing at the top of the viewport is the same fault, one order of magnitude larger. §11 states the one exception the app allows, and names the single component that is allowed to be it.
§2 above states the rule per element: a state repaints, it never re-lays-out. This is the route-wide form of the same rule, stated once for the whole app: content the operator is reading or aiming at does not move unless the operator moved it. A box that grows, a sibling that slides, a row that appears, a scroller whose contents jump, a control that changes width for a moment. All of it is the same fault, whether the trigger is a state, a timer, a poll, a navigation or a network reply.
This rule governs the chrome the app draws around the terminal: the header, the strips, the belt, the composer, the sheets. It does not govern the mirrored terminal stream itself, which moves because the agent wrote a line, and the mirror's own contract is that it follows the tail. Two more things are not this fault, and neither is precedent for it: the OS resizing the viewport when the keyboard opens, because the operator opened it and the app moved nothing; and a toast, which is an Event in §11's table and floats in the overlay layer, so it holds no space and can never push a sibling.
Why it is graded this harshly: on a phone the thumb is already moving when the layout changes. A 51px slide under a moving thumb is a wrong tap, and a wrong tap on this belt sends a command to an agent. Reading breaks the same way, the eye loses its line. So the cost is never "looks a bit off". It is a mis-sent keystroke or a lost place.
What is allowed is a closed list. (a) A shift the operator caused directly and is watching:
opening a dock, scrolling, typing lines into the composer, opening a sheet. (b) A fact that
outlives the next interaction, arriving through Collapse (§11, hard rule 1), because the
change is then continuous and eased and the neighbours animate rather than teleport. (c) A
shift written down here, with its trigger, its pixels, and why reserving the space was worse.
A shift is ADR-grade, not a paragraph, when a tap already in flight could land on different
content after it: a control that appears or leaves, a row that changes height while its
neighbours are tappable, a chip that changes width. The finger is down before the eye has caught
up, so there is no judgment call to make. "It is only 700ms" is not a reason: duration makes a shift harder to
aim around, not easier.
The shapes this repo has already paid for, so nobody pays twice. The harness chip that dropped
its word for a ✓ (harness-bar.tsx, fixed 2026-09-21: on a Claude pane "Compact" went from
95px to the 44px min-w-11 floor for 700ms, and every chip after it slid 51px left and back;
the ✓ now takes the icon's cell and the word stays). The in-flow "Sent" row that moved the
mirror 30px twice to say one word (§11). The header that jumped 4px between dashboard and pane
because its height was its children's (§6). The status word that moved a host name 33px
sideways (§2, the slot). The border gained in a state (§2, the technique). And a pill withdrawn
instead of greyed, which moves every pill after it.
How to catch one before it ships. In a unit test: render the two states and compare
textContent and the child count of the box, the way harness-bar.test.tsx "keeps the word
under the ✓ so the belt does not move" does. A state that changes either has changed the box. In
a browser: a requestAnimationFrame sampler that records the neighbour's
getBoundingClientRect() per frame. A glide is a run of eased values over ~240ms; a jump is two
values one frame apart. Ask it of every diff that touches a state: which box changed size or
position, and who caused it. If the answer is "the app did", it needs a reason from the list
above or it does not land.
§6 grants one exception, the fixed-height reservations (the status band, and update mode's
panel), and §11 grants the other, Collapse. Add a third only by adding it to this list.
--radius: 2px, and it does not ramp in the Collie theme.
The radius descends from the mark, which holds a disc and a traced line and no soft-cornered box anywhere. 2px is the smallest radius that still reads as intentional rather than as a rasterizer artefact.
All four derived steps are hard-pinned to 2px in @theme (index.css:538-541).
Not tidiness: the stock shadcn ramp is calc(var(--radius) - 2px) / - 4px, which at a 2px
base compute 0 and -2px, and a negative radius is invalid. Pinning them also means
rounded-md and rounded-xl are the same corner, so no component can drift rounder than
its neighbour by picking a bigger step.
Where in doubt, go sharper. That is the standing instruction, and it was given after a round came back softer than the direction that was chosen.
Full-round is RESERVED for shapes whose width equals their height, where it draws a
circle: the status marks that ARE a circle (working, done, idle, unknown; blocked is a triangle and unseen a square, see below), the avatar, the switch thumb, a bead, the dashed "+" of
ui/add-button.tsx (its ring, and the bare face's hover circle), the floating New button of ui/fab.tsx when folded (its "+ New" pill takes 2px). Anything wider than it is tall becomes a stadium,
and there is no stadium in the mark. The chip, the pane pill and the switch track all take
2px, each with a comment at the line saying why, so nobody "fixes" one back.
A pane's state is drawn as a shape in one 12px box, so it reads on a small phone and to a
colour-blind eye. Colour alone did not survive the range: on the app's own --status-* tokens a
deuteranope reads blocked, working and done as one colour in light theme (status-badge.tsx
holds the measurement), and the summary line drops its words on a phone, leaving the marks alone
(issue 420, 2026-10-12, playground card 9).
| State | Shape |
|---|---|
| blocked ("needs you") | filled triangle, point up, with a 1.8px round-joined stroke in its own colour so it weighs about the same as the disc (97% of its area) |
| working | circle with its left half filled, no inner marks |
| done | filled disc, for a finished pane nobody has opened yet; once opened in Collie it rests as a ring (shownStatus, lib/triage.ts) |
| idle | hollow ring |
| unknown | hollow dashed ring, so it stays apart from idle |
unseen reply (ui/unseen-mark.tsx) |
9px full-ink filled square, 1.5px corners; not a status colour, because it is a different kind of fact |
- One component draws all of them.
StatusDot(status-badge.tsx) owns the five shapes andUnseenMarkthe square. Counts, headings, rows, chips, the strips and the pane header all call them. Do not draw a status as a bare colouredrounded-fullspan; the chip's, the heading's and the belt's needs-you marks went through this on purpose. - Colour stays the
--status-*token, drawn ascurrentColor. It is the second channel and the text tokens are untouched. The resting marks are drawn at 60% so eighteen idle rings do not out-shout the one that needs you; a ring's inside is filled with the surface it sits on (surface). - A shape does not read at 8px. The default box is 12px (
size-3); a slot that must stay narrower passessize-2.5(10px) at the smallest, and the card's mark takes-mx-pxto keep its row's 10px slot. The pane header's badge is the 12px box, absolutely placed on the agent tile's corner, so growing it moved nothing in the header. Every state fills the same box, so a state change is paint only (§2). - Motion: the watched mark only. The working mark turns (
.status-turn: rotation only, linear, 1.8s a turn) wherestatus-breatheused to run, on the one mark the operator is watching a pane through (live: the pane chip, the header badge, the running card, the stream's "still going"). It replaced the opacity breathe. Every other mark is still, a frozen (stale) reading does not turn, and underprefers-reduced-motion: reducenothing moves. - The summary line still drops words from the right when it is too narrow; the shapes are why that is now safe.
Chrome is the PAGE colour, separated by a rule. Never a fill.
This is the rule of the chrome: page word. Since 2026-11-05 the default theme Collie sets chrome: band:
the header and the bars stand on --secondary with a --border edge, which is a deliberate step off the page
that a theme file chose and the contrast gate measures (foreground, muted-foreground and status-blocked
on the band). Nightwatch does the same. Daylight and Harbour keep page. Read the rest of this section as
the case for page, and do not put --muted behind chrome under either word.
The header used to be a bg-muted band. It existed only because the line it competed with
was not really a line: border-border/60 measures 1.09:1 against the page in light and
1.16:1 in dark — a rumour, not a cut. Draw the line properly and the band is unnecessary;
dropping it also closes a seam on the pane screen and removes the worst ground a status chip
ever landed on. Do not put --muted back behind chrome.
| token | light | dark | job |
|---|---|---|---|
--border |
1.16:1 | 1.26:1 | one component's own edge — a card, a control, a hairline inside a region |
--rule |
1.34:1 | 2.06:1 | the cut between two REGIONS — the header's bottom edge, a strip separator, a group frame |
--edge-firm |
4.86:1 | 6.12:1 | the edge something STANDS ON — the large screen's tab bar (the open tab sits on it in both tab looks) and a column's pane header, against the recess and the page |
--edge-firm is derived, never a theme token: color-mix(in oklch, var(--foreground) 58%, var(--background)) in index.css, so every theme, imported ones too, gets it from its own ink and
page. Nothing else may write that mix; tune it there. Measured from the painted pixels (Collie
light and dark above; ADR 0171): Harbour light 3.59:1 against its recess, the lowest, Nightwatch dark
3.73. Use it only where a region ends on a line a person reads as a floor; a region cut stays --rule.
--rule is deliberately the stronger of the two, which decides the split inside
ui/list-group.tsx — and it is not the obvious one: the frame takes border-rule, the
hairlines inside take divide-border. Built the other way the group gets a frame
fainter than its own dividers, which reads as five lines with a ghost around them.
Where two chrome strips stack, the upper one closes its own bottom edge with border-b
and the lower one draws no border-t. Two components both drawing the same seam produce
a 2px line where the language says 1px. See space-strip.tsx:57-60 and the matching
tab-strip.tsx comment; each one names the other, so a future edit to either finds the
pairing.
items-center centres in the content box. The box a person sees is whatever is bounded by
visible edges — so if a strip has a rule below it and nothing but open ground above, its content
reads as sitting low no matter what the numbers say, because the box the eye draws starts at the
last line it can see. The composer's status band was reported uncentred twice while measuring
correct both times; the fix was border-y — bound the strip on both edges so the box it is centred
in is the box that is visible — and moving the padding above it to below it. Then delete any
half-pixel compensation that was paying for the missing edge: on a symmetric box it tips the other
way. composer.tsx holds the measurement, composer.test.tsx pins the mechanism.
On a pack, --host-0 … --host-9 (index.css) tint the machine a row belongs to, so the
dashboard reads as several machines before the eye reads a name. Ten hues, chosen to avoid every
--status-* hue: a tint may never be mistaken for a status. lib/hosts.ts hostSlot assigns them
— hash(id) % 10, next free slot on a collision, over the sorted roster — so a machine keeps its
colour across reloads and across a peer joining. A solo collie gets no host colour at all;
hostSlot returns null and every surface renders exactly as it did before packs existed. The
NAME is always drawn beside the tint (WCAG 1.4.1), and health still speaks in the status palette.
The tint lands on the GLYPH ONLY, never as a wash across a tag or a pill: ui/address-tag.tsx
and host-chip.tsx's name text and border stay the literal untinted classes on every surface, and
only the leading Server icon carries text-host-N. A whole-tag wash was tried and read as too much.
The Hill's recommendation star and the Hill mark while a now Decision is open use the warm accent;
decided by the owner on 2026-11-10 from playground option B1/C1. The token is the option's own,
--status-working, no new colour: the star beside " suggests " and the one at the end of
the recommended option's button (decision-card.tsx), the Hill header's ring and mountain
(hill-view.tsx), and the Hill item's snow-capped mountain in the Dashboard's bar (dashboard-tab-bar.tsx,
option A5). The priority word and glyph for now already wore it. Nothing else on the Hill takes it.
The Asks list's cache clock (components/asks-clock.tsx, on the Next up card and on each session card) is not warm
in this sense: it uses --status-info, the blue of a fact that is no warning (lib/status.ts). "12 min left" is
semibold, the 56 x 4 px bar is filled by the minutes left out of 60 on --muted, and a cold session draws the word
"cold" in muted ink with an empty dashed bar. The words carry the meaning and the bar is aria-hidden. The same
page draws a session's status mark with StatusDot and a marked answer as Badge ok.
Red comes from two tokens, and each has one job.
--destructivemarks an act that can hurt. That is either an act that destroys or cannot be taken back (Close, Kill, a danger key in the key queue, thedestructivebutton), or a control that is ARMED: the next tap or key goes to a live terminal with no review. The harness bar's second-tap confirm is the reference for armed. An armed state wears the tint recipeborder-destructive/40 bg-destructive/10 text-destructive, never a solid fill, whatever its size: a full-width strip keeps the same tint as a pill. A solidbg-destructivebelongs only on the button that carries out the act.--status-blocked, throughui/notice.tsx'sdangertone, marks a notice: something went wrong, or the operator must act. The tint recipe for it lives in that file's table, not here.
When both meet, for example an error inside an armed strip, the control keeps --destructive
and the message beside it takes the notice's danger tone.
Red is never emphasis, a brand accent, or "new". A screen with red on it says that something can hurt or has gone wrong. Every other use spends that signal.
A sheet, a drawer or any panel that floats over the page takes bg-card and edges itself with
border-rule. The one exception is a panel in the modal's look (ui/modal.tsx, and a sheet drawn as a
centred dialog on a wide window): it stands on bg-card with a uniform --border edge on all four
sides and the soft shadow, because the scrim already separates it on every side. --background is the page's own colour, so a panel painted in it is separated from
what it covers by nothing but a hairline. In dark that is the app's worst case — the page is
oklch(0.145), the scrim behind the panel only darkens it further, and --border at 1.26:1 was
carrying the whole thing. --card is oklch(0.205) dark and pure white in light, so the panel reads
as raised in both. Pinned in ui/sheet.test.tsx.
This is not a licence to fill chrome. A panel over the page is a different surface; a strip that IS the page's own chrome still takes the page colour and a rule (the top of this section).
The pane's swipe handle used to hang under the terminal mirror, on --background — which in dark
is the mirror's own fill (mirror-space.ts), so a 6px grip was the only thing on screen saying
a control was there. Chrome the thumb operates belongs on chrome's surface. agent-chat.tsx now
wraps the handle and the composer in one block that carries the fill and the single rule closing it
against the terminal, so the handle is a handle on something.
That block's fill and rule are unconditional while the handle inside it is not — which is the §2 form of the same rule: the seam against the mirror is one hairline whether or not there is a pane to switch to.
The fill is --chrome, a token that exists for exactly this one case and is spelled out in
index.css. It is not --muted — §4's opening rule still stands — and it is not --card
either: card is pure white in light, which lands 1.04:1 against the inverted mirror. --chrome is
rgb(235) light and rgb(23) dark, so it is the same raised surface the sheets use in dark and a step
below the page in light. If you need a third chrome fill, you are probably solving the wrong
problem; ask first whether the surface can stand on the page.
On a large screen the order of the surfaces says where to look. Three planes, two of them derived tokens
(index.css), so every theme gets them; a theme may set either one and need not (§13).
| plane | token | what stands on it |
|---|---|---|
| recess | --surface-recess, the page 0.05 darker |
the sidebar and the rail, the tab strip of the space, the strip's own ground around the add column |
| page | --background |
a column without focus: its header, transcript and bottom block |
| paper | --surface-paper: in light the card 0.05 lighter, at most white; in dark halfway between the page and that |
the focused column, whole: its header, transcript, Belt and reply box; and the selected row in the sidebar |
The focused pane is the lightest surface on the screen, in both halves. Measured on Collie: recess 0.12,
page 0.17, paper 0.23 in dark; 0.91, 0.96, 1.00 in light (OKLCH L). The dark paper is half the step it
could take: the full one (0.29) read as too bright a sheet on a desktop (2026-11-21). A small lift is
enough, because the frame marks the focus. A column takes its plane by re-pointing
the grounds its children read (strip-column.tsx, columnFrame), so the pane's own header and bottom block
follow, and the phone, which never draws a column, keeps its look. On the paper the inert fill is the page:
a run of tool steps, a code block and the reply box are set into the paper, never lifted off it. On the page,
in dark, the inert fill is the paper, so a column without focus never draws a fill lighter than the focus. The Belt
takes one tint, --muted at 20% over its ground, between the ground and the reply box, so it is never the
lightest fill.
Lines are quieter than the step between the surfaces they separate. Where two planes meet the step is
the cut: the sidebar and the tab strip close with a faint edge (the recess 30% toward --border), the seam
between two columns is a --border, not a --rule, and the rule under a pane header is drawn once.
The focus has a frame as well as a plane. The focused column wears a 1px hairline in --pane-active
(ADR 0174), with one column in the strip too. In Collie that is the "on" ink (--control-on-foreground)
mixed into the page in OKLab, 70% in light and 60% in dark: a quiet blue line, not a grey ring that reads as a
click's leftover keyboard focus. The token is derived (§14): deriveTokens holds it at 3:1 or more against the
three grounds it touches, the recess at its left, the page at its right and the paper inside, in every theme, and
a theme that sets its own pane-active has that colour go through the same mix in place of the "on" ink. It carries the focus where the paper cannot: the Terminal view, whose
mirror stays dark, and a theme whose page is black, where the recess clamps to the page. The frame is
reserved on every column, so a focus change recolours and moves nothing (§2). e2e/wide-planes.spec.ts
holds the order, the frame and the still boxes in every bundled theme, both halves.
Every top-level block on a route — section label, group frame, notice, footer — begins and
ends on the same x. The page gutter is 16px (px-4). Nothing in the content column is
full-bleed; only viewport chrome under the header bar is — the two-placement rule in §1.
The dashboard on a large screen has a 24px gutter, and its grid is the one left edge. In the
expanded width class (900px and wider, Large-screen layout not Off) the dashboard is a grid of Space
columns 384px wide, centred, with the header, the tab bar and the New button as wide as the grid
(ADR 0158, lib/wide-dashboard.ts). The parts that keep the phone's 16px gutter (banners, the Spaces
navigator, the footer lines) stand in one Space's width through a -mx-4 wrapper: the grid keeps its left edge,
and the stack under it is centred in the window on one centre line (operator, 2026-11-23, ADR 0158).
The band of what needs you opens and closes through Collapse: that is the one movement of the grid that
a state causes, accepted by the operator (2026-11-19), and a cold open draws the band in the first frame.
The large screen's sidebar has two edges: boxes on 8px, ink on 16px. Every box in it (the filter
field, the views control, a row's fill) stands 8px inside the sidebar on both sides, and every text and
icon (the mark's drawing, the summary line, a heading, a row's icon) starts 16px in; the field's 16px
magnifier sits on the rows' icon axis and its text starts on the rows' names. Under the 48px brand row
(as tall as the tab strip beside it, the 32px mark 8px from each edge) one sticky block holds the filter
field and the summary row with the three views, two 36px rows in 8px steps that each reach 44px, closed
by the head's one rule, 24px above the first heading. The filter's count stands inside the field, beside
the clear button, and the selected view is filled with the current-row bg-accent in full ink, never
outlined (e2e/wide-sidebar-head.spec.ts measures all of it).
A run of tool steps in Chat is ONE ground. The run stands on bg-muted/40 with one radius and
divide-border hairlines between its rows. A card inside a run drops its own frame; a card outside a run
keeps it. Reason: a work run read as a stack of boxes, each with its own edge, and the eye counted the boxes
instead of reading the work.
A fenced code block stands on --muted with a --border edge, at 12px mono. The inline code chip keeps
the info blue, because the blue says "this is literal". Reason: a blue ground on every block out-shouted the
prose around it.
The person's own turn is a well that hugs its text. It is at most 85 percent of the column wide, sits at
the right, carries no caption row and shows its time on its last line. Orange stays its colour. The speaker is
named for the screen reader only, by a visually hidden label as the well's first child. Chat
(chat-cards.tsx) and History (transcript-view.tsx) draw the same well. Reason: the colour and the side
already say whose turn it is, and a caption row spent a line on it. The classes live in
components/user-well.ts. The prompt pin (prompt-pin.tsx), which holds the current turn at the top of Chat
while its answer scrolls under it, wears the same side, cap, well and text size, and no prompt icon, so the
message does not move sideways when it sticks or lets go. It also shows the turn's time, the same element
(USER_WELL_META), at the well's right edge on its first line: the pin clamps its text to two lines, so a time
after the last line would hide, and the two-line height does not change.
In Chat a new turn starts 20px under the block above, and blocks inside an agent run sit 8px apart.
Reason: the old 12px between everything made a question and the answer to the one before it look alike.
Notices, the compaction marker and the top-of-thread line are quiet lines between two hairlines
(ui/divided-line.tsx), as History's day divider is.
The app's face is a per-device preference with a shipped default. Atkinson Hyperlegible Next (23 KB subset)
is that default, since 2026-11-06; Aldrich (8 KB), Space Grotesk (27 KB) and the system face are
other shipped choices (Aldrich was the default before), and
an operator may add their own through theme.toml. It is set on the Typeface card in
Settings, stored in collie:design:v1, and applied before first paint as a root class by
web/public/theme-init.js — :root.font-* in index.css owns every stack, and JavaScript
only ever swaps a class name. The default wears no class at all, so a device that never opens
the card runs no JavaScript before its first paint.
This reverses the old rule, which said the face was the maker's choice and forbade a
picker. ADR 0148 records why it fell.
The TERMINAL font is a separate setting — the Terminal font card directly below,
reaching --font-mono consumers only. The two are two settings because they are two
questions, and the cards sit adjacent so that reading one after the other makes the split
obvious.
What survived the reversal is the rule that was always doing the work, and it is below.
The chosen face — whichever it is — dresses headers, section labels, buttons, settings rows,
banners, counts and the wordmark. It must never touch what an agent or a machine
authored: the pane mirror, the transcript, agent prose and markdown, code, command text, file
paths, ANSI. Two mechanisms hold that line and both must stay — font-mono for verbatim
terminal surfaces, font-content for agent-authored text that is not monospaced. Neither
resolves through --font-sans, so the setting cannot reach either of them, and must not be
taught to. An operator's own face is subject to the same line: bringing a font widens what
chrome may wear, never what it may dress. If you cannot tell whether a surface is chrome or
content, it is content. Full argument at the @font-face block in index.css.
Within chrome the split is by who authored the string, not by how technical it looks.
Mono is a machine-authored identifier the reader compares character by character, where a
0/O or 1/l confusion is a wrong answer: build hashes, shell commands, file paths,
host:port addresses, pane ids, pairing codes, keypad digits, an agent's own reason string.
Sans is the app talking about itself: "Connected", "Read-only", "Yes", every label, every
count, every row title.
connection-info.tsx is the worked example: two of five rows are mono (the address, the
server build), three are sans. The card used to set font-mono on all five, which put four
words of chrome in the terminal stack for the look of a diagnostics table.
The derived edge case, which now holds in four places: a bare semver is chrome and therefore sans; a semver carrying a git hash is a machine build id and therefore mono.
| sans | alpha-bar.tsx:62 (prerelease version) · routes/crew.tsx:227-233 (a crew member's version) |
| mono | build-stamp.tsx:60 (the footer stamp) · connection-info.tsx:55-57 (the Server build row) |
Any number that steps takes tabular-nums, or the row twitches as digits change width.
tnum is kept in EVERY shipped UI face's subset for this (scripts/build-ui-font.sh); there
are 17 call sites today.
44px is the floor for anything tappable. The mark in the header is a button, so it owes
the same floor as the gear beside it — both are size-11.
Buy the floor as HIT area where drawn height is expensive. STRIP_TAP_TARGET
(ui/labelled-strip.tsx) extends a pill's hit box with a transparent ::before while the
pill still measures 34px. Three strips stack above the fold on a phone, so ten drawn pixels
each is thirty pixels of list the operator stops seeing — and a target does not have to be
visible to be hit. Two measured numbers hold it together, both documented at the constant;
change the scroller's padding or the pill's border and you must re-measure.
The one exception: the pane header's two lines (1.17.0). The name line opens Pane
settings and the workspace line opens the space, so the 60px row holds two targets, each
30px tall and as wide as the identity block. Two 44px targets do not fit in one 60px row.
The two buttons are not drawn over their lines and use no pseudo-element. They are empty
siblings that together fill a layer laid over the identity block (pane-identity-taps in
agent-chat.tsx), split at the line boundary, each as wide as the block. The layer reaches
8px past the block top and bottom (-inset-y-2), which is air the row already owns, so the
two targets are 30px tall each, half the 60px row, and a thumb a little above or below its
line still lands on one. The lines paint above the layer with pointer-events-none and pass
their taps through. The one pseudo-element in the header is the cache reading's: it reaches
16px down from its 12px line (pane-meta.tsx), a STRIP_TAP_TARGET-style reach, and takes
its own taps back. Do not copy any of this for a new control: a single target in a row still
owes the full 44px.
A row states its own floor with min-h, never h. app-header.tsx:212 is
min-h-15 — 60px. It is a floor, not a sum: the row's own padding is py-1, and the
floor stands above whatever the content needs so the row cannot shrink when a route
passes less. The pane's stacked identity block and the dashboard's single 44px gear
both land at 60px, which is the point — the header does not resize as you navigate.
Why state it at all: this row used to have no height of its own, so it took the height of its tallest child — and the children are props. On the dashboard the tallest was the 44px gear (60px row); inside a pane there is no gear, so the 40px mark won (56px row), and every dashboard→pane navigation jumped the header 4px. A row whose height is decided by its props cannot be stable.
Why min-h and not h: with a fixed height, a child taller than the floor is clipped or
overlaps on one screen, silently. With min-h it grows the row on every route at once —
a visible design decision somebody has to look at.
The one exception is a strip that is a RESERVATION rather than a row, and it is named
here so it stays one: the composer's status band
(composer.tsx, data-slot="composer-status") is h-[13px]. It is not a row whose height
follows its content — it is 13px of reserved chrome with a 1px rule at the bottom, and its
occupants are two runs that both state their box (text-[10px]/3, a 12px line box) rather
than measuring one from their glyphs. A floor would not do the job it exists for: the band
also spends pt-px to centre that 12px content on the band's own middle instead of on its
content box's, and under min-h that pixel would simply make the band 14px. The trade §6
warns about is paid honestly — nothing here can grow, because nothing here is sized by text —
and it is written down at the line. Add a second one only with the same two properties:
every occupant states its own box, and the strip's height is a number the layout was designed
around rather than a consequence of what it holds.
The second one is update mode's docked panel (components/update-screen.tsx,
ADR 0143). Its heading is h-7 and
truncates, its subtitle is h-10 and clamps to two lines, each row is h-13 with a reserved
second line, the note is h-[5.25rem] and the footer two 44px rows, all in rem so a larger text
size grows each box with its text, and the row list alone gives way, by scrolling, when the panel
would reach up under the band. Both properties hold: every
occupant states its box (truncate, line-clamp-2, fixed buttons), and the heights were designed
around the seven steps rather than measured from them. It earns h over min-h for the reason
the status band does: the panel's whole job is that a state change repaints it and never moves
it, and e2e/update-screen.spec.ts measures that to half a pixel in Chromium and WebKit, and
once more at 150% text, where it also fails a box that spills or a clamp that cuts a line in half.
Each of these has already cost real time in this repo. Check them by hand; none of them fails loudly.
-
A border colour with no border width paints nothing. Preflight sets
*,::before,::after,::backdrop { border: 0 solid }(node_modules/tailwindcss/preflight.css:15), so every element starts at 0 width.border-status-blocked/40alone is dead intent — and "fixing" it by addingborderin the same state re-creates the §2 bug. Reserve the width in the base, transparent. -
outline-nonesilently cancels a laterfocus-visible:outline-2. In v4,outline-noneemits--tw-outline-style: none, and everyoutline-<width>utility emitsoutline-style: var(--tw-outline-style). They resolve through the same custom property on the same element, so the focus ring computes to no style and paints nothing. There is no warning. If you add a focus outline, delete theoutline-nonein the same edit. -
A token declared inside
@theme inlineis NOT runtime-swappable.inlineis the instruction to substitute the value rather than emitvar(), so.font-monocompiles to the literal font stack — verified in the built CSS. Re-pointing--font-monoon an element at runtime therefore changes nothing. That is why the user's terminal font is applied as an inlinefont-familystyle on the mirror surface plus one arbitrary variant that makes itsfont-monodescendants inherit, rather than by re-pointing the token. The full note is inhooks/use-display-prefs.ts. -
Preflight gives a button the default cursor, not the hand. Tailwind v4 dropped
button { cursor: pointer }, so on a desktop nothing clickable showed the pointer. One rule in the base layer ofweb/src/index.css(a:where()list, so it adds no specificity) givescursor: pointerto enabled buttons,a[href],summary,select, a control'slabel, the box-like inputs and the ARIA rolesbutton,link,tab,switch,checkbox,radio,menuitem,option. A disabled control and a text field keep their own. So a new control needs nocursor-pointer, a custom clickable that is not one of those elements needs the role, and a deliberate cursor (cursor-grab,cursor-default) is a class that wins. The rule is a cursor only, never a hover style.e2e/cursor-pointer.spec.tsreads it.
- The terminal mirror is not re-themeable. It renders in a fixed dark ANSI palette under
every theme and the light theme inverts it wholesale, because truecolor names an absolute
colour no palette can re-theme and three of the four harnesses emit overwhelmingly
truecolor. The boundary is
MIRROR_SPACE/MIRROR_INVERTatcomponents/mirror-space.ts:33-34; read that file's header before touching any surface that renders segments, and see ADR 0002. Never put adark:variant inside one — it tracks the root theme, which is backwards in an element that is dark under every theme. - Light
--backgroundisoklch(0.97)on purpose. It rasterises to rgb(245,245,245), which is exactly the inverted mirror's background, so the mirror shows no seam against the page. It is not "off-white for taste"; moving it re-opens that seam. - Every brand mark is GENERATED from the sibling
collie-brandrepo:collie-mark.tsx, one<id>-mark.tsxper character inlib/mark-ids.ts, andmark-contract.tsbeside them. Never hand-edit one. Change the brand repo and regenerate. - Every mark keeps ONE contract, and a call site says what, never how.
components/mark-contract.tsnames everything public: the props (state,beads,turn,ref, besidessize,weight,paper,title,className), the--mark-*variables,data-markanddata-stateon the root, andsetRateon the handle. A header, a cover or a boot screen passes astate(rest,loading,applying,reconnected,idle) and nothing else about movement or colour: noopacity-40 grayscaleon a mark, no class that recolours its beads, no filter over its animations by name. A mark's class names, parts and keyframes are private and may change in any regeneration. The host picks a mark throughBrandMark; the header's spin round drives it through the handle.mark-conformance.test.tsxruns the contract over the whole registry (lib/mark-ids.ts), so a mark that fails it cannot ship. The reasoning is in ADR 0148.
A rule that spans two files drifts, because an edit to one file looks complete on its own. When that happens, write a coupling test: read the value off one rendered element, read the coupled value off the other, and assert they name the same token.
The pattern is in
components/app-header.test.tsx, "knocks the
mark out in the SAME paper the header is filled with". The mark makes "in front" by cutting
the head away behind a near-side bead and filling the cut with the page colour — a claim
about what it sits on, not a colour it picks. So the test parses the bg-* utility off the
<header> element, reads the custom property off the mark, and requires they name the same
token. Change the header's fill and forget the mark's paper prop, and every near-side bead
gets a halo in the old ground — subtle enough to survive a screenshot review.
It was verified to fail in both directions, which is what makes it a test rather than a
comment. The same file couples the mark's tap box to the gear's (size-11, one number read
off both) and asserts the header row is min-h-15 and carries no h-<n>.
Reach for this whenever a rule lives in two places. Cheaper than an ADR, and it does not rot.
ui/strip-host.tsx:108-109 mounts two permanent, empty sr-only live regions — one
role="status", one role="alert" — so a live region exists before its content changes. The
cost is that screen.getByRole("status") is ambiguous in any tree that holds a host: it
matches the empty region as readily as the notice you meant, and the failure reads as a missing
element rather than a duplicate one. So destructure container from your own render() and
scope by data-slot. Two workers lost time to this before it was written down.
Stated so nobody reads this document as a description of a clean tree.
-
The alert family is most of the way converted.
ui/notice.tsx,ui/collapse.tsx,ui/strip-host.tsxandui/toast-viewport.tsxexist (§1, §11), and the band under the header andread-only-banner.tsxare built from them. Four surfaces still hand-roll their own box, so the app runs two alert systems at once. Each line below was re-read against the source, not inherited:Still hand-rolled What it owns that the primitive owns host-stale-banner.tsx:92inset rounded-sm border … px-4 py-2 text-xs— the pre-conversion read-only string, verbatim. Mounts and unmounts with noCollapse, so it pops.no-echo-notice.tsx:43rounded-md bg-muted/40 px-2.5 py-1.5and no border at all;terminal-draft-preview.tsx:32is the same string a second time (gap 3 below)components/push-control.tsx:63,68two <p>rows onborder-t border-border px-4 py-2.5, popping into the card unanimated (they wereroutes/settings.tsx:158,163until Settings became an index of four sections)alpha-bar.tsx:50-51full-bleed border-b border-status-info/40 bg-status-info/15 px-3 py-0.5 text-[11px]. Deliberately last, and possibly never: it is a static build fact that never appears or disappears, so it cannot shift anything, and it is the family's visual precedent rather than a violation of it.Closed:
status-area.tsxused to carry its own fixed wrapper per route. All three now mountui/toast-viewport.tsx—routes/home.tsxandroutes/space.tsxatdock="bottom", the pane screen atdock="top". Three copies of the same four utility classes, each drifting a gutter and a z-rung from the others, are one call now.Closed: the band.
routes/root.tsxmounts the oneStripHost, andconnection-banner.tsx(auth and connection) andupdate-ribbon.tsx— which is whatupdate-available-banner.tsxbecame, inheriting its fault — now registerStripSlots and renderNotice variant="strip". All three landed together, because the band is indivisible: converting one of them would have left the other still reserving the safe-area inset beside it. What that closes is a reported bug and not only a tidiness: each of the three setenv(safe-area-inset-top)for itself, on the assumption that each might be the first thing on screen, so the everyday ribbon + header case on an iPhone paid for the notch twice and showed a dead band above the notice. The inset has one owner now,app-header.tsx's<header>, in every state: since 2026-10-07 the band hangs as an overlay UNDER the header bar, so nothing ever sits above it and nothing below it moves. Gone with it: two tint tables, two hand-rolled collapse machines, and bothrole="alert"+aria-live="polite"pairs. -
space-overview.tsx:136— anoutline-noneon the filter<input>with no replacement focus mark on it or its<label>. Trap 2 in its plain form: keyboard focus on that field is invisible. -
no-echo-notice.tsx:43andterminal-draft-preview.tsx:32— abg-muted/40fill with no border, above the composer. A fill-delimited notice is a third idea about what a notice is, and §4 says chrome separates with a line. -
composer.tsx— the composer dock isbg-muted. One chrome fill, not two. The status band above it carried abg-cardfill briefly and lost it once measured: the fill separated the band from the dock below by 1.19:1 in both themes — barely off the 1.09:1 that got the header band deleted — and from the terminal mirror above by 1.09:1 light / 1.10:1 dark, so in dark it read as a continuation of the terminal rather than as chrome. Theborder-b border-rulebeside it measures 1.45:1 light and 2.19:1 dark. The rule was doing the separating, so the fill went and the band is unpainted. The dock's own fill is the older gap and the one that remains;index.css's--mutedcomment argues against it directly. -
The
/60-and-/70border alphas —wizard-block.tsx,preview-select-block.tsx,menu-block.tsxandstatus-area.tsx:45still draw edges atborder-border/60or/70, which §4 measured at 1.09:1 in light. These are inside the agent-dialog blocks, which are the least-visited part of the restyle. -
Literal colours that a theme cannot reach (§13). Each one below paints the same under every theme. Found 2026-10-15 for M57:
Literal What it should be ui/fab.tsx:73dark:bg-card dark:hover:bg-accenta token per state with no dark:switch; the switch picks a token by appearance, so a theme cannot choose the dark half's groundui/badge.tsx:13text-whiteonbg-destructivetext-destructive-foregroundharness-bar.tsx:182bg-whitea token for the accent pill's ground file-preview.tsx:374bg-whiteon the HTML framemaybe deliberate: an HTML file draws on white, as in a browser; decide, then write it down idle-lock.tsx:43ring-white/10a ring token, or ring-rulechat-cards.tsx:1035border-white/10inside MIRROR_SPACE, so it is mirror ink (§8), not app chrome; it moves with the native-mirror work, not beforeplayground/zinc-*frames (layout.tsx,sections/update-screen.tsx)tokens; the design reference shows themes too The rule for closing one: replace the literal with a token whose value in the theme
colliegives the same pixel, in light and in dark. If no token gives it, the fix needs a new token, which is a new schema version (§13). These are not closed in M57, because that milestone's exit test is a zero pixel diff of the current theme, and each fix needs its own proof that it stays at zero. -
box-text-block.tsx:11— the Authentication card's links are inline, below §6's 44px floor. A login URL sits inside the command's own sentence, so the card links it where it stands, the way the mirror does: the samepy-[0.35em]reach (ansi-output.tsx:170holds the measurement), about 22px on a phone. Two different links can sit on neighbouring lines of one card, which makes a mis-tap the cost. Closing it means a layout that pulls each link out of its sentence onto a full-height row, and the sentence then no longer reads as the command printed it. -
The Authentication card leaves with keyboard focus inside it. When the login finishes the box goes, the card unmounts, and a link that held keyboard focus takes it to
<body>. Handing focus to the composer was tried and taken back: a tapped link holds focus too on Android, so the hand-off opened the soft keyboard over a phone that had just come back from the login tab, the casefocusFromMirror(inagent-chat.tsx) declines for the mirror's own links. Closing it needs a target that takes focus without raising the keyboard.
Every surface that tells the operator something is not normal is one of four things. Ten of them
existed because nobody had named the categories: severity was mistaken for category, so each new
severity grew a new component. Severity is a tone, not a category — ui/notice.tsx carries
five of them and any category may wear any one.
| Category | Outlives the next interaction? | Scope | Where it lives |
|---|---|---|---|
| System strip | yes | the app / this session | the band hung under the header, full-bleed, floating over the route |
| Scope notice | yes | this route or view | an inset box in the content column |
| Event | no | wherever it fires | the floating layer — never holds space |
| Contextual notice | while its control is relevant | one control | that control's own chrome |
Two questions, answered in order. Read only the row you land on.
| Outlives the operator's next interaction? | Scope | Use |
|---|---|---|
| no | any | Event. lib/status.ts → <ToastViewport dock>. dock="bottom" on screens with no composer; dock="top" on the pane. Never in the flex column. |
| yes | the whole app or session | System strip. <StripSlot priority={…}> inside the one StripHost, wrapping <Notice variant="strip">. |
| yes | this route or view | Scope notice. <Collapse open={…}><Notice variant="box">, the caller supplying only the gutter. |
| yes | one control | Contextual notice. <Notice variant="box"> anchored in the control's chrome, not the viewport — it pushes the input, which is correct: the operator is acting there. |
The table above answers which surface. This one answers a different question that kept getting confused with it: when the operator acts, what tells them it worked. There are four channels and they answer four different questions. One channel per question. A control that reaches for two says the same thing twice; a control that reaches for none has told the operator nothing, which is the failure three call sites were shipping.
| Channel | Question it answers | Owner |
|---|---|---|
| Haptic buzz | "Did the glass register my tap?" | hooks/use-action-echo.ts, hooks/use-hold-repeat.ts and hooks/use-long-press.ts (the tick when a hold counts) only. On the press, never on the outcome. |
| Per-control echo (✓ / spinner / busy tone) | "Did the bridge accept MY action?" | every fire-and-forget user mutation, at the control it was tapped on |
Floating status (lib/status.ts → Event) |
"What happened, and why not?" | failures ALWAYS; success only when the outcome is not visible at the point of action |
| Collie orbit round | "Something happened — look up" | every status the app publishes, one round per burst |
The orbit round is the one with a rejected alternative worth recording. It was narrowed to
unattended events only — the world moving while the operator was not acting — on the argument that
a tap is already answered at the control, with the eye on the thumb rather than on the header. Good
theory, wrong eye: the send is the moment the operator looks UP, because the reply is what they are
waiting for. The flag that carried the distinction was deleted rather than left unread. The rule is
now the simple one — if it was worth a notice, it is worth a round — which also keeps the notice
and the mark from ever disagreeing about what happened. components/collie-home.tsx holds the full
argument at the line that would change.
Failure is the floating status for everything, always — the one exception being a control whose
refusal is a contextual notice in its own chrome, which moved the failure rather than deleting
it. lib/mutate.ts is the wrapper that keeps a thrown mutation from being swallowed where a call
site has no error surface of its own, and lib/ack-manifest.ts records which channel every
mutating export of lib/api.ts actually uses. That manifest is paired with a test, on the
crew-wire guard's philosophy (scripts/check-crew-wire.sh): it cannot verify an acknowledgement renders, but a
mutation added next month fails the test until its author writes one classified line — and that
line gets reviewed.
The ask was that notices float over content always. That is right for events and wrong for
standing conditions, and both failure modes are lived experience in this repo. The pane screen
once floated the status line over the mirror; it covered the terminal tail — the newest output, the
reason the screen is open. The fix was to move it off the tail, not out of the overlay: it floats at
the top of the pane's content region, over the tab and pane strips (agent-chat.tsx:990-1004), and
shrinks nothing. It was briefly an in-flow row instead, and that was worse in the other direction —
every "Sent" pushed the strips and the whole mirror down 30px and pulled them back 2.5s later, so
the page moved twice to say one word. The two failures belong to two categories. A 2.5s toast over the
tail is bad precisely because it fires while you are watching the tail; a minutes-long "you are
read-only" box, floated, is bad the other way — it either occludes for minutes or fades and leaves
the composer inexplicably dead, which is a lie by omission. Hence the ruling: a notice that will
outlive the operator's next interaction holds space; anything shorter floats. A standing condition
costs space because it costs capability, and those pixels buy a fact the operator must not lose.
The one exception is the system strip, which floats although it stands (2026-10-07). It covers the top of the route, whatever sits directly under the header: the tab and pane strips on a pane, the filter row on the dashboard. It sat in flow under the bar for one day, and an outage then shoved the pane strip down under the operator's thumb, which §2 grades as a fault. The two things the ruling protects still hold. The strip occludes no capability it does not also explain: a lost connection is exactly when the rows beneath it are stale. And it never fades on its own: it stays until its condition clears or the operator dismisses it, and the header's mark keeps the badge after a dismiss.
The z ladder the band sits on. z-20 is the top of everything in flow: the sticky header, the
composer dock, the Changes file bar, the chat docks. The band is z-30, so it covers all of them.
z-40 is the toasts and the anchored menu's dismiss surface, z-50 the sheets, the update screen and
the idle lock, so all of those cover the band. A new in-flow surface stays at z-20 or below.
web/src/lib/strip-priority.ts — AUTH 40 > OUTAGE 30 > DEGRADED 20 > UPDATE 10, in steps of ten
so a future level slots into a gap without renumbering anything. It is on the feature side
because ui/strip-host.tsx is domain-blind: it knows only that a bigger number wins, never what a
connection or an update is. The band shows one strip at a time: two would cover ~66px of a
390×844 phone and double the number of times the band changes, and every pair has a strict answer anyway. The
losing fact is not lost — the update offer keeps its footer line and its settings control.
- No state may move content except through
Collapse. §2 forbids a state that re-lays-out; a notice arriving is that fault one order of magnitude larger.ui/collapse.tsxis the single sanctioned exception —grid-template-rows: 0fr↔1frplus opacity over 240ms — because the height change is then continuous and eased, so neighbouring content (the mirror included) animates instead of teleporting. It holds its last child through the exit, so a box closes on the sentence that explained it. No bare conditional mount, nohidden, no unanimated pop. Its two siblings inui/presence.tsxfollow the same rule for the cases one Collapse cannot reach:PresenceListfor keyed items of a list,HeightSwapfor one band whose content is replaced (2026-11-10, the Hill). One move lands at once: the person's own send (M104, 2026-11-17). At the tap the box empties and takes its closed shape, and the person's line stands in Chat with the working row's room under it, all in the frame of the tap and with no animation, so the page moves once, under the finger that moved it, rather than easing half a second later when the receipt comes. After the tap nothing on the screen moves until the answer is added at the end: the log's line takes the pending line's place at the same height, "Still working" fills the room kept for it, and when it goes its room stays in the list's one tail room (--tail-room). Every other open and close of the box still plays. The belt's X leaves by opacity and keeps its width until the next key press. - A dismissible standing condition needs a permanent second surface. Dismissal must not be able to leave the operator misinformed. The update strip may be dismissed because the same fact also sits in the footer and in Settings. The connection and auth strips may not: the remedy button is the only honest exit. Scope notices may not: they explain dead controls, and a refusal with no visible reason is the shape of issue #103.
ui/notice.tsx takes announce: "alert" emits role="alert" and nothing else, "status" emits
role="status" and nothing else, "none" emits neither. There is deliberately no way to ask for
both. This is a correction, not a preference — connection-banner.tsx carried role="alert"
beside aria-live="polite" in both of its rows until the band conversion, which asks for assertive
and polite at once and lets the answer depend on which screen reader is reading. A role already
carries its own
implicit liveness; a second declaration beside it asks one question twice. strip-host.tsx:108-109
keeps one empty polite region and one assertive region mounted permanently, because a live region
has to exist before its content changes to be announced reliably.
min-h-[33px] for a strip, min-h-[42px] for a box, stated once in ui/notice.tsx and not
lowerable by a caller. Both are derived, not picked: the 24px action slot plus the shape's own
padding plus its border, which border-box counts inside a min-height. min-h and never h, for
the reason §6 gives at app-header.tsx:212. They are floors — a two-line host-stale message
legitimately grows its box — and what they buy is that two one-line notices are the same height
whether or not one carries a button, so swapping one strip for another inside the open band
repaints it and never moves it.
On a phone the edge swipe is history back, so the history stack must be the level tree
(ADR 0067). Navigate through useNav()
(web/src/hooks/use-nav.ts), never a bare navigate(path):
- Down (
nav.down) pushes and recordsfrom. Opening a space, a pane, History, Changes, the zoomed output, Settings, Crew, Updates, New. - Sideways (
nav.side) replaces and carriesfrom. Pane to pane, tab to tab, space chip to space chip, the machine and session switchers.nav.openpicks down or sideways for a new pane. - Up (
nav.up(parent),nav.upTo(parent)) steps back when the entry behind is a legitimate parent, else replaces ontoparent. Every back arrow, the Collie mark inside a level, every close and every automatic exit. Never push a parent. - A new route gets its place in
ancestorsOfandparentChain(web/src/lib/nav.ts) in the same change. - A sheet owns no history entry. It opens and closes without navigating. A full-screen view that
the phone's back must close is not a sheet. It is a level with its own path. The zoomed output is
/pane/:id/zoom, a child of the pane route, so the pane stays mounted under it. - On phones, a screen below a pane repeats its Back at the bottom on the thumb side. The header
arrow is out of reach of a thumb on a large phone. The bottom Back (
BackBar, incomponents/back-bar.tsx, built onui/bottom-bar.tsx) takes the same handler and the same name as the arrow, from one object, so the two cannot drift; it sits at the right end, or the left with thehandpref onleft, and it hides while the keyboard is up. The arrow stays at every width.
A glide is reserved for the one case where a row IS the next screen's header — one element
carries its identity forward, not merely its position (the rule is in the header of
web/src/lib/glide.ts). Forward is the tap on that row; reverse is the in-app back arrow alone,
never the swipe. Every other move stays what it was: a sideways move crossfades or slides, and the
phone's own edge swipe plays the phone's own animation, never one of ours.
From 1.22.0 a person can pick a theme or import one (ADR 0148).
A theme is a closed JSON file: a light half and a dark half of named colour tokens, one UI face, and, from
schema version 2, a surface block of thirteen closed words, a display face and a terminal palette of
gate-checked colours. It changes the
VALUE of a token. It never changes which token a component uses.
So every colour a component draws is a token from the list below. A theme reaches a token and
nothing else. A literal colour in a component (bg-white, text-white, amber-300, zinc-*, an
oklch or hex in a class) is now a theme bug: it paints the same under every theme. The literals
that exist today are §10 gap 6. A dark: variant that switches between two tokens is the same bug
in a quieter form, because it fixes which token each half uses. Write one token whose two values
come from light-dark().
The list, 43 tokens per half.
| Group | Tokens |
|---|---|
| Surfaces and inks (21) | background foreground card card-foreground chrome primary primary-foreground secondary secondary-foreground muted muted-foreground accent accent-foreground control-on control-on-foreground destructive destructive-foreground border input rule ring |
| Status (6) | status-blocked status-working status-done status-idle status-unknown status-info |
| Syntax (6) | syntax-keyword syntax-string syntax-constant syntax-property syntax-entity syntax-comment |
| Host identity (10) | host-0 to host-9 |
popover and popover-foreground stay aliases of card and are not in a theme file.
pane-active (1.24.0) is the frame of the pane you are working in on a large screen, and nothing else. It is outside the 43 but a theme can set it: from schema version 3 it is an optional token in either half. Since ADR 0174 it is a derived token like surface-recess and surface-paper: the :root pair is the "on" ink mixed into the page (70% light, 60% dark, in OKLab), the file for collie holds no value, and a theme that leaves it out takes that relation over its own tokens, so every file written before version 3 reads and exports unchanged; a file that sets it must say version 3. A theme's own value goes through the same mix in place of the "on" ink, so it is drawn as quiet as Collie's, and deriveTokens holds the frame at 3:1 on the recess, the page and the paper, so it may move the mix. The contrast report holds it to 3:1 on background in a half that sets it. Nightwatch sets its own, a warm amber for its palette.
tab-active is the second optional token, and it marks the open tab and the open pane for a theme whose surface word tabs is folder (lib/tab-look.ts): the 2px top edge of the open folder tab and the 1px ring of the open pane. It has the same rules as pane-active (version 3, a :root pair that is the foreground ink of each half, 3:1 on background in a half that sets it). Under the word plain (the word a theme gets when it names none; the Collie theme names folder) the tab row and the pane row are drawn exactly as they were, and tab-active is read by nothing. On the large screen both words are drawn in the space bar on the same parts (ADR 0171): the bar ends on --edge-firm with a 6px page band under it. folder cuts the open tab from that band, the page colour with the firm edge on its top and sides (tab-active is not read there); plain draws no card and puts a 2px bar of the theme's ink (--foreground) under the open tab, as wide as the tab, square ends. In both the open tab is full ink and semibold and every other tab regular weight in muted-foreground, and the resting status rings are drawn at full stroke. The column frame's colour is never used in the bar or a header. composer is the third word that sets no CSS (field or box); lib/composer-layout.ts reads it.
find is the third optional token (1.29.0), the ground of a found or matched piece of text: ui/match-text.tsx's <mark>, Find in Chat's hit in the transcript and in the Markdown reader. Its value carries alpha, because it is laid over whatever the text sits on and the ink stays the caller's own. Its :root pair is the amber the app drew as a literal before the token existed, Tailwind 4.3.1's amber-300 at 70% in the light half and amber-500 at 40% in the dark half, so the default themes look as they did. It follows the rules of tab-active (version 3, a :root pair, filled from collie when a theme sets one half); the contrast report measures foreground on the token laid over background at 4.5:1, in a half that sets it. The three shipped themes other than collie leave it out and inherit the amber.
surface-recess and surface-paper are the fourth and fifth optional tokens, the large screen's recess and paper (§4). Their default is not a :root pair of colours but an expression per half derived from the theme's own background and card (§4 has the steps), so a theme gets both without naming them; the file for collie holds no value for them, and a theme that sets one half gets the expression in the other. A theme may set either one (version 3); the contrast report then measures foreground and muted-foreground on it at 4.5:1, in a half that sets it.
The name "ColliePWA" in the large screen's sidebar draws "PWA" in the muted ink at rest and in the three status tokens under a pointer or keyboard focus on the logo row: P status-done, W status-working, A status-blocked. The name is the brand's own drawing, the letter shapes of Aldrich as outlines (components/collie-wordmark.tsx, generated in collie-brand, the same file the website draws), so the face the device chose never reaches it. It is not a token of its own, and no application state may ever drive those inks.
The version 2 tokens. Each is a closed list. A file names a word, and one table says what the word
does (web/src/lib/theme/surface.ts). Ten words set a style. zoom, tabs and composer set none: the
app reads the word itself, and tabs and composer are described above. The default word of every token is what the stylesheet draws, which is
the look of the Collie theme: flat, bold, band and sentence among them. tabs and composer keep
plain and field as the word of a theme that names none, and Collie names folder and box.
| Token | Words |
|---|---|
radius |
sharp (default, 2px), soft, round |
shadow |
flat (default), default (the stock soft shadows), lifted |
density |
default, roomy (never below default) |
weight |
bold (default), default (500 and 600) |
border |
default (1px), strong (2px) |
ground |
flat, gradient, grain |
chrome |
band (default), page |
rows |
rules, cards |
icons |
default, thin, heavy |
labels |
sentence (default), caps |
zoom |
screen (default), none: whether the belt's Zoom pill shows in the Screen view (1.26.2) |
fonts.display |
one of the seven shipped faces |
ansi |
all 18 mirror colours (slots 0 to 15, ink, ground) or none, each held to its contrast floor |
A component reads a word through the utility it already uses (rounded-md, shadow-sm, p-4,
font-medium, border) and never through a literal. Three more doors exist for the tokens a utility
cannot reach: a small section label wears label-caps, a list that follows rows takes
data-slot="list-group", and a title wears the display face through --font-display.
What a theme never reaches. Layout, tap sizes and row heights as free values (roomy is a word, and it
never goes below the default), motion, the type scale, any other free value, and the meaning of a status:
its icon and its word stay as the status components draw them. The type scale stays out while the app
holds about 130 arbitrary text-[Npx] sizes. The home-screen icon and the splash look the same under every
theme. The header mark is the Collie dog unless a theme names a character (character, from schema version 4) or
the device picks one; a character is a closed word and never a drawing. The terminal mirror keeps its dark space (§8, ADR 0002) under every
theme. A version 2 theme may name the mirror's palette and ground, authored in dark space, and the light
half inverts them with the mirror.
A marked row takes --edge-accent. A row marked as selected or blocked by an inset shadow writes
shadow-[var(--edge-accent)_<colour>], never the offsets. The radius word sets them: a 2px bar on
the left edge under sharp (the Collie theme), a 2px ring on all four sides under soft and
round, because a left accent bar is never combined with rounded corners.
The rules a theme does not relax. §4 still holds under every theme: chrome is set off by a line (a rule on the page, the border on a band), red marks harm, a raised panel is card. A shipped theme passes the contrast
gate: every status chip at /15 over background and card at 4.5:1 or better, body text at
4.5:1 or better, rule against background at 1.3:1 or better, in both halves. A gradient or grain
ground and a band are measured too, at the far end of the ground and on secondary.
Adding a token is a schema change. A new colour role that a component needs goes into the
list only with a new schema version, and in the same change: index.css, every shipped theme
file, the validator, the word table in surface.ts and the lists spelled in public/theme-init.js.
The coupling test (§9) and bun scripts/build-themes.ts --check fail when they drift. Until then, reuse the nearest token; do not paint a literal.
A theme names its base colours. Hover, selection, the open look, the focus ring and the large screen's planes are not among them: the app makes them from the base colours. Each one must stay visible on any theme, not only on the four shipped ones (ADR 0172).
One function makes them. deriveTokens(base, half) in web/src/lib/theme/derive.ts takes one half of a
theme and returns the recess, the paper, a hover, a selected and an open fill for each plane, the ring and the firm
edge. Each
value is made in two steps.
- Collie's relation: the same expression Collie's stylesheet uses today.
- A floor: when the value is too close to its ground, its lightness moves on in the same direction until it meets the floor. When that direction runs out of range, it goes the other way. Hue and chroma stay.
applyTheme (lib/theme/store.ts) runs it for every theme it applies, the three other shipped themes included,
and sets the result inline beside the base tokens. Collie applies no theme. Its stylesheet holds the same
relations in index.css.
The reference test. derive.test.ts puts Collie's own base tokens through the function. It reads them from
src/themes/collie.json, which themes.test.ts holds equal to index.css; the relations are held to index.css's
own lines. The result must be Collie as painted, within 0.005 in OKLab, in both halves. The worst value today is 0.0021, the dark recess. This
test keeps Altan's approved look and the function from drifting apart. The themes set also holds the 241 state
colours Collie painted on 2026-11-21 (web/e2e/themes/collie-states.json), within 0.02.
| Derived token | Collie's relation | Floor |
|---|---|---|
--surface-recess |
the page 0.05 darker | the muted ink and the foreground keep 4.5:1 on it (or what they have on the page, when the theme gives less), on the page's side of the ink; 0.025 off the page, either way |
--surface-paper |
light: the card 0.05 lighter, at most white; dark: halfway between the page and the card 0.05 lighter | the same inks; 0.025 off the page and the recess, only in its own direction, so a white page keeps a white paper |
--state-hover-<plane> |
the accent on the page and the paper; the paper on the recess | 0.04 off its ground; the foreground and the muted ink as readable as on the page |
--state-on-<plane> |
the same as the hover | 0.06 off its ground; the same inks |
--state-open-<plane> |
--control-on |
0.06 off its ground; the on-colour's ink as readable as on the tint |
--ring |
the theme's own ring | 3:1 on the page, the card, the recess, the paper, the band, the muted fill and each plane's hover and selected fill |
--edge-firm |
the ink 58% into the page (color-mix in oklch) |
3:1 on the recess, the page and the paper |
Where floors fight, the function takes the best value it can reach; deriveReport names each floor not met. A
theme's own ring and planes are a start that a floor may move. The state variables (--state-hover-<plane> and
the rest) are internal names and no contract for a theme file.
A pushed value lands 0.006 past a distance floor and 0.1 past a ratio floor, because the screen rounds it to 8 bits. A fill on the page that has to move is also kept off the recess, because a strip of the recess with no plane class (the space header) shows the page's fills. The ring has no floor against a filled primary button. It stands 2px off the box, so a ground is on both its sides, and Collie's dark ring is 1.9:1 against its white primary.
The classes read variables. A hover reads --state-hover, a selected item --state-on, an open trigger
--state-open. Each plane class points the three at its plane: RECESS_ACCENT (ui/nav-edge.ts), PAPER_PLANE and
PAGE_PLANE (strip-column.tsx). The root holds the page's. A plane also points --accent at its --state-on, so a
bg-accent that is not swept yet gets the floor too. HOVER_FILL, TRIGGER_OPEN, the ghost and outline buttons and
the pane row read the variables. Never write a new hover:bg-muted/60 or bg-accent for a state.
A theme's own text is never adjusted. A theme whose own text is under 4.5:1 is warned about and applied as it is,
with no adjustment at load and no refusal (Altan, 2026-11-21). The state colours work from that ink, so
deriveReport can name a floor that cannot be met; that is accepted.