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:
parent
b74b5e77e4
commit
8a2e5203ad
1 changed files with 689 additions and 427 deletions
|
|
@ -16,6 +16,7 @@ import { useEffect, useRef, useState } from "preact/hooks";
|
|||
import { ApiErrorPanel } from "@hive/shared/api-error-panel.js";
|
||||
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 { Dialog } from "../../ui/dialog/Dialog.js";
|
||||
import { Panel } from "../../ui/panel/Panel.js";
|
||||
|
|
@ -235,9 +236,9 @@ function InstructionsForm({
|
|||
context="loading AGENTS.md failed"
|
||||
problem={load.problem}
|
||||
/>
|
||||
<div class="ui-agent-instructions-actions">
|
||||
<ActionRow class="ui-agent-instructions-actions">
|
||||
<Button onClick={reload}>try again</Button>
|
||||
</div>
|
||||
</ActionRow>
|
||||
</>
|
||||
) : null}
|
||||
{load.status === "ready" ? (
|
||||
|
|
@ -263,18 +264,18 @@ function InstructionsForm({
|
|||
<pre class="ui-agent-instructions-theirs" tabIndex={0}>
|
||||
{theirs.content === "" ? "(empty)" : theirs.content}
|
||||
</pre>
|
||||
<div class="ui-agent-instructions-actions">
|
||||
<ActionRow class="ui-agent-instructions-actions">
|
||||
<Button onClick={keepMine}>
|
||||
keep my text, replace {agent}'s changes
|
||||
</Button>
|
||||
<Button onClick={takeTheirs}>use {agent}'s version</Button>
|
||||
</div>
|
||||
</ActionRow>
|
||||
</section>
|
||||
) : null}
|
||||
{problem ? (
|
||||
<ApiErrorPanel context="saving failed" problem={problem} />
|
||||
) : null}
|
||||
<div class="ui-agent-instructions-actions">
|
||||
<ActionRow class="ui-agent-instructions-actions">
|
||||
<Button
|
||||
variant="primary"
|
||||
type="submit"
|
||||
|
|
@ -305,7 +306,7 @@ function InstructionsForm({
|
|||
>
|
||||
reload from {agent}
|
||||
</Button>
|
||||
</div>
|
||||
</ActionRow>
|
||||
</form>
|
||||
) : null}
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in a new issue