Chats page — agent-drawn cards and their parsers, buttons, approval and proposal cards, text hazards, artifacts and sharing, shells. A repository rule for apps/ui/src/renderer/chats/*-payload.ts, apps/ui/src/renderer/chats/action-*, apps/ui/src/renderer/chats/use-chat-actions*, apps/ui/src/renderer/chats/command-confirm-dialog*, apps/ui/src/renderer/chats/recommendations-*, apps/ui/src/renderer/chats/transcript-groups*, apps/ui/src/renderer/chats/geniro-tool*, apps/ui/src/renderer/chats/chart...
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Rule Ui Chats Cards?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/geniro-io-rule-ui-chats-cards)
---
name: rule-ui-chats-cards
description: "Chats page — agent-drawn cards and their parsers, buttons, approval and proposal cards, text hazards, artifacts and sharing, shells. A repository rule for apps/ui/src/renderer/chats/*-payload.ts, apps/ui/src/renderer/chats/action-*, apps/ui/src/renderer/chats/use-chat-actions*, apps/ui/src/renderer/chats/command-confirm-dialog*, apps/ui/src/renderer/chats/recommendations-*, apps/ui/src/renderer/chats/transcript-groups*, apps/ui/src/renderer/chats/geniro-tool*, apps/ui/src/renderer/chats/chart-block*, apps/ui/src/renderer/chats/metrics-block*, apps/ui/src/renderer/chats/comparison-block*, apps/ui/src/renderer/chats/gallery-block*, apps/ui/src/renderer/chats/a2ui-*, apps/ui/src/renderer/chats/use-surface*, apps/ui/src/renderer/chats/local-image-loader*, apps/ui/src/renderer/chats/workflow-block*, apps/ui/src/renderer/chats/diff-view*, apps/ui/src/renderer/chats/approval-card*, apps/ui/src/renderer/chats/plan-card*, apps/ui/src/renderer/chats/agent-event-*, apps/ui/src/renderer/chats/call-answers*, apps/ui/src/renderer/chats/thread-event-card*, apps/ui/src/renderer/chats/thread-question-card*, apps/ui/src/renderer/chats/team-proposal-card*, apps/ui/src/renderer/chats/team-proposal-changes*, apps/ui/src/renderer/chats/team-portrait*, apps/ui/src/renderer/chats/team-change-chips*, apps/ui/src/renderer/chats/team-change-list*, apps/ui/src/renderer/chats/settled-fold*, apps/ui/src/renderer/chats/verdict-note*, apps/ui/src/renderer/chats/text-hazard*, apps/ui/src/renderer/chats/use-one-shot-verdict*, apps/ui/src/renderer/chats/task-list*, apps/ui/src/renderer/chats/artifact-*, apps/ui/src/renderer/chats/published-artifact*, apps/ui/src/renderer/chats/use-artifact-sharing*, apps/ui/src/renderer/chats/use-run-artifacts*, apps/ui/src/renderer/chats/shell-*, apps/ui/src/renderer/components/stage-graph*, apps/ui/src/renderer/components/sign-in-action*; read it before editing a file there."
---
<!-- GENERATED by scripts/sync-agent-rules.mjs from .claude/rules/ui-chats-cards.md. DO NOT EDIT: edit the source, then run `pnpm sync:agent-rules`. -->
# Chats — cards, artifacts and shells
**Cards (agent-drawn payloads):**
- Each card kind has a twin parser (`*-payload.ts`) of the daemon's schema.
- Agent buttons (`action-chip.tsx`, `action-card.tsx`, `use-chat-actions.ts`): what is pressable is run state's `actions`, never a fold of the window. A press refused `RUN_BUSY` is retried by the hook (same seq, same `clientMessageId`) once the turn settles, never through the composer queue, which would send the text without recording the press. The shelf group sits after the stage chip, ahead of the running team chip. A team run presses through the team routes (the hook takes whichever API the open run needs; the chat route refuses a team run), and its busy refusals are asked again on `ACTION_RETRY_MS`, since its run state opens no turn. A button whose `publisher.agentLabel` is set (another team agent's) says so: `· <agent>` on the chip, `from <agent>` on the card, linking to its call's card, which it opens (`ChatActions.openCall`: the `call:<blockId>` thread flag, then a reveal, paging first when the card is off the window; the call conversation popup's Show in chat does the same). A stop button lists what it stops (`spec.targets`: command and pid, plus what these start by the press) on its card and in the chip's tooltip before it is pressed, and its status reads `stopped` or `already stopped` (`alreadyStopped`).
- A command action opens `CommandConfirmDialog` from the chip, the card and the overflow row alike (the confirm state lives in `useChatActions`: `press` only sets `confirming`; one dialog per surface in `ChatProviders`), showing the exact argv, one quoted token per argument, and the folder. Nothing is sent until "Run command". The card shows the command (`Runs:`) before and after the press and, once it ends, its last run's status (exit code or error) even while the button stays live — a failed or reusable command stays pressable — plus a folded `Output` with the tail (`outputTail`, drawn through `AnsiText`, fold kept per thread). Only a message press starts a turn (`pressStartsTurn`), so only it raises a surface's working flag (the builder dock's).
- A recommendations card's knowledge items (`K-`) sit in a group of their own. A move's two sides are ticked and unticked together and each names the other (`movePartnerOf`), since the daemon refuses an Apply of one (`MOVE_SPLIT`).
- A system analysis's card (`sourceKind: 'system'`) draws `RecommendationsCard`'s `actions` in place of Apply: a split button — Create cards (default), Implement right away, Keep as report — whose first two open a project dialog with nothing preselected and Keep as report posts no project (`POST /v1/system-analyses/:runId/apply` through `SystemRecommendationsApplyContext`, provided by `Chats` with its project refs). Its `geniro` items (`G-`) are a group of their own, listed first; each item's badges read its outcome row's note (`filed <KEY>`, `filed to start <KEY>`, `started <KEY>`, failed). The parser (`recommendations-payload.ts`) is the twin of the daemon's card schema: `geniro`, `sourceKind: 'system'` and `addressesFlags`.
- A team card states the population beside the sample (`data-slot="analysis-population"`: the runs read of how many the team has, with the average over all of them) and in the projection's footnote, drawn from `teamStats.population`, which the daemon measures over every ledger row; never folded here. An external item (`X-`) sits in a group of its own, "Other repositories": applying it files a board card, so its outcome note names that card.
- `isCardEntry` (`transcript-groups.ts`) is the one predicate over card kinds. Never write a `'task-list' || …` chain.
- A new card tool also goes in `GENIRO_TOOL_NAMES`, which the compiler cannot check.
- Charts key rows by position (`s0`, `s1`, …), never by series name. `null` stays a gap.
- Metrics colour a delta by stated sentiment, never by sign.
- The gallery loads through `LocalImageLoaderContext`. It does that sequentially and only while open, releases images on fold, and uses no lightbox of its own. A picture named by URL arrives already downloaded by the daemon (a local path, with the URL as `source`); the renderer never fetches one. Each card shows its caption and description under the picture in one horizontally scrolling strip, and the viewer shows the description too.
- An A2UI card (`show_ui`: `a2ui-surface.tsx`, `a2ui-components.tsx` over the pure `a2ui-model.ts`, `use-surface.ts`): drawn at its `create` row only (`SurfaceEntry`), read whole from `GET …/surfaces/:surfaceId` and read again when run state's `surfaces` names a newer version, so later rows draw nothing of their own. Every catalog component is drawn with this design system's primitives, never `@a2ui/react`; Text is the chat's markdown with links, pictures and HTML stripped (`cardMarkdown`), and a link is an `openUrl` button through `ChatLink`. Values typed are saved as drafts (`useDebouncedPersist`), an obscured field's never; a draft refused `UI_SURFACE_CHANGED` is read again and sent again without the pointers the agent wrote, and a field the agent overwrote is marked (`overriddenDrafts`). A press resolves the button's `userMessage` and `context` here (a List template's scope is known only here), keeps one `clientMessageId` through its `RUN_BUSY` retries (on the chat's turn closing, on `ACTION_RETRY_MS` in a team run) and goes through the team route in a team run. Media arrives as base64 from the chat route: a picture as a `data:` URL, video and sound as a `blob:` URL made on Play and revoked on unmount (the renderer CSP's `media-src 'self' blob:`).
- Dynamic workflow: the roster is taken whole. A launch is recognised by a `workflow_info` row, never by tool name.
- `save_project_instructions` renders as an ordinary approval card (`diff-view.tsx` `editDiffOf`), drawing the daemon's unified hunks and the `P-` ids it carries out (`projectInstructionsCardOf`, `UnifiedDiff`) while its hazard scan reads the whole old and new text; the verdict row's `outcome` (`not-saved` draws "✗ Not saved") and `answer` say what Apply did. The card marks the words that changed inside paired lines (`UnifiedDiff` `wordLevel`). It is `'patch'` in `GENIRO_TOOLS` (`isProposedChange`); a refused `save_project_instructions` call keeps its row (`transcript-groups.ts`).
- A plan or question row that cannot be parsed falls back to the permission body.
- `propose_team` draws `TeamProposalCard` from its `approval_request` row (`team-proposal-payload.ts`, twin of the daemon's `TeamProposalSchema` / `TeamDiff` / `TeamProposalOutcome`); an unreadable payload falls back to the permission body. The agent's `summary` and `reason` (a change sent as edits, from any chat, always carries both) are drawn as its own words under the team line. Saved / not saved is the verdict row's `outcome`, never the agent-bound message. A card whose team half changes nothing (`diff.identical`) says so in its tag and its saved line, and offers Open project instead of Open team where the surface can open one (`onOpenProject`; the project's own chat, already on that page, cannot). Its Approve gate scans every string the card can draw, raw (`proposalScanText`), the diff's old side included; every word the card builds is either one of those strings or a constant. `components/stage-graph-flow.tsx`, `lazy()` behind `StageGraph`, is the only chat-reachable importer of `@xyflow/react` and `elkjs`. A new team's card is the team's portrait (`chats/team-portrait.tsx`), all of it open: a header saying who proposes what, with a count; the team line (faces, name, New, description); the members as rows (`MemberDisclosureRow`, the Teams page's row: role, `cli · model · effort` over the approval words, opening onto character, pool and the blocks it gets, never its private instructions whole); the stages as a path (`StagePath`: the first-message member, then each stage's number, owners, goal and where it hands on); the team instructions. Lists show 6 members and 7 stages, then Show N more, and a list one over its limit shows whole; open rows and unfolded lists are thread flags under the card's request id. A change is worded by `team-proposal-changes.ts`, one entry per member, stage, block or team field: ids as names and titles, approval modes as words, technical fields labelled, an unknown field under its own name and never dropped, a value the daemon cut shown as cut. A replacement draws only what changes (user decision): the team line (Replaces, its name and description changes as "was → now"), its "What changes" chips (those that make an agent run unasked first, with a shield; a text change with the lines it adds and removes, `changeLineCounts`), whose press scrolls to the entry and flashes it, then `chats/team-change-list.tsx`: one entry per change, open by default and folded by a press on its head (thread flags under the card's request id) — a short field as "was → now", a long text as its line diff (`DiffView` with `wordLevel`, capped at `CHANGE_DIFF_ROWS` before Show all), an added agent's role and approval, a removed entry struck from what the daemon quoted of it. An unchanged member, stage or block draws nothing. A project's overlay and a project's instructions the same Approve writes are sections of their own beside the shared team, each a `UnifiedDiff` (`overlay`, `project`, each read tolerantly and dropped whole when malformed), its approval line naming every file it changes; a proposal recorded in the node-graph shape is read through `teamFromLegacyGraph`. A run_team card draws the same rows: the plan, this chat as manager and each agent with its task, or a change's chips and its New / Removed / Changed rows, an instructions update as an excerpt of the two texts. The card stands across turns, so it counts as needs-input only while no turn streams (`standsAcrossTurns`, the daemon's `awaitingOf`).
- A command center thread's open request, relayed into the manager chat (`thread_question`, twin of the daemon's `ThreadQuestionCardInput`), draws `ThreadQuestionCard` (`thread-question-card.tsx`) around the thread's own `ApprovalCard`, never a second card body; an unreadable relay falls through to the permission body. Its verdict goes to the manager's own card id, which the daemon forwards to the thread, and a picture sent with the answer — pasted into the card, or staged in the manager composer (its paperclip) when the answer is given — goes to the thread's own message route, the answer text counting both (`threadQuestionRelayOfRow` in `Chats.tsx`'s `respondApproval`, `deliverRelayedImages`), never into a manager turn: refused RUN_BUSY by the turn the answer started, it is sent again on the thread's next settle, at most `THREAD_DELIVERY_ATTEMPTS` times (`deliverToThread` in `chats/thread-delivery.ts`, the one send-and-wait-out-RUN_BUSY path a card uses). Once answered or closed its header says the thread asked, no longer that it waits; closed with no answer, it says so in place of the card and names its own question on one line — the first question's header and its first line, `(+N more)` for several — so closed questions of one thread read apart (user decision). Above its thread head it offers the card's ways into the thread (`ThreadCardActions`, below); under it, the last `QUESTION_CONTEXT_MESSAGES` messages before its request (a call's question: the call's brief beside them) and nothing of the asking turn: no page or picture, for any question — read at once and drawn folded as a preview of the last one (three lines fading out, and that message's pictures as thumbnails that open in the image viewer) under one Show messages, which opens every message in full with no second Show more and turns into Hide messages (user decision 2026-12-03, `question-context-messages.tsx`), except on a card closed with no answer, where nothing is read until Show messages is pressed (user decision: opening the manager chat reads nothing for closed cards). The Needs you gallery heads a waiting request with the same block (`ThreadRequestContext`). The messages are read through `ThreadContextReaderContext`, provided by `Chats` and the command center through `threadContextReaderOf(chats, handle)` over `listRunItems` with `conversation=root`; cards of one thread share each read while it is in flight, and one reader keeps at most `CONTEXT_READS_AT_ONCE` of its item and call-message reads in flight at a time; `messagesBefore` cuts the page at the relay's `threadRequestId`, the page's newest messages when the request is not on it. Each is drawn only where its context is provided. A question row's `attachments` (twin of the daemon's `utils/question-attachments.ts`, read by `question-attachments-payload.ts` and relayed verbatim on `ThreadQuestionCardInput`) are the pages its agent passed in `ask_user_question`'s `artifacts`, and the card draws ONLY those, through `question-attachments.tsx`: the page's key is read from the thread run's own artifact listing at draw time, never stored, and a page the listing does not hold, or a listing that fails, draws the unavailable note. A stored list is drawn only for a question asked through `ask_user_question` (`ASK_USER_QUESTION_TOOL`); any other tool's reads as none, and a row with no `attachments` key draws no page. There is no "+N more" line. Chips on the folded card, on a card closed with no answer and on the thread's own `QuestionCard`, loading nothing until pressed; each chip (and an unavailable page's note) names the page's title and the version the question attached (`v5`, `question-attachment-version`), the title giving way first.
- In the command center's manager chat (`HostedThread.commandCenterManager`), a thread's Done card is drawn in full from the newest row announcing it only (`newestDoneSeqByRun`, `ThreadDoneNewestContext`, `drawsDoneCard` — the feed's twin of the Needs you gallery's finished and needs-decision cards, counted together by `command-center/needs-you-feed-parity.spec.ts`; the gallery draws its own Inbox card, `ThreadEventCard` is the manager chat's alone); an older row of the thread folds to one line, "Finished earlier" with its time, that opens onto that row's own frozen summary (`EarlierFinishCard`, fold kept per thread under `thread-done-earlier:<runId>:<seq>`), and draws nothing once dismissed or once the thread is archived (user decision: a newer finish gets its own card and the older one stays, closed), shows the board's live report when it has one (`CommandCenterCard.report`, the daemon's reading, never `RunDto.lastMessage`, which may be the user's; `threadReportsOf` → `HostedThread.threadReports` → `ThreadReportsContext`, the row's frozen summary otherwise), heads it with the thread's `ThreadHead` from `ThreadIdentityContext` — face, title, its pull request as a `ChatLink` to the address the board knows (`ThreadPullRequest.url`, a plain label where none is known), status, agent or team, board card and project — while the thread's live board status (`ThreadIdentityContext`) says it is no longer finished, the card says so instead of Done — Working again while it works, Needs you while it asks or waits on an approval, Failed once it failed (`reopenedKindOf`) — with that live status in its head and only Reply and Open chat, no Dismiss, Archive or page chips; done, idle, in review or a thread the board does not know reads Done; and its Dismiss removes it on every device: `POST /v1/command-center/done/:runId/dismiss` with the row's seq through `ThreadDoneDismissalsContext` (`useManagerNotices`' `dismissDone`), a row at or below the thread's dismissed seq drawing nothing (`isDoneDismissed`), and the newest one too while the dismissal names the finish the board names now (`ThreadFinishKeysContext`, from `HostedThread.threadFinishKeys`), so the thread's next finish, a newer row or a new `finishKey`, arrives as a new card; outside the manager chat no Dismiss is offered. The card also names the pages the thread published as chips (`ThreadDonePages`, from the thread's own listing). A `waitingItems` row (twin of the daemon's `WaitingItemsRow`) draws `WaitingItemsCard`: each item's live state from `useWaitingItems` (pending memory entries, waiting lessons, pending knowledge revisions, re-read on their change announces), drawn with the Settings rows themselves (`MemoryRow`, `LessonProposalRow`, `KnowledgeReview` in a dialog) and one quiet resolved line once it no longer waits; outside the manager chat its titles alone. What else waits in Settings is a row too, one per notice the daemon keeps (`command_center_notices`, `.claude/rules/daemon-host-tools-threads.md`): a `settingsNotice` row (twin `chats/settings-notice-payload.ts`) draws `SettingsNoticeCard` (`chats/settings-attention-cards.tsx`) at its own place in the conversation, never after it. The card reads its notice from `SettingsNoticesContext` (`useSettingsNotices`, mounted by `SettingsNoticesScope` in the manager chat only, over the notices `HostedThread.managerNotices` hands it: `useManagerNotices` in `CommandCenter`, `GET /v1/command-center/notices`, re-read on `command_center_changed` reason `notices` and after a reconnect, whose `unresolved` — open and not dismissed — is the count on the page's chat button) and is drawn from the readings Settings itself draws — the update of the CLI or the signed-out account its key names (`useCliAttention`'s detections, `useCliUpdates`, `useCliLogin` with `CliLoginProgress`), the shares waiting on a sign-in of the place its key names (`SignInAction`; never read on a paired device, the share routes being desktop only, so there the card is drawn from what the notice holds — the place's name, its count of waiting shares — with "Sign in on the Mac." instead of the button) and the undecided memory findings as one count whose Review conflicts reaches `App` through `HostedThread.onOpenMemoryConflicts` (Settings → Memory → Clean up on Conflicts); the daemon lists are `useWaitingSet` reads, held only while the chat is `active`. It draws nothing once its notice is resolved or dismissed, or while its reading answers that nothing waits, except a sign-in under way of its own account, whose progress only that card draws (titled "Signing in" with the account's name once its notice resolved) and which lets the card go once it ends; only that card loses its Dismiss while its sign-in runs, and a sign-in that ended gives every card its Dismiss and Sign in back. While the reading is not known — a CLI check under way or failed, a CLI that could not say whether it has an update or whether an account is signed in — it is drawn from what the notice holds (the newest version, the account its key names, the waiting shares or findings until their list is first read); a CLI update names the newest version the notice holds, the same on every device, and the CLIs are read again whenever the notices change. The desktop window reports what Electron main reads — the agent CLIs — through the desktop-only `PUT /v1/command-center/notices/readings` (`useNoticeReadingsReport` in `App` over `reportedNoticeReadings`, items keyed as the notices key them, an answer not known right now reported `unsettled`), whenever that reading changes and after a reconnect, whether the chat is open or not; every `useCliAttention` in the window shares each reading any of them took, so a sign-in finished from a card reaches that report at once. Dismiss is `POST /v1/command-center/notices/:noticeId/dismiss`, from any device: the card goes everywhere and comes back only as a new notice. Both kinds of card frame through `chats/notice-card.tsx`. An `app-update` notice an earlier build wrote draws nothing (`settingsNoticeView` returns null for it) and counts for nothing (`noticeUnresolved`).
- Every agent-interaction event is ONE card, `AgentEventCard` (`agent-event-card.tsx`: the event line with its actions at its end, then the compact one-line `ThreadHead`, text rail folded at 8 lines, inert options, outcome line; reads no context; a thread's Done card wears the graph node's full head instead — `fullHead`: the title on two lines, the labels on their own — and keeps its time and actions in the node's foot, `ThreadFoot`), one `KIND_META` for every kind. Its wrappers: `ThreadEventCard` (another thread), `MemberEventCard` (a member of the run: its `MemberAvatar` face and CLI label, Open call through `RevealCallContext`, plain where no card is loaded) and `MonitorEventCard` (folded to ONE line through `AgentEventCard`'s `line` — the kind's icon, the monitor's title, its state chip (`monitorStatusOf`), its id, its agent and how much it printed, the kind and command in the line's tooltip — which opens, kept per thread, onto its command, timeout and whole output; nothing of the output shows while folded; a row without command or timeout opens onto its output alone). `transcript-item.tsx` routes to them: a `system` row `readAgentCallEvents` reads (`agent-event-payload.ts`: `wake`, `toldWorking`, `orphanQuestion`, else the stored sentences of rows written before those keys — anchored templates; an unrecognised info row keeps its grey note), a monitor notice, `call_question`, `call_answer` and a member's failed / cancelled / skipped `status`. A question's answer row is drawn on its card (`pairCallAnswers`, `CallAnswerPairsContext`, provided by `Chats` over `transcriptRows`) and not again on its own; so is the `system` row saying no turn was left to answer it, whose went-on / stopped words replace the answer row's (one card per unanswered question). Either row draws its own card only while its question is not loaded. A question its caller passed on to the user as its own question card while it was open (`passedOn`) draws no text or options, only who asked and that it was passed on. That holds for the told or woken 'asked' event in the caller's own flow too (keyed by `askedEventKey`): it is closed as answered by the caller's answer_agent call as well as by its answer row, and it reads as a question card does once it is answered or left without an answer. The user's bubbles and the run-level turn footer stay as they are. `thread-question-card.tsx` opens with the same `EventLine`.
- The New thread card (`thread-start-card.tsx`) holds a cardless start's brief to three lines with `ClampedText`, its toggle drawn like every transcript Show more (`ShowMoreLabel`, `SHOW_MORE_TOGGLE_CLASS` from `clamped-markdown.tsx`) and remembered per thread (`thread-start-brief:<call row id>`); no toggle when the brief fits. Its ways into the thread (`ThreadCardActions`, below) stand at the end of the wrapping labels row (`ml-auto`, so they wrap to their own line, right-aligned, when the row is full), and a state's note sits above the labels in the state chip's tone.
- A card's ways into its thread are one component, `components/thread-card-actions.tsx` (`ThreadCardActions`), fed by `useThreadCardOpeners` (`chats/thread-title.tsx`) on every card that names a thread — a relayed question, a gallery question, a Done or failed card, a New thread card: **Open chat** (`ThreadDestinationsContext.openChat`: the command center's one shared thread window, `useThreadWindows().reuse`; on a phone, where there are no thread windows, `ThreadOpenContext`'s open), **New popup** (`ThreadDestinationsContext.popOut`: the thread's own window on the same stack, `useThreadWindows().open`, null on a phone) and **Go to thread** (`ThreadDestinationsContext.goToPage`: its page in Chats, App's `onOpenThread`). A view that provides no destinations (the Chats page) offers Go to thread alone, through its `ThreadOpenContext`, which already opens the page there. Never a per-card Open chat or Go to thread button of its own. In the Inbox thread card the buttons take `ThreadActionButton`'s `form` (`block`, the full-width primary; `stacked`, a labelled button of the row, its word always shown; `apart`, the quiet one set apart), which `ThreadCardActions`, `ArchiveThreadButton`, `UnarchiveThreadButton` and `useThreadReplyParts` pass through; in another Needs you gallery footer on a phone, every `ThreadActionButton` but the primary draws its icon alone in a 44px square, its words in its label and tooltip (`components/thread-head.tsx`); a card's `ThreadFoot` (the manager chat's Done card) does the same for its small presses once the foot is narrower than 480px (a container query on the foot).
- **Reply** (`chats/thread-reply.tsx`, `useThreadReplyParts`) stands on a Done card and on the Inbox thread card (its box above the card's action block) wherever `ThreadReplyContext` is provided (the command center: `deliverToThread` through the thread's own route, then a board reload): a `MessageComposer` under the card's content with its own text store, paperclip (`useAttachments`, `useFileAttach`) and send key (`isComposerSendKey`); its text is kept per thread on this device (`geniro.threadReplyDrafts`) until sent, and a card with a draft opens with its box open. It is a card's message box, never a second chat: it shows no transcript.
- A manager chat's host row whose whole sentence a loaded card already says is not drawn (`rowsShownOnCards`, user decision): an older chat's `Started "<title>"` under its `start_thread` card, a failed start's wake under the card of a thread filed with no board card (a board card's card reads Not started, so that line stays), and a watched finish's `<handle> is done` wake under its Done card. Matched on the exact sentence and row shape; a row with any other key, a joined wake, or one whose card is not loaded stays.
- The plan and team cards share their note field and its send rule (`chats/verdict-note.tsx`); the hazard gate is `chats/text-hazard-gate.tsx`, shared with the permission card.
- A question card is drawn from the row's `questions`, never from a CLI's tool name. `secret` masks the field.
- `useOneShotVerdict` is the one verdict-timing contract.
- Only the latest task-list card shows its rows. Fold state derived from data takes a press override (`useThreadOverride`). Never seed derived open state into `useState`.
- A settled question card starts folded to its header, its first question and the answer, whatever the reader pressed while it waited (user decision): its fold press is kept apart once answered (`settledFoldKey` in `chats/settled-fold.tsx`), so only a press after the answer opens it. A relayed request folds with its `ThreadQuestionCard` as one card (`CardFold`, owned by `RelayedRequestCard` under the inner card's own key): folded, only the inner card shows, its header naming the thread; one closed with no answer starts open, as an expired question card does.
- Approval cards scan for text hazards (`chats/text-hazards.ts`):
- Bidi or invisible characters gate Approve until acknowledged.
- The tick resets when the content changes. Deny is never gated.
- The banner names codepoints and never prints the character.
- Join scanned parts with spaces, never newlines. Ordinary emoji are exempt.
A `save_plugin` card (kind `plugin`, `SAVE_PLUGIN` in `geniro-tool.ts`) draws `PluginProposalCard` (`chats/plugin-proposal-card.tsx`): what it runs, where it shows, each button's asks-first, a preview from the sample, the change for an update. `pluginCardOf` is the twin of the daemon's `pluginCardInput`.
`VerdictFooter` (`chats/verdict-footer.tsx`) is the one Approve/Deny footer of the approval card and the plugin card: the hazard gate lives there.
An answered card folds to one row (user decision 2026-12-03, reversing "stays drawn whole" of 2026-12-02): every approval card — a resource card, a proposed change, `propose_team`, `run_team`, a plan, a plugin, a message to a thread, a browser host — starts folded once answered to its own header (`SettledCardHeader` over `useSettledFold`, `chats/settled-fold.tsx`), whose line says the verb, what came of it and then what the card was about, so the result is never the part cut off (`settledSummary`) in the outcome's colour; a press on the header opens the whole card, which ends in `CardVerdict` (`chats/verdict-footer.tsx`), the one verdict section: the outcome glyph, who did what (`You approved` / `declined` / `denied` / `kept` / `answered`), what came of it (saved, not saved and why, the option picked), the verdict row's time, the note the user typed, and the card's own follow-ups under it (Open team, Applied by this window). The fold press is kept per thread under `card:<request id>` after the answer, a card in the gallery or docked above the composer never folds, and a pending card is unchanged. Only a plain permission for a non-geniro tool, answered in its own thread, keeps `AnsweredReceipt`, a one-line receipt closed until pressed, because the tool row under it shows the same call; relayed, it folds like the rest. A pressed one-shot agent button stays whole with its status line. A settled question card folds the same way (header, first question, answer), never into a receipt.
**Artifacts** (`published-artifact.ts`, `artifact-frame.tsx`):
- The frame's sandbox is the one `.claude/rules/network-constraints.md` gives the artifact page's outbound call (item 3). The page is served by the daemon, never put in `srcdoc`, and loaded with `referrerPolicy="no-referrer"`.
- Into the frame go theme tokens and, once the page announces itself, the answers kept for it (`ArtifactAnswersContext`, provided by `Chats` with `ArtifactUrlContext`); out of it come its height, a link, a click on one of its own `data:` pictures — the picture or a link to it (shown in `ImageViewer`), an Escape the page did not act on (`closeTopEscapeLayer`, since a key pressed in the frame never reaches the renderer's document), a folder button's path (`window.geniro.showInFinder` through `useShowInFinder`, desktop only, only on a fresh click — `navigator.userActivation` — one per `OPEN_PATH_GAP_MS`, its failure shown under the frame in the frame's own words) and each answer the page changes (`answer`, with the page's save count, sent as a batch of changes after `ANSWERS_SAVE_DELAY_MS` and on unmount, sent again after `ANSWERS_RETRY_MS` when refused; the merged set comes back to the saving frame with the counts it confirmed, and `ArtifactAnswersStore` hands it to every other frame of the page). All by `postMessage`, filtered on `event.source`; the picture, the Escape, the folder and the answers only while the frame holds focus (`document.activeElement`), so a page cannot act on the app unprompted. Also out of it, focused or not: the reader's scroll gestures (`gesture`: a touch starting and ending, a wheel turned up), which never reach the renderer's document from inside the frame; the frame re-announces each as `FRAME_GESTURE_EVENT` bubbling from its `<iframe>`, and the transcript feeds it to its touch guard and upward intent (`scroll-follow.ts`), or a swipe over the page while the chat follows its tail reads as the layout moving it and is snapped back.
- Key the frame by `${artifactId}:${version}`.
- A `show_artifact` row is never claimed into a call card (`UNCLAIMABLE_KINDS`): a callee's page is drawn in the main flow, and the newest-card sweep spans the whole run.
- The panel list comes from `GET /v1/chats/:runId/artifacts` and answers empty on a run mismatch.
- A saved file bakes in the theme and restates the CSP as `ARTIFACT_FILE_CSP`, a twin of the daemon's `artifact-page.ts`. Insert them into a parsed `<head>` (`DOMParser`), never by text splice.
- A saved file must look like the framed page. The daemon's raw reading (`renderArtifactDocument`) carries the frame's base style (font, padding, box-sizing, centring) but not its transparent ground, and the export supplies the ground.
- Links are opened by the host, only for `http:`, `https:` and `mailto:` (`shared/link-schemes.ts`); an inline page's go to the chat browser by the chat-link rule, the full-screen dialog's always to the system browser (its page hides the pane). Main's `guardArtifactFrameNavigations` cancels any frame navigation away from the artifact route.
- Share (`artifact-share.tsx` over `use-artifact-sharing.ts`, provided as `ArtifactShareContext` by `Chats`): beside Save on the card and in the dialog header; null on a paired phone, which draws nothing. A press sends the current `themeVars()`. The link (key in its `#fragment`) is read from the daemon when the panel opens, never kept in the list — and only for a share that was uploaded (`sharedVersion > 0`). A share waiting on sign-in (`awaiting-sign-in`) tints the icon `text-warning` and shows "Sign-in required (<cli>)" with `SignInAction` (`components/sign-in-action.tsx` over `use-share-sign-in.ts`, polling like `use-cli-login.ts` but never sharing its wire) in the panel and as a strip under the card; the daemon retries after the sign-in and announces `shares_changed`, which re-reads the list (`daemon-client.ts` `onSharesChanged`). Settings → Sharing checks a place only on Check, never on open. Settings → Sharing (`settings/sharing.tsx`) edits the places, the agents switch and the auto-revoke window, and lists every shared page with the moment it was first shared, Copy link, Revoke and Revoke all.
**Shells** (`chats/shell-activity.ts`):
- Detached state comes from the daemon's `shell_open`/`shell_info` rows, never from a text match. `readLaunchHandle` stays strict and anchored at the start of the reply.
- A failed kill is not a kill.
- Foreground commands are gated on `isSettledRunStatus`. Detached commands are not.
- The whole gate lives in `Chats.tsx`'s `shellsByAgent`, and every count flattens that map.
- `shell_info` and `workflow_info` rows are skipped outright in `groupTranscript`.