Skip to main content

Module widgets

Module widgets 

Source
Expand description

Stateless TUI widgets.

Each widget takes explicit props; the compose function in render::mod pulls those props from State per frame. No widget holds a reference to any god-object.

The glyph vocabulary, one meaning each (no emoji, no dingbats – CI bans them; geometric shapes and box drawing are below the banned ranges):

  • > the user’s prompt
  • ● the start of a block: an assistant reply, a tool call
  • ⎿ the result or continuation under a block
  • ◦ a live child row (a running agent)
  • √ ■ □ ⊘ checklist states: done, in progress, pending, blocked
  • ◐ ◓ ◑ ◒ the spinner
  • · the only separator inside meta text

Every meta surface – footer, session header, spinner meta, agent rows, checklist meta, run summary, system notices – uses the theme’s single text_meta colour, undimmed.

Structs§

AgentPanelRow
One row of the live agent panel: a running (or backgrounded) subagent’s stable identity + activity. Built by the render layer from TurnState::ExecutingTools + live_tool_status (+ the background-agent registry); this widget only formats.
ApprovalModalWidget
ChatState
State for the chat widget
ChatWidget
Props for ChatWidget
ConversationListWidget
FilePickerWidget
ImageClickTarget
Entry in the click map: maps a content line to an image in chat history
InputState
State for the input widget
InputWidget
Props for InputWidget. The slash-command palette is rendered separately as SlashPaletteWidget in the bottom region (see render.rs); this widget just draws the bordered input box.
ModelPickerWidget
PlanConfigWidget
QuestionModalWidget
RewindPickerWidget
SlashPaletteWidget
StatusWidget
The one-line footer under the composer: the session’s mode on the left, the model and the context gauge on the right, everything in the theme’s meta colour. What it deliberately does not show: user@host (the shell prompt and the window title already do), the working directory (the session header names it once), and the version (mermaid --version, /doctor). A footer is furniture; it should carry what changes.

Enums§

GenerationStatus
Local-to-render-layer generation phase enum. The compose function converts from domain::TurnState + domain::GenPhase into one of these four states; widgets render off this local view so they don’t need to pattern-match the full domain enum.

Constants§

MODEL_PICKER_HEIGHT
Total pane height including borders and the filter line.
PLAN_CONFIG_HEIGHT
Pane height: rows + border(2) + hint line.
PLAN_CONFIG_ROWS
Row count (kept in sync with plan_config_rows and the reducer’s key handler). Rows: preset, builds, web, memory, tasks, model, reasoning, auto_approve, post_approve.
SESSION_HEADER_HEIGHT
Rows the header takes when visible.

Functions§

abbreviate_home
~ for the home directory itself, ~/rest beneath it (joined, so Windows keeps its separator), the path unchanged otherwise.
build_session_header
The two header lines, both in the meta colour, each fitted to width.
build_status_lines
Build the status-line rows: a generation/tool spinner followed by one row per queued message.
build_task_lines
Build the checklist rows for the reserved zone. collapsed is the Ctrl+T one-line form. attached means the status zone renders above, so the first row carries the ⎿ connector; detached rows sit flush-left. width is the zone’s inner width in cells.
plan_config_rows
The (label, value) pairs the picker shows, derived from the live config. Shared with the reducer tests so row indices can’t drift.
question_modal_height
Total rendered height including the border, so render::mod can size the bottom zone to fit the modal — the taller of the option list and its preview.
rendered_row_count
How many rendered rows input occupies at content_width display cells.
session_header_visible
Visible while every committed message is a system notice and no turn is running. Not messages().is_empty(): the startup web-capability notice is a system message that only appears on degraded machines, and keying on it would make the header (and the pty frames CI compares) environment- dependent. /clear brings the header back; --resume with content hides it.
spinner_glyph
The frame for a given elapsed time. A pure function of the injected clock, so --replay reproduces every frame.
tasks_height
Height the layout should reserve for the checklist zone.
tasks_visible
Whether the checklist band renders at all: there must be something to show, and a fully-green list retires once the run goes idle (finished work stays visible only while unfinished work remains). Collapsed with no status widget above (attached false) renders nothing — the state persists and the one-liner reappears when the next run starts.