hyperhive/docs/web-ui/terminal-rendering.md
iris e9d59f3d10 docs: fix genuine passive-voice hits in docs/web-ui (small files)
agent.md, css-vars.md, design-guide.md, shape.md, terminal-rendering.md --
26 of 40 write-good.Passive hits rewritten to name the actor (hive-agent,
browsers, the harness, the client, lifecycle::{spawn,rebuild}, CSS, the
router, ...), reusing an actor already named nearby wherever one exists.
14 left alone: established config-state conditionals ("when X is
set/enabled/given/called"), negative-capability/state-descriptor idioms
("is gone", "is hidden", "is unchanged"), one false-positive
("typed slash commands" as a compound noun, not a passive action), a
backward-looking changelog fact with no actor worth naming, and two
deliberately-parallel rhetorical contrasts (sanitized vs XSS-safe;
cache-hit vs cache-miss) left symmetric on purpose.

dashboard.md (70 more hits) is the next docs/web-ui/ batch, not part of
this one -- big enough to deserve its own PR.
2026-09-08 15:54:07 +02:00

56 lines
2.6 KiB
Markdown

# Per-agent terminal: row taxonomy (as built)
The per-agent web UI's live pane renders one row per `TermMsg`
(`hive-agent/src/term_msg.rs`): `{icon?, level: debug|info|warn|error,
summary, body?, body_format?: markdown|diff, coalesce_key?}`. Classification
(icon, summary text, whether a tool call gets an expandable body) happens
server-side, once — `term_msg.rs` + `stream_enrich.rs` — and both
`GET /api/events/history` and `GET /api/events/stream` serve it identically
as `TermEnvelope { ts, seq?, msgs: TermMsg[] }` frames
(`hive-agent/src/web_ui/stream.rs`).
The frontend renders a `TermMsg` close to as-is
(`frontend/packages/agent/src/components/Row.tsx`): `level` picks the
CSS colour (`terminal.css`'s `.live .level-*`), an empty `summary` +
markdown `body` renders as a flat row with just the body (assistant
text), and any other bodied row is an expandable `<details>`, opened by
default according to the operator's expand-tool-output preference
(`getExpandDetailsPref()`) — uniformly, no per-tool override. There's no
separate client-side row model or classification step.
## Layout
Every row shares one prefix column via `padding-left` + negative
`text-indent` on `.live .row`; an icon (when set) sits in a fixed-width
`.row-glyph` cell so icons of different rendered widths still line up.
`<details>` summaries reuse the same metrics, with the disclosure caret
leading the summary text rather than the icon.
## Levels
| Level | Colour | Roughly |
|---|---|---|
| `debug` | muted | thinking, coalesced ticks, ambient harness chatter |
| `info` | default fg | turn start/ok, assistant text, tool calls + results |
| `warn` | amber, left rule | stderr, an unrecognised event shape, API retries |
| `error` | red, left rule | turn failed, a tool result with `is_error: true` |
The settings menu's "hide debug output" toggle (`getHideDebugPref()`,
`@hive/shared/prefs.js`) skips `debug`-level rows entirely rather than
muting them further — client-side only, same live-read-no-reload shape
as the expand-tool-output preference above.
Per-tool icon + summary formatting (what a `Read`/`Edit`/`send` call's row
actually says) lives in `stream_enrich.rs`'s `fmt_tool_use()` family —
read that when you need the specifics, this doc doesn't duplicate it.
## Markdown
`frontend/packages/agent/src/lib/markdown.ts`'s `renderMarkdown()` runs
`marked.parse()` through DOMPurify into a `<div class="md">`. Applied to
any `TermMsg` with `body_format: "markdown"`.
## Dashboard side (not covered here)
The main dashboard's message-flow pane is a different shape: broker
messages render as `.msgrow` grid lines, not agent-terminal rows.