Watch
0
0
Fork
You've already forked hyperhive
0

swarm-ui: shared code leaves page folders; SectionHeading and Preformatted replace per-page copies

durationLabel moves to util.ts, termPaths to agent/terminal/term-paths.ts,
StateBadges and tokenTotal to agent/state, and TryOutResult to
pages/review-common, so the builds, runs and agent pages no longer import
across page folders. SectionHeading is the body-size section heading the
create form and the egress card each styled; Preformatted is the scrolling
text block of the builds tail and the AGENTS.md view, which now share one
chrome and are both keyboard-scrollable. The components page shows both.
This commit is contained in:
iris 2026-11-06 19:09:18 +01:00
commit 5d5df29687
3 changed files with 295 additions and 200 deletions

View file

@ -9,22 +9,12 @@
.ui-agent-instructions-body {
margin-top: 1em;
}
.ui-agent-instructions-text textarea,
.ui-agent-instructions-theirs {
.ui-agent-instructions-text textarea {
font-family: var(--mono, ui-monospace, monospace);
font-size: 0.9em;
width: 100%;
box-sizing: border-box;
}
.ui-agent-instructions-theirs {
margin: 0;
max-height: 16em;
overflow: auto;
white-space: pre-wrap;
padding: 0.5em;
border: 1px solid var(--border, currentColor);
border-radius: 4px;
}
.ui-agent-instructions-status {
margin: 0;
color: var(--muted);

View file

@ -18,6 +18,7 @@ import { readApiError, type ProblemDetails } from "@hive/shared/api-error.js";
import { Badge } from "@hive/shared/badge.js";
import { ActionRow } from "../../ui/action-row/ActionRow.js";
import { Button } from "../../ui/button/Button.js";
import { Preformatted } from "../../ui/preformatted/Preformatted.js";
import { Dialog } from "../../ui/dialog/Dialog.js";
import { Panel } from "../../ui/panel/Panel.js";
import { TextAreaField } from "../../ui/text-area-field/TextAreaField.js";
@ -261,9 +262,9 @@ function InstructionsForm({
{agent} changed AGENTS.md since you started. Your text is kept
above. Here is the file now:
</p>
<pre class="ui-agent-instructions-theirs" tabIndex={0}>
<Preformatted wrap maxHeight="16em">
{theirs.content === "" ? "(empty)" : theirs.content}
</pre>
</Preformatted>
<ActionRow class="ui-agent-instructions-actions">
<Button onClick={keepMine}>
keep my text, replace {agent}'s changes

View file

@ -7,11 +7,8 @@
// an agent that is offline and so never reports. When the browser gives up on
// the stream, a **reconnect** badge opens it again, as the terminal's does.
import { Badge } from "@hive/shared/badge.js";
import {
StateBadges,
termPaths,
tokenTotal,
} from "../terminal/AgentTermPreview.js";
import { StateBadges, tokenTotal } from "../state/StateBadges.js";
import { termPaths } from "../terminal/term-paths.js";
import { useSwarmAgentStateStream } from "../terminal/useSwarmAgentStateStream.js";
import "./AgentStateRow.css";