Watch
0
0
Fork
You've already forked hyperhive
0

swarm-ui: one hook for a read that runs once per set of inputs

Part of the unification order in the UI sweep issue (step d, first of three).

Twenty files hand-rolled the same effect: a cancelled flag, a fetch, the
problem body on a bad status, a catch that wraps the error. useResource does
it once on top of the poller's request discipline: it aborts the request in
flight when the inputs change or the page goes away, keeps the last good
answer under a failed read and clears the error on the next good one. The
agent details move to it (limits, linked accounts, ssh CA, permission
catalogue, allowed and denied domains). Hint drops its HintTone alias for the
shared Tone.
This commit is contained in:
iris 2026-11-25 22:48:29 +01:00
commit 7f8d6abc58

View file

@ -43,7 +43,7 @@ import {
import { ExternalLink } from "../ui/external-link/ExternalLink.js";
import { FieldGrid, FieldGridFull } from "../ui/field-grid/FieldGrid.js";
import { FormStack } from "../ui/form-stack/FormStack.js";
import { Hint, type HintTone } from "../ui/hint/Hint.js";
import { Hint } from "../ui/hint/Hint.js";
import { FormResult } from "../ui/submit/FormResult.js";
import type { SubmitState } from "../ui/submit/submit.js";
import { Preformatted } from "../ui/preformatted/Preformatted.js";
@ -55,10 +55,10 @@ import { Popover } from "../ui/popover/Popover.js";
import { Badge, type BadgeTone } from "@hive/shared/badge.js";
import { GearIcon } from "@hive/shared/icons.js";
import { Dropdown, type DropdownOption } from "@hive/shared/dropdown.js";
import { TONES } from "@hive/shared/tone.js";
import { TONES, type Tone } from "@hive/shared/tone.js";
import "./ComponentsPage.css";
const HINT_TONES: HintTone[] = [...TONES];
const HINT_TONES: Tone[] = [...TONES];
const SUBMIT_SAMPLES: [string, SubmitState][] = [
["done", { status: "done", value: undefined }],