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
2 changed files with 295 additions and 200 deletions

View file

@ -10,12 +10,3 @@
overflow-wrap: anywhere;
}
/* What nix printed: kept as printed, scrolls sideways rather than wrapping. */
.ui-builds-tail {
margin: 0;
padding: 0.6em 0.75em;
max-height: 24em;
overflow: auto;
border-radius: 0.4em;
background: color-mix(in srgb, var(--crust) 60%, transparent);
font-size: 0.85em;
}

View file

@ -15,6 +15,7 @@ import {
ExpandableCardListSkeleton,
} from "../../ui/expandable-card/ExpandableCard.js";
import { Hint } from "../../ui/hint/Hint.js";
import { Preformatted } from "../../ui/preformatted/Preformatted.js";
import { Toolbar } from "../../ui/toolbar/Toolbar.js";
import { LazyDisclosure } from "../../ui/disclosure/LazyDisclosure.js";
import {
@ -23,7 +24,7 @@ import {
} from "../../ui/refresh-interval/RefreshInterval.js";
import { fetchJson, usePolled } from "../../ui/polled/usePolled.js";
import { RelativeTime } from "../../ui/relative-time/RelativeTime.js";
import { durationLabel } from "../review-runs/RunsTypes.js";
import { durationLabel } from "../../util.js";
import {
OUTCOME_LABEL,
OUTCOME_TONE,
@ -80,7 +81,7 @@ function BuildCard({
<>
<Hint>{body.label}</Hint>
{body.preformatted ? (
<pre class="ui-builds-tail">{body.text}</pre>
<Preformatted>{body.text}</Preformatted>
) : (
<p class="ui-builds-text">{body.text}</p>
)}