swarm ui: agents page opens an agent's details beside the list
Selecting an agent card opens its details in a column on the right of the agents list, at /agents/<name>, instead of unfolding the card in place. The list is full width until an agent is selected, then narrows and the details slide in. A narrow screen shows the details alone, with a back button. A card's message is cut to one line. The shell treats /agents/<name> as the agents page, so the nav tab stays lit and the page is not rebuilt on each selection.
This commit is contained in:
parent
2d3da56907
commit
7bdaea7954
13 changed files with 494 additions and 154 deletions
|
|
@ -18,7 +18,7 @@
|
|||
gap: 0.4em 1em;
|
||||
}
|
||||
|
||||
/* The folded sections of an opened card sit one under another, each with the
|
||||
/* The folded sections of an agent's details sit one under another, each with the
|
||||
shared disclosure look; the fields keep the grid above. */
|
||||
.ui-agent-detail-sections {
|
||||
display: flex;
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
// <AgentDetail> — one agent's details: its status, wanted state, hive, config
|
||||
// PR, inference settings, resource caps and linked accounts, plus the actions on
|
||||
// them. Two layouts. In an opened card on `/agents` (`inCard`) the card header
|
||||
// already shows status, message and wanted state, so the body is folded
|
||||
// sections (`sections.ts`): status, terminal, open todos, subagents, background
|
||||
// tasks and settings, each built when first opened. In the details popover on a
|
||||
// terminal page (`AgentDetailPopover`) it is the status and the settings only,
|
||||
// since the page is already beside a terminal.
|
||||
// them. Two layouts. In the details beside the list on `/agents`
|
||||
// (`withTerminal`) it is the state rows, then folded sections (`sections.ts`):
|
||||
// status, terminal, open todos, subagents, background tasks and settings, each
|
||||
// built when first opened. In the details popover on a terminal page
|
||||
// (`AgentDetailPopover`) it is the state rows, then the status and the settings
|
||||
// only, since the page is already beside a terminal.
|
||||
//
|
||||
// Takes the agent's *live* row and the shared `AgentActions`, so a state
|
||||
// change or a link made here shows wherever else the same row is drawn.
|
||||
|
|
@ -51,7 +51,7 @@ import { SubagentTerms } from "../terminal/SubagentTerms.js";
|
|||
import { WantedMenu } from "../roster/WantedMenu.js";
|
||||
import "./AgentDetail.css";
|
||||
|
||||
/** The rows the card header already shows: status, message and wanted. */
|
||||
/** The state rows: status, message and wanted. */
|
||||
function HeaderRows({
|
||||
row,
|
||||
actions,
|
||||
|
|
@ -295,7 +295,7 @@ function LinkAccountAction({
|
|||
);
|
||||
}
|
||||
|
||||
/** The body of one folded section of an opened card. */
|
||||
/** The body of one folded section of an agent's details. */
|
||||
function SectionBody({
|
||||
section,
|
||||
row,
|
||||
|
|
@ -338,25 +338,17 @@ export function AgentDetail({
|
|||
row,
|
||||
actions,
|
||||
withTerminal = false,
|
||||
inCard = false,
|
||||
}: {
|
||||
row: AgentRow;
|
||||
actions: AgentActions;
|
||||
/** Add the live terminal, todos, subagents and background tasks sections. */
|
||||
withTerminal?: boolean;
|
||||
/**
|
||||
* An opened card, whose header already shows the state rows. Without it
|
||||
* (the terminal page's popover) those rows go above the same sections.
|
||||
*/
|
||||
inCard?: boolean;
|
||||
}) {
|
||||
return (
|
||||
<div class="ui-agent-detail ui-agent-detail-sections">
|
||||
{inCard ? null : (
|
||||
<dl class="ui-agent-detail-fields">
|
||||
<HeaderRows row={row} actions={actions} />
|
||||
</dl>
|
||||
)}
|
||||
<dl class="ui-agent-detail-fields">
|
||||
<HeaderRows row={row} actions={actions} />
|
||||
</dl>
|
||||
{sectionsFor(withTerminal).map((section) => (
|
||||
<LazyDisclosure
|
||||
key={section}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// <AgentDetailPopover> — an agent's details from `/agents`, as in an opened card, in a popover
|
||||
// <AgentDetailPopover> — an agent's details from `/agents`, as in the details beside the list, in a popover
|
||||
// under its anchor, for a page that is already showing the agent's terminal
|
||||
// and should not be left, or dimmed, to read or change its details. It carries
|
||||
// the same body (`AgentDetail`) and the same actions (`useAgentActions`) as the
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// <AgentInference> — one agent's inference settings in an opened agent card: the
|
||||
// <AgentInference> — one agent's inference settings in an agent's details: the
|
||||
// model and effort it runs on now, with where each came from, and an editor
|
||||
// for the value the swarm sets.
|
||||
//
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
// <AgentInstructions> — an editor for an agent's AGENTS.md, in a dialog opened
|
||||
// from the agent's opened card.
|
||||
// from the agent's details.
|
||||
//
|
||||
// It loads the copy the agent's harness last published
|
||||
// (`GET /api/agents/{name}/agents-md`, so a stopped agent shows the text it
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// <AgentLimits> — one agent's resource caps in an opened agent card: the CPU and
|
||||
// <AgentLimits> — one agent's resource caps in an agent's details: the CPU and
|
||||
// memory caps the swarm sets for it, and an editor for them.
|
||||
//
|
||||
// Reads `GET /api/agents/{name}/limits`, which answers the stored caps as
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
// <AgentPermissions>, <AgentInternet> and <AgentRepos> — one agent's grant in an
|
||||
// opened agent card: the permissions it holds, how far its traffic may leave
|
||||
// an agent's details: the permissions it holds, how far its traffic may leave
|
||||
// the host, and how many repositories its forge account may create. Each is a badge that opens a control under it, which saves as soon as it
|
||||
// changes.
|
||||
//
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// <AgentSsh> — one agent's SSH access in an opened agent card: a badge that
|
||||
// <AgentSsh> — one agent's SSH access in an agent's details: a badge that
|
||||
// opens a warning and the switch, then three folded sections: "how it works"
|
||||
// (the explainer), "on the target" (the text a machine needs to trust the
|
||||
// agent's certificates) and "connections" (the agent's named connections, in
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// The allowed-domains editor of an opened agent card: which entries it
|
||||
// The allowed-domains editor of an agent's details: which entries it
|
||||
// shows and the bodies it sends. Kept out of the component so `npm test` can
|
||||
// run it.
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// An opened agent card's permissions editor: what it starts on and how a granted
|
||||
// The agent details' permissions editor: what it starts on and how a granted
|
||||
// set reads. Kept out of the component so `npm test` can run it.
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
// what order, and which start open. The card's header already shows the
|
||||
// agent's state, message and wanted state, so the sections hold the rest.
|
||||
|
||||
/** One folded block of an opened agent card. */
|
||||
/** One folded block of an agent's details. */
|
||||
export type DetailSection =
|
||||
| "status"
|
||||
| "terminal"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// The named SSH connections of an opened agent card: the routes, the body a
|
||||
// The named SSH connections of an agent's details: the routes, the body a
|
||||
// save sends and what the add form says about a name that is already there.
|
||||
// Kept out of the component so `npm test` can run it. The controller checks
|
||||
// every field (the name, user and host rules, the ports it refuses, the limit of
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// An opened agent card's SSH row: what the badge says, the body of the PUT that
|
||||
// The agent details' SSH row: what the badge says, the body of the PUT that
|
||||
// flips the switch, and the text an operator puts on a target machine. Kept out
|
||||
// of the component so `npm test` can run it.
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue