Watch
0
0
Fork
You've already forked hyperhive
0

swarm-ui: drop the wanted menu's two dead options, and two stale test headers

showDestroy and portal were each passed by one caller, the old card and the old
table cell, and neither exists now. Two test headers still named the detail
panel.
This commit is contained in:
iris 2026-11-01 01:26:40 +01:00
commit 3058a5871e
3 changed files with 3 additions and 32 deletions

View file

@ -24,8 +24,6 @@ export function WantedMenu({
onSelectOffline, onSelectOffline,
onSelectPaused, onSelectPaused,
onDestroy, onDestroy,
showDestroy = true,
portal = false,
}: { }: {
row: AgentRow; row: AgentRow;
pending: boolean; pending: boolean;
@ -33,30 +31,6 @@ export function WantedMenu({
onSelectOffline: (row: AgentRow) => void; onSelectOffline: (row: AgentRow) => void;
onSelectPaused: (row: AgentRow) => void; onSelectPaused: (row: AgentRow) => void;
onDestroy?: (row: AgentRow) => void; onDestroy?: (row: AgentRow) => void;
/**
* The card view (see `AgentCard`) passes `false` here — its
* quick-access menu keeps to the three everyday states, so "destroy"
* can't be reached by an extra click off a state that's already open.
* `AgentsPage`'s detail-panel `WantedMenu` keeps the default (`true`)
* — mara: "destroy is already available via wanted state", i.e. the
* full menu there, not a separate button.
*/
showDestroy?: boolean;
/**
* Forwarded to `Dropdown`'s own `portal` (see its file-top comment) —
* only the table's "wanted" column needs it, to escape
* `.ui-table-scroll`'s clip on the table's last row (the bug `Dropdown`'s
* own `portal` prop exists to fix in the first place).
* Neither the card list nor the details dialog has a clipping ancestor,
* and inside the details dialog specifically `portal` is actively wrong:
* a `position: fixed` element appended to `document.body` renders
* *behind* an open native `<dialog>` (the dialog is promoted to the
* browser's top layer, which composites above ordinary body content
* regardless of z-index) — found while screenshotting this exact
* dropdown open inside the details dialog, only the portion extending
* past the dialog's own edge was visible.
*/
portal?: boolean;
}) { }) {
const [open, setOpen] = useState(false); const [open, setOpen] = useState(false);
const anchorRef = useRef<HTMLDivElement>(null); const anchorRef = useRef<HTMLDivElement>(null);
@ -75,9 +49,7 @@ export function WantedMenu({
{ value: "up", label: "up" }, { value: "up", label: "up" },
{ value: "paused", label: "paused" }, { value: "paused", label: "paused" },
{ value: "offline", label: "offline" }, { value: "offline", label: "offline" },
...(showDestroy { value: "destroy", label: "destroy", danger: true },
? [{ value: "destroy", label: "destroy", danger: true }]
: []),
]; ];
return ( return (
@ -103,7 +75,6 @@ export function WantedMenu({
/> />
<Dropdown <Dropdown
open={open} open={open}
portal={portal}
options={options} options={options}
activeValue={row.wanted ?? undefined} activeValue={row.wanted ?? undefined}
label={`declare ${row.name}`} label={`declare ${row.name}`}

View file

@ -1,4 +1,4 @@
// The detail panel's permissions editor: its starting selection and the // An opened agent card's permissions editor: its starting selection and the
// summary line. Run by `npm test` with Node's type stripping. // summary line. Run by `npm test` with Node's type stripping.
import assert from "node:assert/strict"; import assert from "node:assert/strict";
import { test } from "node:test"; import { test } from "node:test";

View file

@ -1,4 +1,4 @@
// The detail panel's allowed-domains editor: which entries one agent sees and // An opened agent card's allowed-domains editor: which entries one agent sees and
// the bodies it sends. Run by `npm test` with Node's type stripping. // the bodies it sends. Run by `npm test` with Node's type stripping.
import assert from "node:assert/strict"; import assert from "node:assert/strict";
import { test } from "node:test"; import { test } from "node:test";