Skip to content

Local-first AI coding agent desktop: Electron + Rust host core + pi Agent Harness + user-installable plugins

fix(chat): keep detailed turns ungrouped

vastsa21fd93ffdb1b
diff --git a/apps/desktop/src/features/chat/transcript/AssistantTurn.tsx b/apps/desktop/src/features/chat/transcript/AssistantTurn.tsx
index bbf95b96c..d93e28def 100644
--- a/apps/desktop/src/features/chat/transcript/AssistantTurn.tsx
+++ b/apps/desktop/src/features/chat/transcript/AssistantTurn.tsx
@@ -25,7 +25,11 @@ import {
collectDelegationStatuses,
collectDelegationTimings,
} from "../../../lib/subagent-topology";
-import { projectTurnProcess } from "../../../lib/turn-process";
+import {
+ projectTurnProcess,
+ resolveThinkingDisplayMode,
+ shouldGroupTurnProcess,
+} from "../../../lib/turn-process";
import { useAppStore } from "../../../stores/app-store";
import { Markdown } from "../../../components/Markdown";
import { IconBranch, IconReview } from "../../../components/icons";
@@ -275,6 +279,11 @@ export const AssistantTurn = memo(function AssistantTurn({
);
statusesRef.current = turnDelegationStatuses;
timingsRef.current = turnDelegationTimings;
+ const groupProcess = useAppStore((state) =>
+ shouldGroupTurnProcess(
+ resolveThinkingDisplayMode(state.settings?.thinkingDisplayMode),
+ ),
+ );
const { process, responses } = projectTurnProcess(entry);
const activePart = isActive ? entry.parts.at(-1) : undefined;
@@ -320,10 +329,16 @@ export const AssistantTurn = memo(function AssistantTurn({
aria-label={t("chat.assistantMessage")}
>
<div className="message-col">
- <TurnProcess processParts={process} turnParts={entry.parts} isActive={isActive}>
- {process.map(renderPart)}
- </TurnProcess>
- {responses.map(renderPart)}
+ {groupProcess ? (
+ <>
+ <TurnProcess processParts={process} turnParts={entry.parts} isActive={isActive}>
+ {process.map(renderPart)}
+ </TurnProcess>
+ {responses.map(renderPart)}
+ </>
+ ) : (
+ entry.parts.map(renderPart)
+ )}
{!isActive && metaMessage ? (
<MessageMeta
modelId={modelId}
diff --git a/apps/desktop/src/lib/turn-process.ts b/apps/desktop/src/lib/turn-process.ts
index 01dd2cc49..2121a1084 100644
--- a/apps/desktop/src/lib/turn-process.ts
+++ b/apps/desktop/src/lib/turn-process.ts
@@ -54,13 +54,18 @@ export function hasFailedProcessTool(parts: readonly AssistantTurnPart[]): boole
);
}
-/** Detailed keeps process visible; compact only auto-opens an active tool failure. */
+/** Compact groups a turn into one process disclosure; detailed does not. */
+export function shouldGroupTurnProcess(mode: ThinkingDisplayMode): boolean {
+ return mode === "compact";
+}
+
+/** Compact process stays collapsed unless an active tool failed. */
export function shouldAutoOpenTurnProcess(
mode: ThinkingDisplayMode,
isActive: boolean,
hasToolFailure: boolean,
): boolean {
- return mode === "detailed" || (isActive && hasToolFailure);
+ return mode === "compact" && isActive && hasToolFailure;
}
/**
diff --git a/apps/desktop/test/turn-process.test.mjs b/apps/desktop/test/turn-process.test.mjs
index 4d4799787..27fa5c146 100644
--- a/apps/desktop/test/turn-process.test.mjs
+++ b/apps/desktop/test/turn-process.test.mjs
@@ -8,6 +8,7 @@ const {
visibleProcessSteps,
resolveThinkingDisplayMode,
shouldAutoOpenTurnProcess,
+ shouldGroupTurnProcess,
turnProcessTiming,
} = await import("../src/lib/turn-process.ts");
@@ -97,10 +98,12 @@ test("missing and unknown display settings retain detailed mode", () => {
assert.equal(resolveThinkingDisplayMode("compact"), "compact");
});
-test("detailed auto-opens completed process; compact only opens active failures", () => {
- assert.equal(shouldAutoOpenTurnProcess("detailed", false, false), true);
- assert.equal(shouldAutoOpenTurnProcess("detailed", true, false), true);
- assert.equal(shouldAutoOpenTurnProcess("detailed", false, true), true);
+test("only compact groups a turn into a process; compact auto-opens active failures", () => {
+ assert.equal(shouldGroupTurnProcess("detailed"), false);
+ assert.equal(shouldGroupTurnProcess("compact"), true);
+ assert.equal(shouldAutoOpenTurnProcess("detailed", false, false), false);
+ assert.equal(shouldAutoOpenTurnProcess("detailed", true, false), false);
+ assert.equal(shouldAutoOpenTurnProcess("detailed", true, true), false);
assert.equal(shouldAutoOpenTurnProcess("compact", false, false), false);
assert.equal(shouldAutoOpenTurnProcess("compact", true, false), false);
assert.equal(shouldAutoOpenTurnProcess("compact", true, true), true);
diff --git a/docs/adr/turn-process-and-thinking-display.md b/docs/adr/turn-process-and-thinking-display.md
index 8e2817322..dff5b8ae1 100644
--- a/docs/adr/turn-process-and-thinking-display.md
+++ b/docs/adr/turn-process-and-thinking-display.md
@@ -14,16 +14,16 @@ thinking indicator without rapidly changing reasoning text.
## Decision
-The renderer projects each existing assistant-turn entry into one process
-area and its trailing answer. Thinking, tools and intermediate assistant text
-keep their original order inside the process. A trailing assistant text stays
+Compact mode projects each assistant-turn entry into one process area and
+its trailing answer. Thinking, tools and intermediate assistant text keep
+their original order inside the process. A trailing assistant text stays
visible while streaming; if a later tool or thinking block follows, that text
belongs to the process. There is no semantic final-answer marker in UiMessage,
so the renderer does not guess intent from the wording. User/system messages
and compaction dividers retain their existing turn boundaries.
-Detailed mode keeps process areas open for both active and completed turns
-and retains the existing thinking-row disclosures. Compact mode starts
+Detailed mode does not wrap a process: thinking, tools and intermediate
+assistant text stay in transcript order beside the answer. Compact mode starts
completed process areas collapsed. Manual disclosure choices survive
streaming and completion. Search navigation opens the containing process.
Tool failures open an unclaimed active process so the invocation error stays
@@ -50,8 +50,8 @@ tool and intermediate-text items and omit hidden compact-mode thinking.
## Consequences
-- One completed turn has one process disclosure plus its visible answer.
-- Detailed mode keeps thinking, tools and intermediate text visible without an extra click; compact remains the collapsed presentation.
+- Compact completed turns have one process disclosure plus the visible answer.
+- Detailed mode does not group that work; compact remains the collapsed process.
- Unchanged activity groups keep their memoized boundary during text deltas;
the process wrapper does not move execution or persistence into the renderer.
- This groups loaded transcript entries; it does not reconstruct history that
diff --git a/docs/spec/04-ux/06-settings-ia.md b/docs/spec/04-ux/06-settings-ia.md
index eb6a8df73..fa27eb52d 100644
--- a/docs/spec/04-ux/06-settings-ia.md
+++ b/docs/spec/04-ux/06-settings-ia.md
@@ -172,8 +172,9 @@ Settings is a **full-window page** that replaces the app sidebar + main chrome (
to Off, and has no follow-the-session entry. Settings search indexes the card,
its switch, the template row, the default-model row, and the reasoning row.
- **Thinking display mode** uses a menu select with Detailed (default) and
- Compact. Detailed keeps the turn process open and retains reasoning text;
- Compact collapses completed processes, shows only an active thinking
+ Compact. Detailed shows reasoning, tools and intermediate text in place
+ without grouping them into a process; Compact groups that work into a
+ process, collapses completed processes, shows only an active thinking
indicator, and hides finished thought rows. The global preference
persists as `thinkingDisplayMode` in host-owned settings; missing values use
Detailed. It affects presentation only, not model reasoning configuration.
diff --git a/docs/spec/04-ux/08-component-spec.md b/docs/spec/04-ux/08-component-spec.md
index 37dbbf7d7..19b20e881 100644
--- a/docs/spec/04-ux/08-component-spec.md
+++ b/docs/spec/04-ux/08-component-spec.md
@@ -804,22 +804,22 @@ reading surface of the workstation.
### Turn process and thinking display
-Each assistant-turn entry has one process disclosure containing reasoning,
-tools and intermediate assistant text in transcript order. Its trailing answer
-streams outside the disclosure. Later activity moves a provisional answer into
-the process without altering the stored message. Assistant errors and trailing
-aborted partial replies stay visible. Compaction and user/system boundaries are
-unchanged.
-
-Detailed mode keeps process areas open, including completed history. Compact
-mode starts completed process areas collapsed. Manual choices and search
-reveals own the disclosure until unmount. Failed tools open an unclaimed
-active process even in compact mode and keep their invocation-level error
-presentation.
-The header shows elapsed time and the visible process step count. Its thinking
-label applies only while the latest activity is streaming reasoning without answer
-text; streamed answers use the processing label. Delegation
-cards and individual tool details remain available inside the process.
+Compact mode projects each assistant-turn entry into one process disclosure
+containing reasoning, tools and intermediate assistant text in transcript
+order. Its trailing answer streams outside the disclosure. Later activity
+moves a provisional answer into the process without altering the stored
+message. Detailed mode does not wrap that process: the same parts stay in
+place. Assistant errors and trailing aborted partial replies stay visible.
+Compaction and user/system boundaries are unchanged.
+
+Compact mode starts completed process areas collapsed. Manual choices and
+search reveals own the disclosure until unmount. Failed tools open an
+unclaimed active process even in compact mode and keep their invocation-level
+error presentation. The compact header shows elapsed time and the visible
+process step count. Its thinking label applies only while the latest activity
+is streaming reasoning without answer text; streamed answers use the
+processing label. Delegation cards and individual tool details remain
+available inside the compact process.
`thinkingDisplayMode` defaults to `detailed`. In `compact`, reasoning text and
excerpts are absent, active reasoning has a status indicator, and completed
diff --git a/docs/spec/04-ux/09-interaction-patterns.md b/docs/spec/04-ux/09-interaction-patterns.md
index 43645fc31..a628b811b 100644
--- a/docs/spec/04-ux/09-interaction-patterns.md
+++ b/docs/spec/04-ux/09-interaction-patterns.md
@@ -800,14 +800,14 @@ may be retained while exactly one workspace supplies the visible shell context.
- Tool activity starts as a lightweight collapsed row; failed calls open
automatically so the error remains local to its invocation.
-- One assistant turn has one process disclosure containing thinking, tool calls
- and intermediate progress text. The trailing answer streams outside it;
- later activity moves that text into the process. The header updates elapsed
- time once per second while active and shows the visible step count.
-- Detailed mode keeps the process open, including after completion, and
- retains the latest thinking row's automatic disclosure. Compact completed
- process areas collapse unless a click, keyboard activation or search
- reveal has taken ownership. Tool details keep
+- Compact mode gives one assistant turn one process disclosure containing
+ thinking, tool calls and intermediate progress text. The trailing answer
+ streams outside it; later activity moves that text into the process. The
+ header updates elapsed time once per second while active and shows the
+ visible step count.
+- Detailed mode does not wrap a process. Compact completed process areas
+ collapse unless a click, keyboard activation or search reveal has taken
+ ownership. Tool details keep
their individual controls. Failed tool calls open an unclaimed active process so
their errors stay visible even in compact mode.
- Compact thinking mode shows only a status indicator while reasoning streams;
diff --git a/docs/spec/06-delivery/04-e2e-test-plan.md b/docs/spec/06-delivery/04-e2e-test-plan.md
index dab9f7e89..a11aa502d 100644
--- a/docs/spec/06-delivery/04-e2e-test-plan.md
+++ b/docs/spec/06-delivery/04-e2e-test-plan.md
@@ -13490,9 +13490,9 @@ plugin-form fixtures in an isolated temporary directory at runtime.
- **Steps:** Stream the turn; finish it; expand/collapse its process; search an
intermediate message; switch display modes through Settings → AI → Defaults.
Repeat with a stopped partial answer, an assistant error and a failed tool.
-- **Expected:** In detailed mode, completed work has one open process plus
- its final answer. Compact mode keeps that process collapsed until expanded.
- Manual choices survive updates; search reveals its target; live answer text
+- **Expected:** In detailed mode, thinking, tools and intermediate text stay
+ in place with no process wrapper. Compact mode keeps that process collapsed
+ until expanded. Manual choices survive updates; search reveals its target; live answer text
stays readable. Errors and stopped trailing text stay visible. Compact mode
exposes no reasoning text or excerpt, shows a live indicator, and leaves no
completed thinking-only header. Tools and progress remain accessible. Switching
diff --git a/packages/i18n/src/locales/de/index.ts b/packages/i18n/src/locales/de/index.ts
index 4b330fa49..2611112ee 100644
--- a/packages/i18n/src/locales/de/index.ts
+++ b/packages/i18n/src/locales/de/index.ts
@@ -933,7 +933,7 @@ sklm: {
"linkOpenTargetWorkpanel": "Arbeitsbereich-Browser",
"linkOpenTargetExternal": "Standard-Betriebssystem-Browser",
"thinkingDisplayMode": "Denkprozess anzeigen",
- "thinkingDisplayModeDesc": "Detailliert zeigt den Denktext. Kompakt zeigt während des Denkens einen Hinweis und blendet abgeschlossene Denkprozesse aus.",
+ "thinkingDisplayModeDesc": "Detailliert zeigt Denken, Werkzeuge und Zwischentext an Ort und Stelle. Kompakt fasst das in einem Prozess zusammen, zeigt während des Denkens einen Hinweis und blendet abgeschlossene Denkprozesse aus.",
"thinkingDisplayDetailed": "Detailliert (Standard)",
"thinkingDisplayCompact": "Kompakt",
"contextUsageDisplay": "Kontextnutzung-Anzeige",
diff --git a/packages/i18n/src/locales/en/index.ts b/packages/i18n/src/locales/en/index.ts
index 79947207c..89b4b65c6 100644
--- a/packages/i18n/src/locales/en/index.ts
+++ b/packages/i18n/src/locales/en/index.ts
@@ -942,7 +942,7 @@ sklm: {
linkOpenTargetWorkpanel: "Work panel browser",
linkOpenTargetExternal: "Default OS browser",
thinkingDisplayMode: "Thinking display mode",
- thinkingDisplayModeDesc: "Detailed shows reasoning text. Compact shows a thinking indicator while active and hides completed thinking.",
+ thinkingDisplayModeDesc: "Detailed shows reasoning, tools and intermediate text in place. Compact groups that work into a process, shows a thinking indicator while active, and hides completed thinking.",
thinkingDisplayDetailed: "Detailed (default)",
thinkingDisplayCompact: "Compact",
contextUsageDisplay: "Context usage readout",
diff --git a/packages/i18n/src/locales/es/index.ts b/packages/i18n/src/locales/es/index.ts
index 6468e15c1..8042ce4ad 100644
--- a/packages/i18n/src/locales/es/index.ts
+++ b/packages/i18n/src/locales/es/index.ts
@@ -933,7 +933,7 @@ sklm: {
"linkOpenTargetWorkpanel": "Navegador del panel de trabajo",
"linkOpenTargetExternal": "Navegador predeterminado del sistema",
"thinkingDisplayMode": "Visualización del razonamiento",
- "thinkingDisplayModeDesc": "Detallado muestra el razonamiento. Compacto muestra un indicador mientras se razona y oculta el razonamiento al terminar.",
+ "thinkingDisplayModeDesc": "Detallado muestra razonamiento, herramientas y texto intermedio en su sitio. Compacto agrupa ese trabajo en un proceso, muestra un indicador mientras se razona y oculta el razonamiento al terminar.",
"thinkingDisplayDetailed": "Detallado (predeterminado)",
"thinkingDisplayCompact": "Compacto",
"contextUsageDisplay": "Lectura del uso del contexto",
diff --git a/packages/i18n/src/locales/fr/index.ts b/packages/i18n/src/locales/fr/index.ts
index 41c0f8b0c..70d7dcb83 100644
--- a/packages/i18n/src/locales/fr/index.ts
+++ b/packages/i18n/src/locales/fr/index.ts
@@ -933,7 +933,7 @@ sklm: {
"linkOpenTargetWorkpanel": "Navigateur du panneau de travail",
"linkOpenTargetExternal": "Navigateur par défaut du système",
"thinkingDisplayMode": "Affichage du raisonnement",
- "thinkingDisplayModeDesc": "Le mode détaillé affiche le raisonnement. Le mode compact affiche un indicateur pendant la réflexion, puis masque le raisonnement terminé.",
+ "thinkingDisplayModeDesc": "Le mode détaillé affiche raisonnement, outils et texte intermédiaire sur place. Le mode compact les regroupe dans un processus, affiche un indicateur pendant la réflexion, puis masque le raisonnement terminé.",
"thinkingDisplayDetailed": "Détaillé (par défaut)",
"thinkingDisplayCompact": "Compact",
"contextUsageDisplay": "Affichage de l'usage du contexte",
diff --git a/packages/i18n/src/locales/ko/index.ts b/packages/i18n/src/locales/ko/index.ts
index 4cee41ee4..623e8c002 100644
--- a/packages/i18n/src/locales/ko/index.ts
+++ b/packages/i18n/src/locales/ko/index.ts
@@ -943,7 +943,7 @@ sklm: {
linkOpenTargetWorkpanel: "작업 패널 브라우저",
linkOpenTargetExternal: "시스템 기본 브라우저",
thinkingDisplayMode: "사고 과정 표시 모드",
- thinkingDisplayModeDesc: "상세 모드는 사고 내용을 표시합니다. 간결 모드는 사고 중에 상태만 표시하고 완료된 사고 과정은 숨깁니다.",
+ thinkingDisplayModeDesc: "상세 모드는 사고·도구·중간 텍스트를 제자리에 표시하고 처리 블록으로 묶지 않습니다. 간결 모드는 그 과정을 하나로 묶고, 사고 중에는 상태만 표시하며 완료된 사고는 숨깁니다.",
thinkingDisplayDetailed: "상세 (기본값)",
thinkingDisplayCompact: "간결",
contextUsageDisplay: "컨텍스트 사용량 표시",
diff --git a/packages/i18n/src/locales/tr/index.ts b/packages/i18n/src/locales/tr/index.ts
index cae1757cc..ee743beb8 100644
--- a/packages/i18n/src/locales/tr/index.ts
+++ b/packages/i18n/src/locales/tr/index.ts
@@ -943,7 +943,7 @@ sklm: {
linkOpenTargetWorkpanel: "Çalışma paneli tarayıcısı",
linkOpenTargetExternal: "Varsayılan sistem tarayıcısı",
thinkingDisplayMode: "Düşünme görünümü",
- thinkingDisplayModeDesc: "Ayrıntılı mod düşünme metnini gösterir. Sade mod düşünürken bir gösterge gösterir ve tamamlanan düşünmeyi gizler.",
+ thinkingDisplayModeDesc: "Ayrıntılı mod düşünme, araçlar ve ara metni yerinde gösterir, bir işlem bloğunda birleştirmez. Sade mod bunları bir işlemde gruplar, düşünürken bir gösterge gösterir ve tamamlanan düşünmeyi gizler.",
thinkingDisplayDetailed: "Ayrıntılı (varsayılan)",
thinkingDisplayCompact: "Sade",
contextUsageDisplay: "Bağlam kullanımı göstergesi",
diff --git a/packages/i18n/src/locales/zh-CN/index.ts b/packages/i18n/src/locales/zh-CN/index.ts
index 9eb474943..3def702ce 100644
--- a/packages/i18n/src/locales/zh-CN/index.ts
+++ b/packages/i18n/src/locales/zh-CN/index.ts
@@ -932,7 +932,7 @@ sklm: {
linkOpenTargetWorkpanel: "工作区浏览器",
linkOpenTargetExternal: "系统默认浏览器",
thinkingDisplayMode: "思考过程展示模式",
- thinkingDisplayModeDesc: "详细模式显示思考文本;精简模式仅在思考时显示状态提示,结束后隐藏思考块。",
+ thinkingDisplayModeDesc: "详细模式按原文展开思考、工具和中间文本,不合成处理块。精简模式将过程收进处理块,思考中仅显示状态提示,结束后隐藏思考块。",
thinkingDisplayDetailed: "详细(默认)",
thinkingDisplayCompact: "精简",
contextUsageDisplay: "上下文用量读数",
diff --git a/packages/i18n/src/locales/zh-TW/index.ts b/packages/i18n/src/locales/zh-TW/index.ts
index e2ece0bdb..2d4d956de 100644
--- a/packages/i18n/src/locales/zh-TW/index.ts
+++ b/packages/i18n/src/locales/zh-TW/index.ts
@@ -932,7 +932,7 @@ sklm: {
linkOpenTargetWorkpanel: "工作區瀏覽器",
linkOpenTargetExternal: "系統預設瀏覽器",
thinkingDisplayMode: "思考過程顯示模式",
- thinkingDisplayModeDesc: "詳細模式顯示思考文字;精簡模式僅在思考時顯示狀態提示,結束後隱藏思考區塊。",
+ thinkingDisplayModeDesc: "詳細模式依原文展開思考、工具與中間文字,不合成處理區塊。精簡模式將過程收進處理區塊,思考中僅顯示狀態提示,結束後隱藏思考區塊。",
thinkingDisplayDetailed: "詳細(預設)",
thinkingDisplayCompact: "精簡",
contextUsageDisplay: "上下文用量讀數",
diff --git a/scripts/e2e/turn-process.tsx b/scripts/e2e/turn-process.tsx
index 74a2f490e..e68d45330 100644
--- a/scripts/e2e/turn-process.tsx
+++ b/scripts/e2e/turn-process.tsx
@@ -111,57 +111,101 @@ export async function turnProcessProbe() {
try {
render(messages);
check(
- container.querySelectorAll(".turn-process").length === 1,
- "one process per turn",
+ container.querySelectorAll(".turn-process").length === 0,
+ "detailed does not wrap a process",
);
check(
- header()?.getAttribute("aria-expanded") === "true" && visible(process()),
- "detailed completed process starts open",
+ visible(container.querySelector('[data-message-id="answer"]')),
+ "final answer stays visible",
+ );
+ check(
+ visible(container.querySelector('[data-message-id="progress"]')),
+ "detailed keeps intermediate progress visible",
+ );
+ check(
+ container.querySelectorAll(".tool-row").length === 3,
+ "detailed shows thinking and both tools in place",
+ );
+
+ const streaming = message("stream", "assistant", "Live text", {
+ status: "streaming",
+ });
+ render([streaming], true, null, "stream");
+ check(
+ !header() && visible(container.querySelector('[data-message-id="stream"]')),
+ "streamed answer is never delayed behind disclosure",
+ );
+ render([streaming, read], true, null, "stream");
+ check(
+ !header() && visible(container.querySelector('[data-message-id="stream"]')),
+ "detailed keeps streamed text visible after later tools",
);
+ render([intro, read, { ...answer, status: "aborted" }], false, null, "aborted");
check(
visible(container.querySelector('[data-message-id="answer"]')),
- "final answer stays visible",
+ "stopped partial answer remains visible",
+ );
+ render(
+ [
+ intro,
+ read,
+ message("failure", "assistant", "", {
+ error: { code: "INTERNAL", message: "Connection failed", retryable: true },
+ }),
+ ],
+ false,
+ null,
+ "error",
);
check(
- header()?.textContent?.includes("5 steps"),
- "process counts thought, tools and progress once",
+ visible(container.querySelector('[data-message-id="failure"]')),
+ "failure remains visible",
);
+
+ flushSync(() =>
+ useAppStore.setState({
+ settings: { ...settings, thinkingDisplayMode: "compact" },
+ }),
+ );
+ render(messages, false, null, "compact-group");
check(
- visible(container.querySelector('[data-message-id="progress"]')),
- "detailed completed process shows intermediate progress",
+ container.querySelectorAll(".turn-process").length === 1,
+ "one process per turn",
+ );
+ check(
+ header()?.getAttribute("aria-expanded") === "false" && !visible(process()),
+ "compact completed process starts collapsed",
);
check(
- process()?.querySelectorAll(".tool-row").length === 3,
- "detailed process shows thinking and both tools",
+ header()?.textContent?.includes("4 steps"),
+ "process counts tools and progress once",
);
click(header());
check(
- header()?.getAttribute("aria-expanded") === "false" && !visible(process()),
- "detailed process can still collapse",
+ visible(container.querySelector('[data-message-id="progress"]')),
+ "expanding reveals intermediate progress",
);
- render(messages, true);
- render(messages);
check(
- header()?.getAttribute("aria-expanded") === "false",
- "manual disclosure survives active-to-complete transition",
+ process()?.querySelectorAll(".tool-row").length === 2,
+ "compact expanding retains both tools without thinking",
);
-
- render([intro, read], true, null, "live");
+ render(messages, true, null, "compact-group");
+ render(messages, false, null, "compact-group");
check(
header()?.getAttribute("aria-expanded") === "true",
- "detailed process opens while active",
+ "manual disclosure survives active-to-complete transition",
);
- render(messages, false, null, "live");
+
+ render([intro, read], true, null, "live");
check(
- header()?.getAttribute("aria-expanded") === "true" &&
- visible(container.querySelector('[data-message-id="progress"]')),
- "detailed unclaimed process stays open on completion",
+ header()?.getAttribute("aria-expanded") === "false",
+ "compact live process stays collapsed without a tool failure",
);
render(
messages,
false,
{ sessionId: "s", messageId: "progress", query: "problem", requestId: 1 },
- "live",
+ "search",
);
check(
visible(container.querySelector('[data-message-id="progress"]')),
@@ -186,7 +230,7 @@ export async function turnProcessProbe() {
"thinking-transition",
);
check(
- processLabel()?.startsWith(i18n.t("chat.processingFor", { time: "" })) &&
+ !header() &&
visible(container.querySelector('[data-message-id="live-thought"]')),
"answer streaming ends the thinking label even when reasoning is retained",
);
@@ -206,40 +250,11 @@ export async function turnProcessProbe() {
"a later answer takes precedence over an earlier streaming thought",
);
- const streaming = message("stream", "assistant", "Live text", {
- status: "streaming",
- });
- render([streaming], true, null, "stream");
- check(
- !header() && visible(container.querySelector('[data-message-id="stream"]')),
- "streamed answer is never delayed behind disclosure",
- );
- render([streaming, read], true, null, "stream");
+ render([streaming, read], true, null, "stream-compact");
check(
process()?.querySelector('[data-message-id="stream"]'),
"later tool moves provisional text into process",
);
- render([intro, read, { ...answer, status: "aborted" }], false, null, "aborted");
- check(
- visible(container.querySelector('[data-message-id="answer"]')),
- "stopped partial answer remains visible",
- );
- render(
- [
- intro,
- read,
- message("failure", "assistant", "", {
- error: { code: "INTERNAL", message: "Connection failed", retryable: true },
- }),
- ],
- false,
- null,
- "error",
- );
- check(
- visible(container.querySelector('[data-message-id="failure"]')),
- "failure remains outside folded process",
- );
render(
[intro, { ...read, toolStatus: "error", isError: true }, answer],