Watch
0
0
Fork
You've already forked hyperhive
0

swarm-ui: fold an agent's long activity lists, and list subagents as rows

On a busy agent the activity section grew long: the todos and bash tasks
ran to dozens of rows, and the subagents were one wrapping line of badges.
Each list now shows its first five rows with a "show all N" button;
expanded, the rows scroll in a bounded box. The subagents are one row each
(name, model and effort, state and age), running first and the rest dimmed,
as in the menu on the terminal page, and a picked subagent stays in view
when the list is folded.
This commit is contained in:
iris 2026-11-23 18:14:26 +01:00
commit ef4c9214f7

View file

@ -5,6 +5,7 @@
//
// Mount it keyed by agent name: the refresh timer is armed once per mount.
import { ApiErrorPanel } from "@hive/shared/api-error-panel.js";
import { CappedRows } from "../../ui/capped-rows/CappedRows.js";
import { Hint } from "../../ui/hint/Hint.js";
import { RelativeTime } from "../../ui/relative-time/RelativeTime.js";
import { todosLabel } from "./agent-todos.js";
@ -30,19 +31,23 @@ export function AgentTodos({ agentName }: { agentName: string }) {
) : (
<>
<p class="ui-agent-todos-count">{todosLabel(todos)}</p>
<ul class="ui-agent-todos-list">
{todos.map((t) => (
<li key={t.id} class="ui-agent-todos-item">
<span class="ui-agent-todos-subsystem">{t.subsystem}</span>
<span class="ui-agent-todos-summary" title={t.summary}>
{t.summary}
</span>
<span class="ui-agent-todos-age">
<RelativeTime epochMs={t.updated_unix * 1000} />
</span>
</li>
))}
</ul>
<CappedRows rows={todos} noun="todos">
{(shown) => (
<ul class="ui-agent-todos-list">
{shown.map((t) => (
<li key={t.id} class="ui-agent-todos-item">
<span class="ui-agent-todos-subsystem">{t.subsystem}</span>
<span class="ui-agent-todos-summary" title={t.summary}>
{t.summary}
</span>
<span class="ui-agent-todos-age">
<RelativeTime epochMs={t.updated_unix * 1000} />
</span>
</li>
))}
</ul>
)}
</CappedRows>
</>
)}
</section>