Watch
0
0
Fork
You've already forked hyperhive
0

swarm ui: an open todos section on the agent card

This commit is contained in:
iris 2026-11-16 00:28:54 +01:00 • committed by mara
commit fa2a75d499
2 changed files with 200 additions and 12 deletions

View file

@ -43,6 +43,7 @@ import {
startsOpen,
type DetailSection,
} from "./sections.js";
import { AgentTodos } from "../terminal/AgentTodos.js";
import { BashTasks } from "../terminal/BashTasks.js";
import { SubagentTerms } from "../terminal/SubagentTerms.js";
import { WantedMenu } from "../roster/WantedMenu.js";
@ -317,6 +318,8 @@ function SectionBody({
case "terminal":
// The agent's live terminal and its input box.
return <AgentTermPreview agentName={row.name} />;
case "todos":
return <AgentTodos key={row.name} agentName={row.name} />;
case "subagents":
return <SubagentTerms key={row.name} agentName={row.name} />;
case "tasks":
@ -332,7 +335,7 @@ export function AgentDetail({
}: {
row: AgentRow;
actions: AgentActions;
/** Add the live terminal, subagents and background tasks sections. */
/** Add the live terminal, todos, subagents and background tasks sections. */
withTerminal?: boolean;
/**
* An opened card, whose header already shows the state rows. Without it

View file

@ -4,29 +4,26 @@
/** One folded block of an opened agent card. */
export type DetailSection =
| "status"
| "terminal"
| "subagents"
| "tasks"
| "settings";
"status" | "terminal" | "todos" | "subagents" | "tasks" | "settings";
/** What each section's header says. */
export const SECTION_TITLE: Record<DetailSection, string> = {
status: "status",
terminal: "terminal",
todos: "open todos",
subagents: "subagents",
tasks: "background tasks",
settings: "settings",
};
/**
* The sections a card shows, top to bottom. The terminal, subagents and tasks are
* The sections a card shows, top to bottom. The terminal, todos, subagents and tasks are
* left out where the page is already beside a terminal (the terminal page's
* details popover).
*/
export function sectionsFor(withTerminal: boolean): DetailSection[] {
return withTerminal
? ["status", "terminal", "subagents", "tasks", "settings"]
? ["status", "terminal", "todos", "subagents", "tasks", "settings"]
: ["status", "settings"];
}