A local-first multi-agent app development platform, built on PenguinHarness
fix(web): a subagent's description sits a size below the agent's name (#1096)
lmliheng3a1410520a61
diff --git a/changelog/unreleased/2026-10-15-subagent-description-size.md b/changelog/unreleased/2026-10-15-subagent-description-size.mdnew file mode 100644index 00000000..560e2392--- /dev/null+++ b/changelog/unreleased/2026-10-15-subagent-description-size.md@@ -0,0 +1,20 @@+# Agents panel: a subagent's description sits a size below its name++- **Date:** 2026-10-15+- **Type:** fix+- **Scope:** `web`++[中文版](2026-10-15-subagent-description-size.zh.md)++Ported from upstream PenguinHarness (#1096, commit `6e54f6bc`).++In the agents panel's call graph, the second line of a child node — the description its spawning+`run_subagent` call carried — sat on the same rung as the agent's name above it, so a Chinese+description read as large as the name, or larger, and the node lost its who-then-what order. The+name now uses the body rung and the description keeps the small one beneath it, in all three+themes.++The graph's node boxes, gaps and edges follow the Font size setting as well: the canvas lays them+out in rem rather than in fixed pixels, so a node box grows with its two lines instead of squeezing+them. Before, Frost at XL clipped the bottom of the description. At the same font size a long+agent name truncates a little sooner; the node's tooltip still shows the full name and description.diff --git a/changelog/unreleased/2026-10-15-subagent-description-size.zh.md b/changelog/unreleased/2026-10-15-subagent-description-size.zh.mdnew file mode 100644index 00000000..77de17ee--- /dev/null+++ b/changelog/unreleased/2026-10-15-subagent-description-size.zh.md@@ -0,0 +1,17 @@+# 智能体面板:子智能体的描述比名称小一号++- **Date:** 2026-10-15+- **Type:** fix+- **Scope:** `web`++[English](2026-10-15-subagent-description-size.md)++移植自上游 PenguinHarness(#1096,提交 `6e54f6bc`)。++智能体面板的调用关系图里,子节点的第二行是派生它的 `run_subagent` 调用所带的描述,此前与上方的+Agent 名用同一档字号 —— 中文描述看上去和名称一样大、甚至更大,节点上「先是谁、再做什么」的层次+就没了。现在名称改用正文字号,描述仍用小号字排在下方,三套主题都是如此。++关系图的节点框、间距与连线也随之跟随「字号」设置:画布按 rem 而不是固定像素排布,节点框因此跟着+它那两行字一起长大,而不是把字挤在里面。此前白领主题在「特大」档会把描述的下沿截掉。同一字号下,+较长的 Agent 名会稍早被截断;节点的 tooltip 仍显示完整的名称与描述。diff --git a/packages/web/src/features/chat/agent-topology-view.tsx b/packages/web/src/features/chat/agent-topology-view.tsxindex b4534820..7c1656e4 100644--- a/packages/web/src/features/chat/agent-topology-view.tsx+++ b/packages/web/src/features/chat/agent-topology-view.tsx@@ -2,8 +2,10 @@* Call-graph rendering for the subagents panel: hand-rolled SVG for the edges plus absolutely* positioned real <button> nodes on top (real buttons keep keyboard focus, aria naming, and CSS* text truncation for free — an all-SVG node would have to reinvent each). Geometry comes from- * the pure layoutTopology (agent-topology.ts); the canvas renders at its natural pixel size and- * the wrapper scrolls horizontally when the tree is deeper than the panel is wide.+ * the pure layoutTopology (agent-topology.ts), whose numbers are CSS pixels at the default 16px+ * root; the canvas sets them in rem, so a node box grows with the user's text size together with+ * the two lines it holds, and the wrapper scrolls horizontally when the tree is deeper than the+ * panel is wide.* Each child node shows its wall-clock elapsed time (ticking while it runs, frozen at its last* activity when done — never a sum of its items); the root carries no stamps and shows none.*/@@ -12,6 +14,9 @@ import { S } from "../../lib/strings";import { layoutTopology, NODE_H, NODE_W } from "./agent-topology";import type { TopologyNode } from "./agent-topology";+/** A layout length (CSS pixels at the default 16px root) as the rem the canvas renders it in. */+const rem = (px: number): string => `${px / 16}rem`;+export function AgentTopologyView({nodes,selectedId,@@ -28,12 +33,12 @@ export function AgentTopologyView({const layout = layoutTopology(nodes);return (<div role="group" aria-label={S.subagentPanel.topologyLabel} className="overflow-x-auto">- <div className="relative" style={{ width: layout.width, height: layout.height }}>- {/* Edges only — nodes are HTML buttons layered above. */}+ <div className="relative" style={{ width: rem(layout.width), height: rem(layout.height) }}>+ {/* Edges only — nodes are HTML buttons layered above. The paths stay in layout units and+ the viewBox scales them with the canvas; the stroke keeps its width at every size. */}<svg- width={layout.width}- height={layout.height}- className="absolute inset-0 text-gray-300 dark:text-gray-700"+ viewBox={`0 0 ${layout.width} ${layout.height}`}+ className="absolute inset-0 h-full w-full text-gray-300 dark:text-gray-700"aria-hidden>{layout.edges.map((edge) => (@@ -43,6 +48,7 @@ export function AgentTopologyView({fill="none"stroke="currentColor"strokeWidth="1.5"+ vectorEffect="non-scaling-stroke"/>))}</svg>@@ -64,7 +70,7 @@ export function AgentTopologyView({aria-pressed={selected}data-tooltip={tooltip}onClick={() => onSelect(node)}- style={{ left: x, top: y, width: NODE_W, height: NODE_H }}+ style={{ left: rem(x), top: rem(y), width: rem(NODE_W), height: rem(NODE_H) }}className={`absolute flex flex-col justify-center gap-px rounded-md border bg-white px-2 text-left transition-colors duration-150 dark:bg-gray-900 ${selected? "border-brand-500 ring-1 ring-brand-500"@@ -73,7 +79,7 @@ export function AgentTopologyView({><span className="flex w-full min-w-0 items-center gap-1.5"><AgentAvatar id={node.agentId ?? node.sessionId} name={label} size={18} />- <span className="min-w-0 flex-1 truncate text-xs font-medium text-gray-700 dark:text-gray-300">+ <span className="min-w-0 flex-1 truncate text-sm font-medium text-gray-700 dark:text-gray-300">{label}</span>{/* Elapsed: ticking from first appearance while running, frozen at the settled@@ -89,11 +95,13 @@ export function AgentTopologyView({{/* Status is already part of the button's accessible name: keep the glyph decorative. */}<StatusIcon state={node.running ? "running" : "done"} size="xs" /></span>- {/* Second line: what this child was spawned to do. Indented to the label's own- left edge (avatar width + gap) and truncated to one line — the model writes a- free-form sentence into a fixed-size box, and the full text is in the tooltip.- Nodes without one (the root, a standalone child, an omitted description) drop- the line and the single row centers itself in the box instead. */}+ {/* Second line: what this child was spawned to do. It sits a rung below the+ name (small under body), so the node reads as who first and what second — CJK+ text on the name's own rung looks larger than a Latin name above it. Indented to+ the label's own left edge (avatar width + gap) and truncated to one line — the+ model writes a free-form sentence into a fixed-size box, and the full text is in+ the tooltip. Nodes without one (the root, a standalone child, an omitted+ description) drop the line and the single row centers itself in the box instead. */}{node.description !== null && (<span className="w-full truncate pl-[24px] text-xs leading-tight text-fg-subtle">{node.description}diff --git a/packages/web/src/features/chat/agent-topology.ts b/packages/web/src/features/chat/agent-topology.tsindex e34bbe7a..8f9dc46b 100644--- a/packages/web/src/features/chat/agent-topology.ts+++ b/packages/web/src/features/chat/agent-topology.ts@@ -432,6 +432,8 @@ export function modelAtOrigin(model: StreamModel, origin: readonly string[]): St// call's description. Sized uniformly rather than per-node: variable heights would have to be// threaded through row placement and edge geometry below, for the sake of a few nodes that// carry no description (the root never does) and simply center their single line instead.+// Every length here is a CSS pixel at the default 16px root: the view sets them in rem, so the+// box keeps fitting its two lines at every text size.export const NODE_W = 200;export const NODE_H = 46;export const GAP_X = 32;@@ -440,7 +442,7 @@ export const PAD = 6;export interface PlacedNode {node: TopologyNode;- /** Top-left corner of the node box (CSS pixels within the layout canvas). */+ /** Top-left corner of the node box (layout units within the canvas: CSS pixels at a 16px root). */x: number;y: number;}