Pure `nix fmt` output from the commit before this one — no hand edits. 203 files: 52 md, 42 tsx, 32 js, 32 css, 21 ts, 13 html, 8 json, 3 mjs. Reproduce with `nix develop -c nix fmt` on the parent commit; the result should be byte-identical to this tree. None of the 13 `.prettierignore` entries appears here — verified by intersecting the changed-file list against the ignore file, with a control proving the intersection finds a match when one exists.
368 lines
11 KiB
CSS
368 lines
11 KiB
CSS
/* Shared terminal pane: a scroll-sticky log of rows + a "↓ N new" pill.
|
|
Pages wrap their stream container in `.terminal-wrap` and give the log
|
|
itself the `.live` class; renderer JS appends `.row` (flat line) or
|
|
`details.row` (collapsible body) elements. Row-kind classes
|
|
(`.turn-start`, `.tool-use`, `.thinking`, etc.) carry the per-event
|
|
colour; pages that don't emit a given kind simply never produce that
|
|
class — the unused rule sits in the bundle harmlessly.
|
|
|
|
`.terminal-wrap` provides the crust-on-black phosphor chrome that
|
|
makes the agent page feel like a terminal. Pages can opt in by
|
|
wrapping a block in this class; or skip it and the rows still render
|
|
with their class colours, just without the frame.
|
|
|
|
No `.term-input` here — composers are a separate concern, owned by
|
|
each page's own CSS. Row taxonomy + layout contract documented in
|
|
`docs/web-ui/shape.md::Shared terminal pane` and
|
|
`docs/web-ui/terminal-rendering.md`. */
|
|
|
|
.terminal-wrap {
|
|
position: relative;
|
|
background: color-mix(in srgb, var(--crust) 78%, transparent);
|
|
-webkit-backdrop-filter: blur(8px) saturate(120%);
|
|
backdrop-filter: blur(8px) saturate(120%);
|
|
border: 1px solid var(--purple-dim);
|
|
box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.7);
|
|
border-radius: 4px;
|
|
font-family:
|
|
"JetBrains Mono", "Fira Code", "Cascadia Code", "Source Code Pro", monospace;
|
|
font-size: 0.92em;
|
|
color: var(--fg);
|
|
margin-top: 0.6em;
|
|
}
|
|
.live {
|
|
background: rgba(255, 255, 255, 0.02);
|
|
border: 1px solid var(--purple-dim);
|
|
padding: 0.4em 0.6em;
|
|
overflow-y: auto;
|
|
max-height: 32em;
|
|
font-family: inherit;
|
|
/* Disable browser scroll anchoring — the terminal manages scroll
|
|
position manually (snapToBottom + loadMore compensation). Scroll
|
|
anchoring would double-compensate scrollTop during loadMore()
|
|
prepends, causing an erratic jump. */
|
|
overflow-anchor: none;
|
|
}
|
|
.live.terminal {
|
|
background: transparent;
|
|
border: 0;
|
|
box-shadow: none;
|
|
border-radius: 0;
|
|
padding: 0.8em 1em 0.4em;
|
|
overflow-y: auto;
|
|
height: min(72vh, 60em);
|
|
max-height: none;
|
|
font-family: inherit;
|
|
font-size: inherit;
|
|
color: inherit;
|
|
}
|
|
.live .row,
|
|
.live details.row {
|
|
animation: row-fade-in 220ms ease-out both;
|
|
}
|
|
.live .row.no-anim,
|
|
.live details.row.no-anim {
|
|
animation: none;
|
|
}
|
|
@keyframes row-fade-in {
|
|
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: 1.9em;
|
|
text-indent: -1.4em;
|
|
margin: 0.1em 0;
|
|
}
|
|
.live .row + .row {
|
|
border-top: 0;
|
|
}
|
|
/* Fixed-width icon column. Rows built with an `icon` (see terminal.js
|
|
`row()` / `details()`) put it in a `.row-glyph` element instead of as a
|
|
bare first character. `inline-block` with a fixed `width` means the icon
|
|
occupies one constant-width cell regardless of the glyph's rendered width
|
|
(emoji differ; some carry a variation selector), so every icon's left edge
|
|
lines up — a flat-row `🧠` and a `details` summary's `🖥️` share the column.
|
|
It's the first inline box, so the row's `text-indent: -1.4em` pulls it into
|
|
the reserved prefix slot exactly like a bare glyph; the following text then
|
|
starts at the `padding-left` (1.9em) where wrapped lines also hang. */
|
|
.live .row-glyph {
|
|
display: inline-block;
|
|
width: 1.4em;
|
|
}
|
|
/* Row colours, keyed by severity `level` (hive-agent's `term_msg.rs`),
|
|
not by row kind any more — mara's terminal-message redesign dropped
|
|
the server-side `kind` tag (turn-start/tool-use/tool-result/etc) in
|
|
favour of one uniform shape, `{icon, level, summary, body,
|
|
body_format, coalesce_key}`. What used to be a dozen-odd per-kind
|
|
classes (`.turn-start`, `.tool-use`, `.tool-result.error`, `.sys`, …)
|
|
is now four: the four severities every row already carries. Structural
|
|
identity (this is a turn boundary, this is a tool call) is carried by
|
|
the row's icon (`◆`, `🔧`, `✅`, …) and summary text instead of colour —
|
|
see docs/web-ui/terminal-rendering.md. */
|
|
.live .level-debug {
|
|
color: var(--muted);
|
|
}
|
|
.live .level-info {
|
|
color: var(--fg);
|
|
}
|
|
.live .level-warn {
|
|
color: var(--amber);
|
|
border-left-color: var(--amber);
|
|
}
|
|
.live .level-error {
|
|
color: var(--red);
|
|
border-left-color: var(--red);
|
|
}
|
|
/* `badge-pulse` itself is no longer used by any terminal row (the
|
|
turn-start `unread` count it animated is gone — see term_msg.rs's
|
|
module doc), but agent.css's `.state-badge.state-thinking`/
|
|
`.state-compacting` badges still reuse this keyframe via
|
|
`@import "@hive/shared/terminal.css"` — keep the definition here, drop
|
|
only the terminal-specific `.unread-badge` selector that used it. */
|
|
@keyframes badge-pulse {
|
|
0%,
|
|
100% {
|
|
opacity: 1;
|
|
text-shadow: 0 0 6px color-mix(in srgb, var(--amber) 55%, transparent);
|
|
}
|
|
50% {
|
|
opacity: 0.7;
|
|
text-shadow: 0 0 14px color-mix(in srgb, var(--amber) 95%, transparent);
|
|
}
|
|
}
|
|
/* 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;
|
|
}
|
|
/* "↓ N new" pill: shown when new rows arrive while the operator is
|
|
scrolled up; click to jump to bottom. Positioned by the wrapper's
|
|
`position: relative` (terminal-wrap supplies it; pages that skip the
|
|
wrapper must add their own positioned ancestor). */
|
|
.tail-pill {
|
|
position: absolute;
|
|
right: 1em;
|
|
bottom: 4.2em;
|
|
background: var(--amber);
|
|
color: var(--crust);
|
|
font-family: inherit;
|
|
font-size: 0.8em;
|
|
font-weight: bold;
|
|
letter-spacing: 0.08em;
|
|
border: 0;
|
|
border-radius: 999px;
|
|
padding: 0.35em 0.9em;
|
|
cursor: pointer;
|
|
box-shadow: 0 0 14px -2px color-mix(in srgb, var(--amber) 85%, transparent);
|
|
opacity: 0;
|
|
transform: translateY(6px);
|
|
pointer-events: none;
|
|
transition:
|
|
opacity 160ms ease,
|
|
transform 160ms ease;
|
|
}
|
|
.tail-pill.visible {
|
|
opacity: 1;
|
|
transform: translateY(0);
|
|
pointer-events: auto;
|
|
}
|
|
.tail-pill:hover {
|
|
filter: brightness(1.1);
|
|
}
|
|
/* "↑ load older" pill: sits inline at the top of the log (not
|
|
absolutely positioned) so it scrolls with the content. Appears
|
|
when `has_more` is true after initial history load. */
|
|
.load-more-pill {
|
|
display: block;
|
|
width: 100%;
|
|
background: transparent;
|
|
color: var(--muted);
|
|
font-family: inherit;
|
|
font-size: 0.8em;
|
|
font-weight: bold;
|
|
letter-spacing: 0.08em;
|
|
border: 0;
|
|
border-bottom: 1px dashed var(--purple-dim);
|
|
padding: 0.4em 1em;
|
|
cursor: pointer;
|
|
text-align: left;
|
|
transition:
|
|
color 120ms ease,
|
|
background 120ms ease;
|
|
}
|
|
.load-more-pill:hover:not(:disabled) {
|
|
color: var(--fg);
|
|
background: var(--border);
|
|
}
|
|
.load-more-pill:disabled {
|
|
cursor: default;
|
|
opacity: 0.6;
|
|
}
|
|
/* Expandable rows reuse the flat-row prefix metrics (padding-left +
|
|
negative text-indent). The summary's icon (when present) sits in the
|
|
shared `.row-glyph` column — same cell as a flat row's icon — so a
|
|
`details` summary's `🖥️` lines up under a flat row's `🧠`. The
|
|
disclosure caret (`▸ / ▾`) leads the `.summary-text` (not the icon) via
|
|
`::before`, so it sits where the summary text starts rather than shoving
|
|
the icon out of the prefix column. Icon-less summaries have no `.row-glyph`,
|
|
so the caret falls back into the prefix column like the old directional
|
|
glyph. The summary text carries no `→ / ←`; the row colour (cyan =
|
|
outbound tool, muted = inbound result) carries the direction. */
|
|
details.row {
|
|
white-space: normal;
|
|
}
|
|
/* Two-column layout for expandable summary rows.
|
|
Left col: fixed-width icon cell. Right col: disclosure chevron +
|
|
text, wrapping within itself so no continuation line bleeds under
|
|
the icon. Overrides the flat-row hanging-indent metrics (.live .row
|
|
sets padding-left: 1.9em; text-indent: -1.4em) with explicit flex
|
|
geometry. The negative margin-left on summary cancels the details
|
|
container's inherited padding-left so the icon lands at the same
|
|
horizontal position as flat-row icons. */
|
|
details.row > summary {
|
|
cursor: pointer;
|
|
list-style: none;
|
|
white-space: pre-wrap;
|
|
word-break: break-word;
|
|
display: flex;
|
|
align-items: baseline;
|
|
margin-left: -1.9em;
|
|
padding-left: 0.5em;
|
|
text-indent: 0;
|
|
}
|
|
/* Icon column: 2em accommodates wide emoji without ink bleeding into
|
|
the chevron column. Overrides the inline-block + width: 1.4em set
|
|
on .live .row-glyph for the shared flat-row context. */
|
|
details.row > summary > .row-glyph {
|
|
flex: 0 0 2em;
|
|
width: auto;
|
|
text-align: center;
|
|
}
|
|
/* Content column: chevron (::before) + text, wraps within the cell. */
|
|
details.row > summary > .summary-text {
|
|
flex: 1;
|
|
min-width: 0;
|
|
}
|
|
/* Icon-less summaries: the CSS-generated ▸/▾ acts as the hanging
|
|
marker. Hanging indent keeps wrapped lines under the text body,
|
|
not under the chevron. Mirrors the flat-row text-indent metric. */
|
|
details.row > summary > .summary-text:only-child {
|
|
padding-left: 1.4em;
|
|
text-indent: -1.4em;
|
|
}
|
|
details.row > summary > .summary-text::before {
|
|
content: "▸ ";
|
|
color: inherit;
|
|
}
|
|
details.row[open] > summary > .summary-text::before {
|
|
content: "▾ ";
|
|
}
|
|
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;
|
|
word-break: break-word;
|
|
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);
|
|
}
|
|
/* Markdown body inside a row (assistant text, send/recv 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.04);
|
|
border-left: 2px solid var(--purple-dim);
|
|
text-indent: 0;
|
|
white-space: pre-wrap;
|
|
word-break: break-word;
|
|
}
|
|
.live .row .md pre code {
|
|
background: transparent;
|
|
padding: 0;
|
|
border-radius: 0;
|
|
}
|
|
.live .row .md a {
|
|
color: var(--cyan);
|
|
text-decoration: underline;
|
|
}
|
|
/* Auto-linkified bare URLs in plain rows + tool-body blocks. */
|
|
.live .row a {
|
|
color: var(--cyan);
|
|
text-decoration: underline;
|
|
}
|
|
.live .row a:hover {
|
|
color: var(--fg);
|
|
}
|
|
.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);
|
|
}
|