Local-first AI coding agent desktop: Electron + Rust host core + pi Agent Harness + user-installable plugins
TypeScript ai-agentcoding-agentdesktop-appelectronglobali18nlocal-firstmcppipi-agentpi-desktoppluginsreactrusttypescript
fix(transcript): keep activity details visible after turns settle
xieqiying986212f64342
diff --git a/apps/desktop/src/features/chat/transcript/ActivityGroup.tsx b/apps/desktop/src/features/chat/transcript/ActivityGroup.tsxindex 48c4a6583..488e4379a 100644--- a/apps/desktop/src/features/chat/transcript/ActivityGroup.tsx+++ b/apps/desktop/src/features/chat/transcript/ActivityGroup.tsx@@ -61,6 +61,8 @@ type Translate = (key: string, options?: Record<string, unknown>) => string;type ActivityItem = AssistantActivityItem;+const AUTOMATIC_OPEN_MAX_ITEMS = 4;+function waitingSubagentActionLabel(agent: AgentActivityAgent,@@ -204,7 +206,6 @@ export const ActivityGroup = memo(function ActivityGroup({const showThinking = useAppStore((state) => resolveShowThinking(state.settings));const hideThinking = !showThinking;const displayMode = useAppStore((state) => resolveTranscriptDisplayMode(state.settings));- const thinkingDefaultOpen = displayMode !== "fully-folded";const { t } = useTranslation();const detailsId = useId();const rawDelegateItems = useMemo(() => items.filter(isDelegationActivityItem), [items]);@@ -241,8 +242,11 @@ export const ActivityGroup = memo(function ActivityGroup({? searchTarget.requestId : undefined, [items, searchTarget]);const visibleItems = useMemo(() => cachedVisibleActivityItems(items, hideThinking, isActive), [items, hideThinking, isActive]);const first = items[0];+ // Groups frame their rows; each tool or search payload keeps its own+ // disclosure, so leaving a small group open does not reveal tool details.+ const automaticallyOpen = hasSubagentTopology || live || visibleItems.length <= AUTOMATIC_OPEN_MAX_ITEMS;const disclosure = useAutomaticDisclosure(- hasSubagentTopology ? live : visibleItems.length <= 1 || live,+ automaticallyOpen,revealRequest,disclosureKey("activity", first?.message.id ?? "", first?.kind ?? "", first?.kind === "hostedSearch" ? first.round.id : ""),);@@ -321,7 +325,6 @@ export const ActivityGroup = memo(function ActivityGroup({delegationStatuses={delegationStatuses}delegationTimings={delegationTimings}onUserInteraction={claimDisclosure}- thinkingDefaultOpen={thinkingDefaultOpen}/>;// Flat mode has one outer process disclosure and no nested group at all.diff --git a/apps/desktop/src/features/chat/transcript/ActivityItems.tsx b/apps/desktop/src/features/chat/transcript/ActivityItems.tsxindex 72c9aa8e7..59a8cc006 100644--- a/apps/desktop/src/features/chat/transcript/ActivityItems.tsx+++ b/apps/desktop/src/features/chat/transcript/ActivityItems.tsx@@ -22,13 +22,10 @@ type ActivityItemsProps = {delegationStatuses: ReadonlyMap<string, SubagentOutcome>;delegationTimings: ReadonlyMap<string, SubagentTiming>;onUserInteraction: () => void;- /** Flat and command-first expand every Thinking row by default. */- thinkingDefaultOpen?: boolean;};type ActivityItemBlockProps = Omit<ActivityItemsProps, "items" | "delegateItems" | "delegationStatuses" | "delegationTimings"> & {block: RenderBlock<AssistantActivityItem>;- lastItem?: AssistantActivityItem;topologyItem?: AssistantActivityItem;delegateItems?: DelegationActivityItem[];delegationStatuses?: ReadonlyMap<string, SubagentOutcome>;@@ -36,9 +33,8 @@ type ActivityItemBlockProps = Omit<ActivityItemsProps, "items" | "delegateItems"};const ActivityItemBlock = memo(function ActivityItemBlock({- block, isActive, live, lastItem, topologyItem,+ block, isActive, live, topologyItem,delegateItems, delegationStatuses, delegationTimings, onUserInteraction,- thinkingDefaultOpen,}: ActivityItemBlockProps) {return <>{block.items.map((item) => {// The topology predicate narrows to all tools, but a false result can still@@ -74,7 +70,7 @@ const ActivityItemBlock = memo(function ActivityItemBlock({key={`thinking-${item.message.id}`}message={item.message}streaming={isActive && item.message.status === "streaming"}- autoOpen={thinkingDefaultOpen || (live && item === lastItem)}+ autoOpenonUserInteraction={onUserInteraction}/>;})}</>;@@ -82,23 +78,19 @@ const ActivityItemBlock = memo(function ActivityItemBlock({export const ActivityItems = memo(function ActivityItems({ items, ...context }: ActivityItemsProps) {const blocks = useRenderBlocks(items, itemKey);- const lastItem = items.at(-1);const topologyItem = context.delegateItems[0];return <>{blocks.map((block) => {- const ownsLast = lastItem !== undefined && block.items.includes(lastItem);const ownsTopology = topologyItem !== undefined && block.items.includes(topologyItem);return <ActivityItemBlockkey={block.key}block={block}isActive={context.isActive}live={context.live}- lastItem={ownsLast ? lastItem : undefined}topologyItem={ownsTopology ? topologyItem : undefined}delegateItems={ownsTopology ? context.delegateItems : undefined}delegationStatuses={ownsTopology ? context.delegationStatuses : undefined}delegationTimings={ownsTopology ? context.delegationTimings : undefined}onUserInteraction={context.onUserInteraction}- thinkingDefaultOpen={context.thinkingDefaultOpen}/>;})}</>;});diff --git a/apps/desktop/test/thinking-ui.test.mjs b/apps/desktop/test/thinking-ui.test.mjsindex a0773f7af..401c10618 100644--- a/apps/desktop/test/thinking-ui.test.mjs+++ b/apps/desktop/test/thinking-ui.test.mjs@@ -278,10 +278,13 @@ test("tool and search rows stay collapsed while thinking keeps its leaf default"assert.match(transcriptDisclosureSource, /revealRequest\?: number/);assert.match(transcriptDisclosureSource, /const currentOpen = useRef\(open\)/);assert.match(transcriptDisclosureSource, /const setManualOpen = useCallback/);- assert.match(transcriptSource, /useAutomaticDisclosure\(\s*hasSubagentTopology \? live : visibleItems\.length <= 1/);assert.match(transcriptSource,- /<ThinkingRow[\s\S]*?autoOpen=\{thinkingDefaultOpen \|\| \(live && item === lastItem\)\}/,+ /const automaticallyOpen = hasSubagentTopology \|\| live \|\| visibleItems\.length <= AUTOMATIC_OPEN_MAX_ITEMS;/,+ );+ assert.match(+ transcriptSource,+ /<ThinkingRow[\s\S]*?\n\s*autoOpen\n/,);// The leaf default stays with thinking only; a tool, hosted-search or plan// row waits for an explicit user action in either mode.diff --git a/apps/desktop/test/transcript-display-modes-ui.test.mjs b/apps/desktop/test/transcript-display-modes-ui.test.mjsindex 8bd614632..fffa6dcbe 100644--- a/apps/desktop/test/transcript-display-modes-ui.test.mjs+++ b/apps/desktop/test/transcript-display-modes-ui.test.mjs@@ -33,10 +33,9 @@ test("command-first and fully-folded use distinct process segmentation", () => {assert.match(turnProcessSource, /isStandaloneRunActivity\(item\)/);});-test("thinking expands by default outside fully-folded mode", () => {- assert.match(activityGroupSource, /displayMode !== "fully-folded"/);- assert.match(activityGroupSource, /thinkingDefaultOpen=\{thinkingDefaultOpen\}/);- assert.match(activityItemsSource, /autoOpen=\{thinkingDefaultOpen \|\| \(live && item === lastItem\)\}/);+test("thinking rows expand by default in every transcript display mode", () => {+ assert.doesNotMatch(activityGroupSource, /thinkingDefaultOpen/);+ assert.match(activityItemsSource, /<ThinkingRow[\s\S]*?\n\s*autoOpen\n/);});test("thinking collapsed state uses the whole-run TextShimmer, not a spinner", () => {diff --git a/docs/adr/turn-process-and-thinking-display.md b/docs/adr/turn-process-and-thinking-display.mdindex 01a8a399f..daee9ad9f 100644--- a/docs/adr/turn-process-and-thinking-display.md+++ b/docs/adr/turn-process-and-thinking-display.md@@ -2,8 +2,8 @@- Status: Accepted- Date: 2026-09-17-- Amended: 2026-10-21-- Issues: #510, #461+- Amended: 2026-10-22+- Issues: #510, #461, #1806- Amends: D071, [ADR 0242](0242-delta-only-streaming-updates.md)## Context@@ -64,11 +64,11 @@ still load, is no longer exposed in Settings, and is not read for rendering; newwrites store `transcriptDisplayMode`.Group folding defaults are unified across modes and do not depend on the-thinking preference. Where a group renders, the group that owns the active-execution segment starts open, then closes on completion only while untouched.-Other completed groups start closed. An untouched active group containing any-recorded failed or denied tool stays open through later recovery and closes on-turn completion if still untouched.+thinking preference. The active ordinary group stays open while its segment is+active. After completion, ordinary groups with at most four visible items stay+open, larger ordinary groups start closed, and Task topology groups stay open.+Tool, search and run-row payloads keep their own closed defaults. Explicit user+choices remain authoritative.The turn's disclosure header states the turn's outcome and never echoes the itemit is working on, because a shell command or search query can be arbitrarily@@ -87,13 +87,11 @@ The disclosure and the levels it reveals share one left edge. Hierarchy iscarried by type size and colour, not by indentation, so a nested group header anda run row start exactly where the turn header does.-The thinking preference is a boolean `showThinking`. With it on, `flat` and-`command-first` expand every Thinking row by default and let the user collapse-them; an expanded row shows the full reasoning markdown, while a collapsed row-shows only the Thinking indicator with no summary or excerpt. `fully-folded`-keeps the released exception: earlier Thinking rows stay collapsed, and the last-active Thinking row opens only while it is the live step, so completed rows-collapse. With the preference off, no completed reasoning row renders; only a+The thinking preference is a boolean `showThinking`. With it on, every visible+Thinking row expands by default in all three display modes and the user may+collapse each row independently; an expanded row shows the full reasoning+markdown, while a collapsed row shows only the Thinking indicator with no summary+or excerpt. With the preference off, no completed reasoning row renders; only alive whole-run `TextShimmer` `Thinking` indicator remains while reasoning isactively streaming. The shimmer is a 1.2s linear sweep with a 220ms fade — nospinner, pulsing dot, or per-character animation — and stays static under@@ -151,10 +149,11 @@ turn.- One disclosure per turn keeps the final answer and actionable interruptionsreachable, and makes a long turn collapsible in a single gesture.- Group folding defaults are unified across display modes: active work stays- visible, untouched completed groups fold by default, and explicit disclosure- choices are preserved regardless of the thinking preference. Closing the- turn's disclosure closes the groups under it, and reopening restores the groups- the user had opened.+ visible, small completed ordinary groups and Task topology groups stay open,+ and larger ordinary groups start closed. Explicit disclosure choices are+ preserved regardless of the thinking preference. Closing the turn's disclosure+ hides the groups under it, and reopening restores their defaults and explicit+ choices.- With `showThinking` off, no completed reasoning row renders; only the livewhole-run TextShimmer `Thinking` indicator remains while reasoning streams.Stored reasoning is retained and reappears when the preference is turned back@@ -165,8 +164,8 @@ turn.groups; all three render exactly one disclosure, and reading the mode whilerendering repaints the transcript immediately instead of waiting for newmessages.-- With `showThinking` on, Thinking rows default expanded in `flat` and- `command-first`; `fully-folded` keeps the live-only auto-open exception.+- With `showThinking` on, Thinking rows default expanded in `flat`,+ `command-first`, and `fully-folded`.- The header answers "how did this turn end up" in one short line. Echoing thecurrent command was removed: it pushed the counts off the row and duplicatedwhat opening the item already shows.@@ -191,6 +190,13 @@ covers the `showThinking`/legacy `thinkingDisplayMode` resolver precedence, andthe i18n catalog tests cover the new `settings.showThinking` copy. The UI,resolver, and E2E scenarios are validated on the integration candidate; seeE2E-CHAT-turn-process-and-thinking-display for the synchronized scenario text.+For the 2026-10-22 amendment, issue #1806 was reproduced in the React/Electron+transcript harness: after settlement, a small activity group and reasoning rows+were collapsed behind the closed turn process. The amendment keeps groups of up+to four visible items and Task topology groups open, and leaves Thinking rows+expanded by default when `showThinking` is on. The transcript E2E now covers+active-to-settled disclosure behavior, while oversized groups and tool payloads+remain closed by default. See E2E-CHAT-turn-process-and-thinking-display.For the 2026-10-21 amendment, `apps/desktop/test/turn-process.test.mjs` coversmode segmentation, including `flat`, `command-first` and `fully-folded`, andheader phase precedence. `apps/desktop/test/transcript-display-modes-ui.test.mjs`diff --git a/docs/spec/04-ux/08-component-spec.md b/docs/spec/04-ux/08-component-spec.mdindex 8827d9a6e..23587d180 100644--- a/docs/spec/04-ux/08-component-spec.md+++ b/docs/spec/04-ux/08-component-spec.md@@ -897,13 +897,12 @@ thinking never creates an empty wrapper. All three modes render exactly onetop-level process disclosure and change neither what a tool received nor what isstored.-The ordinary group owning the active execution segment starts open while a turn is-active, then closes on completion only if untouched; other completed groups start-closed. An untouched active group remains open when any failed or denied tool has-been recorded, through later successful recovery, and closes on completion if still-untouched. These group defaults are unified across modes and do not depend on the-thinking preference. Group headers summarize count, running state and issue count-without treating a failed child as a failed turn.+The ordinary group owning the active execution segment stays open while its turn+is active. Afterward, ordinary groups with at most four visible items remain open;+larger groups start closed, while Task topology groups remain open. These defaults+are unified across modes and do not depend on the thinking preference. Explicit+user choices remain authoritative. Group headers summarize count, running state+and issue count without treating a failed child as a failed turn.The turn disclosure header states the turn's outcome and never echoes the item itis working on, because a shell command or search query can be arbitrarily long. It@@ -920,11 +919,10 @@ group header and a run row start exactly where the turn header does.Except for the display mode's Thinking default, no item payload opens itself: atool, hosted-search or plan call stays a header row until the user opens itsdisclosure, including a Bash row, whose detail stays closed until the user opens-it. The activity groups keep their automatic open defaults, so-a live turn still shows its work. With `Show thinking` on, Thinking rows expand by-default in Flat and Commands first and collapse only on user action; Fully folded-keeps the released exception where earlier rows stay collapsed and only the last-active row opens while it is live. An expanded Thinking row shows its full+it. Active groups stay open; after completion, small groups (up to four visible+items) and Task topology groups remain open, while larger ordinary groups start+closed. With `Show thinking` on, Thinking rows expand by default in every display+mode and collapse only on user action. An expanded Thinking row shows its fullreasoning markdown; a collapsed one shows only the Thinking indicator, with nosummary or excerpt. With `Show thinking` off, no completed reasoning row renders;only a live whole-run TextShimmer `Thinking` indicator remains while reasoning is@@ -1616,10 +1614,10 @@ storage but compose into one assistant turn until the next user message.spacing, including before the first assistant output. Opacity hides thosebuttons without removing their space, so hover does not shift content.- Toggle Thinking disclosure: expand/collapse reasoning independently from the- final answer. The latest reasoning row opens while it streams and closes when- the turn settles only if the user has not interacted with it. The expanded- content's left rule is itself a pointer and keyboard-focusable collapse- control.+ final answer. With `Show thinking` on, every visible reasoning row starts+ expanded and stays so after the turn settles unless the user collapses it. The+ expanded content's left rule is itself a pointer and keyboard-focusable+ collapse control.- Hover code block: copy button appears- Click a transcript file reference with `:line[:column]`: resolve the filefirst, then open it in the host `file:` tab and scroll the requested line into@@ -2306,9 +2304,10 @@ as its own row beside them, and a progress message or command ends a group. With`flat`, no group renders and the rows keep transcript order inside the outerdisclosure. A singleton uses its item disclosure directly, and Task topologykeeps its existing container. A Bash-only turn still has its one disclosure.-While the turn is active, the ordinary group owning the execution segment opens;-when it settles, an untouched group closes. These group defaults do not depend on-the thinking preference. No item payload opens itself, except the display mode's+While the turn is active, its ordinary group opens. After completion, ordinary+groups with at most four visible items remain open; larger groups start closed,+and Task topology groups remain open. These group defaults do not depend on the+thinking preference. No item payload opens itself, except the display mode'sThinking default: a tool, hosted-search or plan row stays a header row until theuser opens it, whichever item of the group it is, including a Bash row whosedetail stays closed until opened.@@ -2340,14 +2339,14 @@ seconds when non-zero) from one hour onward. Zero-value units are omitted, so- The leading Lucide icon reflects the action type: file, folder, search,edit, terminal, web, or generic tool.- A multi-item group header owns elapsed time plus item and issue counts and stays- in the transcript after completion. The active group starts open and closes on- completion only if untouched; completed groups otherwise start closed. These- defaults do not depend on the thinking preference. A singleton has no group- header.+ in the transcript after completion. Active groups stay open; after completion,+ groups with at most four visible items and Task topology groups remain open,+ while larger ordinary groups start closed. These defaults do not depend on the+ thinking preference. A singleton has no group header.- Tool/search payloads stay collapsed until the user opens them; no tool/search- row auto-opens, so a final thinking item never selects an earlier tool. Live- thinking follows its own indicator/disclosure policy and never opens sibling- payloads.+ row auto-opens, so a final thinking item never selects an earlier tool. With+ `Show thinking` on, reasoning rows open by default in every display mode and+ never open sibling payloads.- `Bash` and run rows are revealed by the turn's process disclosure. In`fully-folded` they sit inside their group; in `command-first` they sit at itstop level beside the groups with adjacent rows separate; in `flat` no groups@@ -2426,7 +2425,7 @@ twice.| State | Header treatment | Expanded content ||---|---|---|| Running | Progressive action with readable text and a pulsing marker; a `run` row also shows its spinner and pulses the status dot beside `Working…` | The active multi-item group opens; no tool/search payload opens itself, except the display mode's Thinking default; live thinking follows its own indicator/disclosure policy |-| Success | Past-tense action + result chips; no green success badge, except a `run` row's dot and `Done` | Result blocks, then arguments if not already shown; an untouched active group closes on completion, while manual group and item choices are retained |+| Success | Past-tense action + result chips; no green success badge, except a `run` row's dot and `Done` | Result blocks, then arguments if not already shown; small groups and Task topology groups stay open, large untouched ordinary groups close, and manual group and item choices are retained || Error | Past-tense action + compact danger status; details remain collapsed by default and open only on user request. A `run` row is in this state whenever its command exited nonzero, whatever the call reported (D227) | Error note first, then arguments || Denied | Muted `Denied` status; payload remains closed until requested | Permission result when available |@@ -2447,9 +2446,10 @@ twice.disclosure, and a reference that matches nothing reports itself withoutopening a panel. A tool surface picks no destination of its own.- Click the processing header: expand/collapse only that ordered activity list.- The active group opens and closes on settlement only if untouched; completed- groups otherwise start closed. Opening a group does not expand every item, and- sibling groups remain independent.+ Active groups stay open; after completion, ordinary groups with at most four+ visible items and Task topology groups remain open, while larger ordinary+ groups start closed. Opening a group does not expand every item, and sibling+ groups remain independent.- Click or keyboard-activate the left rule beside expanded thinking, tool details,delegated work, or processing steps: collapse that owning disclosure withoutchanging adjacent expansion state. Item interaction also claims its containingdiff --git a/docs/spec/04-ux/09-interaction-patterns.md b/docs/spec/04-ux/09-interaction-patterns.mdindex 78bca6941..898caf191 100644--- a/docs/spec/04-ux/09-interaction-patterns.md+++ b/docs/spec/04-ux/09-interaction-patterns.md@@ -932,12 +932,12 @@ may be retained while exactly one workspace supplies the visible shell context.hidden thinking does not create a redundant group, and existing Task topologyremains separate. No mode adds a second top-level disclosure or leaves a runrow outside the process.-- The active ordinary group starts open and closes when it completes only if- untouched; completed groups otherwise start closed, and an untouched active group- with any recorded failed/denied tool remains open through recovery. These group- defaults do not depend on the thinking preference. Closing the turn's disclosure hides- every group and run row under it without erasing their choices; reopening- restores the groups the user had opened.+- The active ordinary group stays open while the turn runs. After completion,+ ordinary groups with at most four visible items and Task topology groups remain+ open; larger ordinary groups start closed. These defaults do not depend on the+ thinking preference. Closing the turn's disclosure hides every group and run+ row under it without erasing their choices; reopening restores their defaults+ and any explicit user choices.- The turn header reports `Failed`, `Stopped`, `Running`, or `Finished` in thatprecedence, names compaction and recovery while those stages are live, reads`Thinking` while the live step is reasoning, omits the duration when the@@ -946,13 +946,11 @@ may be retained while exactly one workspace supplies the visible shell context.type size and colour rather than indentation.- No item payload opens itself, except the display mode's Thinking default: atool, hosted-search or plan call stays a header row until the user opens it,- including the literal final item of the last activity group. Group defaults are- unchanged, so a final thinking item never causes a backward scan. With- `Show thinking` on, Thinking rows default expanded in Flat and Commands first and- collapse only on user action; Fully folded keeps the released live-only- auto-open exception. A collapsed row shows only the Thinking indicator, with no- excerpt. With `Show thinking` off, no completed reasoning row renders; only a- live whole-run TextShimmer `Thinking` indicator remains while reasoning streams.+ including the literal final item of the last activity group. With `Show thinking`+ on, Thinking rows default expanded in every display mode and collapse only on+ user action. A collapsed row shows only the Thinking indicator, with no excerpt.+ With `Show thinking` off, no completed reasoning row renders; only a live+ whole-run TextShimmer `Thinking` indicator remains while reasoning streams.Stored reasoning is retained and reappears when the preference is turned back on.- Activating a group or item header toggles only that level. Closing a parentpreserves child state, reopening restores it, and sibling groups remaindiff --git a/docs/spec/06-delivery/04-e2e-test-plan.md b/docs/spec/06-delivery/04-e2e-test-plan.mdindex ced0b4975..01efc338f 100644--- a/docs/spec/06-delivery/04-e2e-test-plan.md+++ b/docs/spec/06-delivery/04-e2e-test-plan.md@@ -3381,9 +3381,11 @@ identify the platform validation still needed.- **Expected**: A turn renders exactly one process disclosure containing everypre-answer row, the `Bash`/run rows included; the trailing answer, assistanterrors and stopped trailing text stay outside it, as do pending actions. The- active group opens, then closes on completion only if untouched; completed- groups otherwise start closed. Closing the turn's disclosure closes the groups- and run rows under it, and reopening restores the user's group choices. In+ active group stays open while the turn runs. After completion, ordinary groups+ with at most four visible items and Task topology groups remain open; larger+ ordinary groups start closed. Closing the turn's disclosure hides groups and+ run rows under it, and reopening restores their defaults and explicit user+ choices. InFully folded (the default), run rows stay inside their groups and only ordinaryassistant progress text splits a group. In Commands first, run rows render astheir own rows beside the groups, adjacent calls stay separate, a row's detail@@ -17224,7 +17226,11 @@ plugin-form fixtures in an isolated temporary directory at runtime.settings; legacy message-level transcript search targets.- **Steps:** Confirm a live active group starts open, let that same turn finishwithout interacting, and confirm the process closes so only the final answer- (and any error or pending-action surface) remains. On a second turn, explicitly+ (and any error or pending-action surface) remains. Reopen it and confirm a+ group with at most four visible items and any Task topology group stay open,+ while a larger ordinary group is closed. Confirm tool and search payloads stay+ closed, and Fully folded keeps each visible reasoning row open when+ `Show thinking` is on. On a second turn, explicitlyopen a completed group and confirm the choice survives subsequent updates; thenclose the turn's disclosure and confirm the group closes with it, and reopen toconfirm the group choice is restored. In Fully folded, confirm run rows stay@@ -17262,12 +17268,12 @@ plugin-form fixtures in an isolated temporary directory at runtime.stay inside their groups and only ordinary assistant progress text splits agroup, so the middle progress paragraph ends the preceding group and thefollowing activity starts a new one. A group appears only with at least two- visible items; a singleton has no group. Thinking rows default expanded in- Flat and Commands first, while Fully folded keeps the released exception:- earlier rows stay collapsed and only the last active row opens while it is- live, then completed rows collapse.+ visible items; a singleton has no group. Active groups stay open while the turn+ runs; after completion, groups with at most four visible items and Task topology+ groups remain open, while larger ordinary groups start closed. Thinking rows+ default expanded in every mode when `Show thinking` is on.Explicit user choices persist and are restored when the enclosing disclosure is- reopened; these group defaults do not depend on `Show thinking`. The header+ reopened; group defaults do not depend on `Show thinking`. The headerreports running, finished, stopped, or failed with failure and stop outrankinga normal finish, reads `Thinking` while the live step is reasoning, namescompaction and recovery while those stages are live, omits a duration thediff --git a/docs/spec/08-meta/decisions-log.md b/docs/spec/08-meta/decisions-log.mdindex 7259a0e98..da0a75865 100644--- a/docs/spec/08-meta/decisions-log.md+++ b/docs/spec/08-meta/decisions-log.md@@ -7901,3 +7901,20 @@ must keep splitting are covered by `markdown-blocks.test.mjs`.`apps/desktop/test/composer-deep-file-search-user-path.test.mjs`. See`03-runtime/01-ipc-protocol.md` §13c, `04-ux/08-component-spec.md` §11.8,and E2E-COMPOSER-deep-file-mentions.++## 2026-10-22 — Keep small activity groups and reasoning visible after settlement (D670)++- D670 amends D661 / D668 and ADR `turn-process-and-thinking-display`: an+ ordinary activity group stays open while active; after completion, groups with+ at most four visible items remain open, larger ordinary groups start closed,+ and Task topology groups remain open. The whole-turn process still closes on+ completion by default.+- With `showThinking` on, all visible Thinking rows default expanded in Flat,+ Commands first, and Fully folded. Tool, search, and run-row payloads remain+ collapsed until the user opens them. Explicit disclosure choices remain+ authoritative; there is no protocol or persistence change.+- Issue #1806 reproduced the group and reasoning collapse at turn settlement.+ `pnpm test:e2e:transcript` covers active-to-completed groups, reasoning rows,+ and closed payloads. See `04-ux/08-component-spec.md`,+ `04-ux/09-interaction-patterns.md`, and+ E2E-CHAT-turn-process-and-thinking-display.diff --git a/scripts/e2e/turn-process.tsx b/scripts/e2e/turn-process.tsxindex 7ee20cade..6e645a90d 100644--- a/scripts/e2e/turn-process.tsx+++ b/scripts/e2e/turn-process.tsx@@ -188,7 +188,7 @@ export async function turnProcessProbe() {try {// One disclosure per turn: the Bash rows are rows inside the turn's process,// not siblings of it, so a long turn collapses in one gesture.- render(mixed);+ render(mixed, true, null, "settling-activity-group");const bash1Row = row("bash1");const bash2Row = row("bash2");check(Boolean(bash1Row) && Boolean(bash2Row), "both adjacent Bash rows render");@@ -216,7 +216,24 @@ export async function turnProcessProbe() {i18n.t("chat.processTools", { count: 5 }),"the process header counts every tool once",);- check(allCollapsed(), "the completed process starts fully collapsed");+ const activeGroupHeader = row("read")?.closest<HTMLElement>(+ ".process-activity-group.grouped",+ )?.querySelector<HTMLElement>(".tool-activity-header");+ check(+ activeGroupHeader?.getAttribute("aria-expanded") === "true",+ "the active small activity group starts open",+ );+ render(mixed, false, null, "settling-activity-group");+ const completedGroupHeader = row("read")?.closest<HTMLElement>(+ ".process-activity-group.grouped",+ )?.querySelector<HTMLElement>(".tool-activity-header");+ check(+ processHeaders()[0]?.getAttribute("aria-expanded") === "false" &&+ [...container.querySelectorAll<HTMLElement>(".tool-row:not(.thinking) .tool-row-header")].every(+ (header) => header.getAttribute("aria-expanded") === "false",+ ),+ "the completed process and tool payload rows start closed",+ );check(!visible(bash1Row) && !visible(bash2Row),"Bash rows are revealed by the turn's process, not left outside it",@@ -232,6 +249,10 @@ export async function turnProcessProbe() {visible(bash1Row) && visible(bash2Row),"opening the process reveals the Bash rows",);+ check(+ visible(row("read")) && completedGroupHeader?.getAttribute("aria-expanded") === "true",+ "opening the process reveals the already-open activity group with its tool rows",+ );// Real geometry and hit testing: the turn title, a nested group title and a// Bash row share one left edge, and the collapse rail owns its gutter.@@ -285,7 +306,9 @@ export async function turnProcessProbe() {topRail !== null && railHit(topRail) === topRail,"the turn collapse rail owns its gutter hit target",);- click(nestedHeader);+ if (nestedHeader?.getAttribute("aria-expanded") !== "true") {+ click(nestedHeader);+ }const nestedBody = nestedHeader?.parentElement?.querySelector<HTMLElement>(":scope > .process-activity-body",) ?? null;@@ -609,6 +632,77 @@ export async function turnProcessProbe() {container.querySelector(".process-activity-group.grouped.open") !== null,"the merged group keeps its live disclosure default",);++ const earlierThinking = message("earlier-thinking", "assistant", "", {+ thinking: "Earlier reasoning remains available.",+ status: "complete",+ });+ const liveThinking = message("live-thinking", "assistant", "", {+ thinking: "Latest reasoning remains available.",+ status: "streaming",+ });+ const completedThinking = { ...liveThinking, status: "complete" as const };+ const thinkingAnswer = message("thinking-answer", "assistant", "Done.", {+ status: "complete",+ });+ render(+ [earlierThinking, read, liveThinking, thinkingAnswer],+ true,+ null,+ "fully-folded-thinking-settlement",+ );+ const liveThinkingHeaders = [+ ...container.querySelectorAll<HTMLElement>(".tool-row.thinking .tool-row-header"),+ ];+ check(+ liveThinkingHeaders.length === 2 &&+ liveThinkingHeaders.every((header) => header.getAttribute("aria-expanded") === "true"),+ "fully folded expands each visible thinking row by default",+ );+ render(+ [earlierThinking, read, completedThinking, thinkingAnswer],+ false,+ null,+ "fully-folded-thinking-settlement",+ );+ check(+ processHeaders()[0]?.getAttribute("aria-expanded") === "false",+ "the completed process still starts closed",+ );+ click(processHeaders()[0] ?? null);+ const settledThinkingHeaders = [+ ...container.querySelectorAll<HTMLElement>(".tool-row.thinking .tool-row-header"),+ ];+ const settledThinkingGroupHeader = row("read")?.closest<HTMLElement>(+ ".process-activity-group.grouped",+ )?.querySelector<HTMLElement>(".tool-activity-header");+ check(+ settledThinkingGroupHeader?.getAttribute("aria-expanded") === "true" &&+ settledThinkingHeaders.length === 2 &&+ settledThinkingHeaders.every((header) => header.getAttribute("aria-expanded") === "true") &&+ container.textContent?.includes("Earlier reasoning remains available.") === true &&+ container.textContent?.includes("Latest reasoning remains available.") === true &&+ row("read")?.querySelector<HTMLElement>(".tool-row-header")?.getAttribute("aria-expanded") === "false",+ "reopening the process reveals the open group and reasoning while tool payloads stay collapsed",+ );++ const largeGroup = Array.from({ length: 5 }, (_, index) =>+ tool(`large-group-${index}`, "Read", { toolResult: `result ${index}` }),+ );+ render(+ [...largeGroup, thinkingAnswer],+ false,+ null,+ "large-completed-activity-group",+ );+ const largeGroupHeader = row("large-group-0")?.closest<HTMLElement>(+ ".process-activity-group.grouped",+ )?.querySelector<HTMLElement>(".tool-activity-header");+ click(processHeaders()[0] ?? null);+ check(+ largeGroupHeader?.getAttribute("aria-expanded") === "false",+ "large activity groups remain collapsed by default",+ );setSettings();// The header reports the turn's outcome, never the item it is working on.