Local-first AI coding agent desktop: Electron + Rust host core + pi Agent Harness + user-installable plugins
TypeScript ai-agentcoding-agentdesktop-appelectronglobali18nlocal-firstmcppipi-agentpi-desktoppluginsreactrusttypescript
feat(subagents): move detail stop control to composer
zszz3105c7cdc562c
diff --git a/apps/desktop/src/components/workpanel/SubagentTranscriptTab.tsx b/apps/desktop/src/components/workpanel/SubagentTranscriptTab.tsxindex f4a16444e..9469dd4fc 100644--- a/apps/desktop/src/components/workpanel/SubagentTranscriptTab.tsx+++ b/apps/desktop/src/components/workpanel/SubagentTranscriptTab.tsx@@ -7,7 +7,7 @@ import { useAppStore } from "../../stores/app-store";import { useFollowScroll } from "../../hooks/use-follow-scroll";import { useTranscriptView } from "../../hooks/use-transcript-view";import { useTranscriptSearchFocus } from "../../hooks/use-transcript-search-focus";-import { IconArrowDown } from "../icons";+import { IconArrowDown, IconBot, IconChevronDown } from "../icons";import { Textarea, TooltipButton } from "../ui";import { DisclosureAnchorContext } from "../../lib/disclosure-anchor-context";import { TranscriptDisclosureProvider } from "../../features/chat/transcript/disclosure";@@ -21,6 +21,7 @@ import {} from "../ReviewChangeCard";import { ToolRow } from "../../features/chat/transcript/ToolRow";import { Markdown } from "../Markdown";+import { delegateModelId, delegateThinkingLevel } from "../../features/chat/transcript/model";/*** The work-panel tab showing one delegation as a conversation (issue #917).@@ -63,6 +64,18 @@ function SubagentTranscriptSurface({ delegationId }: { delegationId: string }) {subagentOutcome(message, statuses) === "running";});}, [messages, delegationId]);+ const delegateSettings = useMemo(() => {+ const result = messages.find((message) => {+ if (message.role !== "tool") return false;+ const payload = toolResultPayload(message);+ return payload && typeof payload === "object" && !Array.isArray(payload) &&+ "delegationId" in payload && payload.delegationId === delegationId;+ });+ return {+ modelId: result ? delegateModelId(result) : "",+ thinkingLevel: result ? delegateThinkingLevel(result) : undefined,+ };+ }, [messages, delegationId]);const isRunning = useAppStore((state) => (activeSessionId ? state.runningSessions[activeSessionId] ?? false : false),);@@ -114,11 +127,6 @@ function SubagentTranscriptSurface({ delegationId }: { delegationId: string }) {return (<DisclosureAnchorContext.Provider value={disclosureAnchorNotifier}><div className="subagent-transcript-tab" data-testid="subagent-transcript-tab">- {delegateRunning ? (- <div className="subagent-transcript-actions">- <SubagentStopButton delegationId={delegationId} running />- </div>- ) : null}<divref={scrollRef}data-scroll-owner="follow"@@ -202,6 +210,23 @@ function SubagentTranscriptSurface({ delegationId }: { delegationId: string }) {aria-label={t("panel.subagentReadOnly")}placeholder={t("panel.subagentReadOnly")}/>+ <div className="subagent-transcript-composer-controls">+ <button+ type="button"+ className="subagent-transcript-model-picker"+ disabled+ aria-label={`${t("chat.model")}: ${delegateSettings.modelId || "—"}. ${t("chat.reasoningLevel")}: ${delegateSettings.thinkingLevel || "—"}`}+ >+ <IconBot size={14} aria-hidden="true" />+ <span>{delegateSettings.modelId || "—"}</span>+ <span aria-hidden="true">·</span>+ <span>{delegateSettings.thinkingLevel || "—"}</span>+ <IconChevronDown size={12} aria-hidden="true" />+ </button>+ {delegateRunning ? (+ <SubagentStopButton delegationId={delegationId} running />+ ) : null}+ </div></footer></div></DisclosureAnchorContext.Provider>diff --git a/apps/desktop/src/styles/work-panel.css b/apps/desktop/src/styles/work-panel.cssindex 56f33cc8d..f2420b108 100644--- a/apps/desktop/src/styles/work-panel.css+++ b/apps/desktop/src/styles/work-panel.css@@ -374,12 +374,6 @@* column (scroll area above a read-only composer) and the composer itself.* The scroll area owns the only scrollbar; the composer never scrolls.*/-.subagent-transcript-actions {- display: flex;- justify-content: flex-end;- padding: 8px 12px;-}-.subagent-transcript-tab {display: flex;min-width: 0;@@ -438,6 +432,40 @@min-height: calc(var(--leading-chat) * 2em);resize: none;}++.subagent-transcript-composer-controls {+ display: flex;+ align-items: center;+ justify-content: space-between;+ gap: 8px;+ padding-top: 8px;+}++.subagent-transcript-model-picker {+ display: inline-flex;+ min-width: 0;+ align-items: center;+ gap: 5px;+ border: 0;+ border-radius: var(--radius-sm);+ padding: 5px 7px;+ overflow: hidden;+ color: var(--ds-text-muted);+ background: transparent;+ font: inherit;+ font-size: var(--text-sm);+}++.subagent-transcript-model-picker span {+ overflow: hidden;+ text-overflow: ellipsis;+ white-space: nowrap;+}++.subagent-transcript-model-picker:disabled {+ cursor: not-allowed;+ opacity: 0.8;+}/* Shared per-tool empty state used by Files and plugin fallback surfaces. */.work-tab-empty {display: flex;diff --git a/apps/desktop/test/subagent-panel.test.mjs b/apps/desktop/test/subagent-panel.test.mjsindex b04164f6b..7de2c1abe 100644--- a/apps/desktop/test/subagent-panel.test.mjs+++ b/apps/desktop/test/subagent-panel.test.mjs@@ -96,6 +96,14 @@ test("the delegation tab renders a message list with a read-only composer", () =assert.match(tabSource, /disabled/);assert.match(tabSource, /rows=\{2\}/);assert.match(tabSource, /placeholder=\{t\("panel\.subagentReadOnly"\)\}/);+ assert.match(tabSource, /className="subagent-transcript-composer-controls"/);+ assert.match(tabSource, /className="subagent-transcript-model-picker"/);+ assert.match(tabSource, /delegateModelId\(result\)/);+ assert.match(tabSource, /delegateThinkingLevel\(result\)/);+ assert.match(tabSource, /<SubagentStopButton delegationId=\{delegationId\} running \/>/);+ assert.doesNotMatch(tabSource, /subagent-transcript-actions/);+ assert.match(workPanelCss, /\.subagent-transcript-composer-controls \{/);+ assert.match(workPanelCss, /\.subagent-transcript-model-picker:disabled \{/);// Display-only: no send path may exist in the composer.assert.doesNotMatch(tabSource, /onSubmit|onSend|api\.send/);});