Watch
0
0
Fork
You've already forked hyperhive
0

swarm-ui: shared Hint, ActionRow, Toolbar, EmptyState, ExternalLink and ExpandableCard replace per-page copies

Hint, ActionRow, Toolbar, EmptyState and ExternalLink replace the muted
text, button row, refresh bar, empty line and _blank anchor that each page
restyled under its own class. ExpandableCard (with a loading twin) holds the
builds and recent-runs cards, which had identical head and body CSS. The
create form's raw checkbox becomes CheckboxField. The components page shows
each new piece.
This commit is contained in:
iris 2026-11-06 17:54:24 +01:00 • committed by mara
commit 8a2e5203ad

View file

@ -16,6 +16,7 @@
import { useState } from "preact/hooks";
import { ApiErrorPanel } from "@hive/shared/api-error-panel.js";
import { Badge, type BadgeTone } from "@hive/shared/badge.js";
import { ExternalLink } from "../../ui/external-link/ExternalLink.js";
import { LazyDisclosure } from "../../ui/disclosure/LazyDisclosure.js";
import { RelativeTime } from "../../ui/relative-time/RelativeTime.js";
import {
@ -25,6 +26,7 @@ import {
import { fetchJson, usePolled } from "../../ui/polled/usePolled.js";
import { Table, type TableColumn } from "../../ui/table/Table.js";
import { TableSkeleton } from "../../ui/table/TableSkeleton.js";
import { Toolbar } from "../../ui/toolbar/Toolbar.js";
import { domainCell } from "../hive-domain.js";
type Freshness = "fresh" | "stale" | "never_reported" | "unknown";
@ -65,13 +67,7 @@ const COLUMNS: TableColumn<HiveStatus>[] = [
render: (h) => {
const { text, href } = domainCell(h);
if (!text) return "—";
return href ? (
<a href={href} target="_blank" rel="noreferrer">
{text}
</a>
) : (
text
);
return href ? <ExternalLink href={href}>{text}</ExternalLink> : text;
},
sortBy: (h) => domainCell(h).text,
filterValue: (h) => domainCell(h).text,
@ -129,14 +125,14 @@ function HiveRoster() {
return (
<>
<div class="ui-hives-refresh">
<Toolbar>
<RefreshIntervalPicker
id="hives-refresh"
value={intervalMs}
onChange={setIntervalMs}
refreshing={refreshing}
/>
</div>
</Toolbar>
{error ? (
<ApiErrorPanel
context="failed to load the hive roster"