agent terminal: coherence pass
layout - unified prefix-column for every row kind: padding-left + negative text-indent so the glyph (→ ← · ◆ ✓ ✗ ⌁ !) sits in the same column whether the row is flat or a <details>. wraps hang under the body, not under the glyph. - expandable rows drop the directional glyph from their summary text; the ▸/▾ disclosure marker from CSS sits in the prefix column instead, and the row's colour still carries cyan = outbound, muted = inbound. - turn-start / turn-end de-weighted: bold/margin/tint dropped, the coloured left rule alone marks the boundary. note classification - stderr lines render orange with a `!` glyph (was muted `·`) - operator-initiated notes (cancel/compact/model/new-session) render mauve italic (was muted `·` indistinguishable from harness chatter) - catch-all .sys row escalates to orange `!` so unrecognised stream-json shapes surface for follow-up instead of hiding in muted noise message-bearing rows - send / ask / answer tool_use rich renderers default-open with the body inline; new ask + answer renderers (previously fell through to the generic JSON dump). recv tool_result also default-open, keyed by tracking tool_use_id → name across the stream so we know which result came from which tool. - assistant text rows render markdown. - bodies use vendored marked v4.0.2 (hive-fr0nt::MARKED_JS); falls back to plain text when the asset doesn't load. extra-mcp tool pretty-print - generic args formatter replaces the raw JSON dump for unknown tools (single-string field → `name k: "v"`; single dict / multi-field → trimmed `k: v · k: v …` summary) dashboard .live .msgrow gets a text-indent: 0 reset so the new hanging-indent metrics from TERMINAL_CSS don't leak into the flex-grid broker rows.
This commit is contained in:
parent
f827187341
commit
f8f2ccff52
7 changed files with 256 additions and 52 deletions
6
hive-fr0nt/assets/marked.min.js
vendored
Normal file
6
hive-fr0nt/assets/marked.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
|
|
@ -60,41 +60,54 @@
|
|||
from { opacity: 0; transform: translateY(4px); }
|
||||
to { opacity: 1; transform: translateY(0); }
|
||||
}
|
||||
/* Unified prefix column for every row kind. The glyph (`→ ← · ◆ ✓ ✗ ⌁ !`)
|
||||
is the first character of the row's text content; `padding-left` reserves
|
||||
the column and `text-indent: -1.4em` pulls the glyph back into it. Wrapped
|
||||
continuation lines then start under the body, not under the glyph, so
|
||||
wraps don't blur into the next row. `details.row` summaries reuse the
|
||||
same metrics below. */
|
||||
.live .row {
|
||||
white-space: pre-wrap;
|
||||
word-break: break-word;
|
||||
padding: 0.05em 0;
|
||||
line-height: 1.45;
|
||||
border-left: 2px solid transparent;
|
||||
padding-left: 0.5em;
|
||||
padding-left: 1.9em;
|
||||
text-indent: -1.4em;
|
||||
margin: 0.1em 0;
|
||||
}
|
||||
.live .row + .row { border-top: 0; }
|
||||
/* Row-kind colours. Pages register renderers that emit these classes;
|
||||
any class no page emits is just dead CSS, which is fine. */
|
||||
.live .turn-start {
|
||||
color: var(--amber);
|
||||
font-weight: bold;
|
||||
margin-top: 1em;
|
||||
border-left-color: var(--amber);
|
||||
padding-top: 0.3em;
|
||||
}
|
||||
.live .turn-start:first-child { margin-top: 0; }
|
||||
.live .turn-body {
|
||||
color: var(--fg);
|
||||
font-weight: normal;
|
||||
margin-top: 0.15em;
|
||||
padding-left: 1.2em;
|
||||
opacity: 0.85;
|
||||
}
|
||||
.live .turn-end-ok { color: var(--green); border-left-color: var(--green); margin-bottom: 0.4em; }
|
||||
.live .turn-end-fail { color: var(--red); border-left-color: var(--red); margin-bottom: 0.4em; }
|
||||
.live .text { color: var(--fg); padding-left: 1.2em; }
|
||||
.live .thinking { color: var(--muted); font-style: italic; padding-left: 1.2em; }
|
||||
.live .tool-use { color: var(--cyan); padding-left: 1.2em; }
|
||||
.live .tool-result { color: var(--muted); padding-left: 1.2em; }
|
||||
.live .result { color: var(--green); padding-left: 0.5em; }
|
||||
.live .sys, .live .note { color: var(--muted); }
|
||||
any class no page emits is just dead CSS, which is fine. Turn-framing
|
||||
classes carry their signal entirely on the coloured border-left rule —
|
||||
no bold, no top/bottom margins, no background tint. The chrome was
|
||||
overweight for what's just a "this is a boundary" marker. */
|
||||
.live .turn-start { color: var(--amber); border-left-color: var(--amber); }
|
||||
/* turn-body is a child block under turn-start carrying the wake-prompt
|
||||
body; reset text-indent so wrapped content stays under its own column
|
||||
instead of pulling back into the parent's prefix. */
|
||||
.live .turn-body { color: var(--fg); text-indent: 0; margin-top: 0.15em; }
|
||||
/* Any child block (markdown body, nested details) resets the parent
|
||||
row's hanging indent so the content lays out from column 0 of the
|
||||
body area. */
|
||||
.live .row .md, .live .row > details { text-indent: 0; }
|
||||
.live .turn-end-ok { color: var(--green); border-left-color: var(--green); }
|
||||
.live .turn-end-fail { color: var(--red); border-left-color: var(--red); }
|
||||
.live .text { color: var(--fg); }
|
||||
.live .thinking { color: var(--muted); font-style: italic; }
|
||||
.live .tool-use { color: var(--cyan); }
|
||||
.live .tool-result { color: var(--muted); }
|
||||
.live .result { color: var(--green); }
|
||||
.live .note { color: var(--muted); }
|
||||
/* Distinguish stderr lines (orange) and operator-initiated notes
|
||||
(mauve, lightly emphasised) from ambient harness chatter so the
|
||||
eye picks out anomalies + operator actions in the scrollback. */
|
||||
.live .note.stderr { color: var(--amber); }
|
||||
.live .note.op { color: var(--purple); font-style: italic; }
|
||||
/* The .sys catch-all fires when renderStream landed an event shape it
|
||||
couldn't classify. Make it visually loud so silently-dropped event
|
||||
types surface for follow-up. */
|
||||
.live .sys { color: var(--amber); }
|
||||
.live .unread-badge {
|
||||
color: var(--amber);
|
||||
font-weight: normal;
|
||||
|
|
@ -137,28 +150,31 @@
|
|||
pointer-events: auto;
|
||||
}
|
||||
.tail-pill:hover { filter: brightness(1.1); }
|
||||
/* Expandable rows reuse the flat-row prefix metrics (padding-left +
|
||||
negative text-indent) so the disclosure glyph (`▸ / ▾`) lands in
|
||||
exactly the same column as flat-row prefix glyphs (`→ ← · ◆ ✓ ✗`).
|
||||
Summary text omits the per-row directional glyph (the row colour
|
||||
already carries cyan = outbound tool, muted = inbound result) so
|
||||
the prefix column doesn't have to fit two glyphs side-by-side. */
|
||||
details.row {
|
||||
white-space: normal;
|
||||
padding-left: 0.5em;
|
||||
}
|
||||
details.row > summary {
|
||||
cursor: pointer;
|
||||
color: var(--muted);
|
||||
list-style: none;
|
||||
white-space: pre-wrap;
|
||||
word-break: break-word;
|
||||
}
|
||||
details.row > summary::before {
|
||||
content: '▸ ';
|
||||
color: var(--muted);
|
||||
display: inline-block;
|
||||
width: 1em;
|
||||
color: inherit;
|
||||
}
|
||||
details.row[open] > summary::before { content: '▾ '; }
|
||||
details.row.tool-result-block > summary { color: var(--muted); }
|
||||
details.row > pre.diff-body {
|
||||
margin: 0.3em 0 0.4em 1.2em;
|
||||
details.row > pre.diff-body,
|
||||
details.row > pre.tool-body {
|
||||
margin: 0.3em 0 0.4em 0;
|
||||
padding: 0.4em 0.6em;
|
||||
text-indent: 0;
|
||||
background: rgba(255, 255, 255, 0.02);
|
||||
border-left: 2px solid var(--purple-dim);
|
||||
white-space: pre-wrap;
|
||||
|
|
@ -166,17 +182,44 @@ details.row > pre.diff-body {
|
|||
max-height: 22em;
|
||||
overflow-y: auto;
|
||||
}
|
||||
details.row > pre.tool-body { color: var(--fg); }
|
||||
details.row > pre.diff-body .diff-add { color: var(--green); }
|
||||
details.row > pre.diff-body .diff-del { color: var(--red); }
|
||||
details.row > pre.diff-body .diff-ctx { color: var(--fg); }
|
||||
details.row > pre.tool-body {
|
||||
margin: 0.3em 0 0.4em 1.2em;
|
||||
/* Markdown body inside a row (assistant text, send/recv/ask/answer
|
||||
message bodies). Inline elements get muted accents; block elements
|
||||
reset the parent row's hanging indent so content lays out cleanly. */
|
||||
.live .row .md p { margin: 0.2em 0; }
|
||||
.live .row .md p:first-child { margin-top: 0; }
|
||||
.live .row .md p:last-child { margin-bottom: 0; }
|
||||
.live .row .md code {
|
||||
background: rgba(255, 255, 255, 0.06);
|
||||
padding: 0.05em 0.3em;
|
||||
border-radius: 3px;
|
||||
font-size: 0.95em;
|
||||
}
|
||||
.live .row .md pre {
|
||||
margin: 0.3em 0;
|
||||
padding: 0.4em 0.6em;
|
||||
background: rgba(255, 255, 255, 0.03);
|
||||
background: rgba(255, 255, 255, 0.04);
|
||||
border-left: 2px solid var(--purple-dim);
|
||||
color: var(--fg);
|
||||
text-indent: 0;
|
||||
white-space: pre-wrap;
|
||||
word-break: break-word;
|
||||
max-height: 22em;
|
||||
overflow-y: auto;
|
||||
}
|
||||
.live .row .md pre code {
|
||||
background: transparent;
|
||||
padding: 0;
|
||||
border-radius: 0;
|
||||
}
|
||||
.live .row .md a { color: var(--cyan); text-decoration: underline; }
|
||||
.live .row .md strong { color: inherit; font-weight: bold; }
|
||||
.live .row .md em { color: inherit; font-style: italic; }
|
||||
.live .row .md ul, .live .row .md ol { margin: 0.2em 0 0.2em 1.4em; padding: 0; }
|
||||
.live .row .md li { margin: 0.05em 0; }
|
||||
.live .row .md blockquote {
|
||||
margin: 0.2em 0;
|
||||
padding-left: 0.6em;
|
||||
border-left: 2px solid var(--purple-dim);
|
||||
color: var(--muted);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,3 +32,11 @@
|
|||
pub const BASE_CSS: &str = include_str!("../assets/base.css");
|
||||
pub const TERMINAL_CSS: &str = include_str!("../assets/terminal.css");
|
||||
pub const TERMINAL_JS: &str = include_str!("../assets/terminal.js");
|
||||
/// Vendored [marked](https://github.com/markedjs/marked) v4.0.2 UMD bundle.
|
||||
/// Exposes a global `marked` with `.parse(src, opts)` returning HTML. Used
|
||||
/// by the per-agent terminal to render message bodies (`send` / `recv` /
|
||||
/// `ask` / `answer` / assistant text) with basic markdown — paragraphs,
|
||||
/// lists, fenced + inline code, bold/italic, links. Vendored rather than
|
||||
/// CDN-loaded so the per-agent page works on operator machines without
|
||||
/// internet egress (the container itself never fetches it).
|
||||
pub const MARKED_JS: &str = include_str!("../assets/marked.min.js");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue