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(transcript): fold settled groups and reasoning, and name what a group did
v_wyxgwangc2f3845ca01e
diff --git a/apps/desktop/electron/main/runtime/provider-catalog.ts b/apps/desktop/electron/main/runtime/provider-catalog.tsindex 4c48580ec..1875a6b2a 100644--- a/apps/desktop/electron/main/runtime/provider-catalog.ts+++ b/apps/desktop/electron/main/runtime/provider-catalog.ts@@ -184,6 +184,10 @@ export function createProviderCatalogRuntime({(value as T & { transcriptDisplayMode?: unknown }).transcriptDisplayMode === "fully-folded"? (value as T & { transcriptDisplayMode?: unknown }).transcriptDisplayMode: "fully-folded",+ autoCollapseSettledGroups:+ (value as T & { autoCollapseSettledGroups?: unknown }).autoCollapseSettledGroups !== false,+ autoCollapseThinking:+ (value as T & { autoCollapseThinking?: unknown }).autoCollapseThinking !== false,radialMenu: normalizeRadialMenuPreferences(value.radialMenu),defaultCommandShell: isCommandShellId(value.defaultCommandShell)? value.defaultCommandShell@@ -208,6 +212,8 @@ export function createProviderCatalogRuntime({startupAnimation?: unknown;transcriptDisplayMode?: unknown;radialMenu?: unknown;+ autoCollapseSettledGroups?: unknown;+ autoCollapseThinking?: unknown;};if (Object.prototype.hasOwnProperty.call(value, "defaultCommandShell") &&@@ -259,6 +265,22 @@ export function createProviderCatalogRuntime({errorCode: ErrorCodes.INVALID_PARAMS,});}+ if (+ Object.prototype.hasOwnProperty.call(value, "autoCollapseSettledGroups") &&+ typeof value.autoCollapseSettledGroups !== "boolean"+ ) {+ throw Object.assign(new Error("autoCollapseSettledGroups is invalid"), {+ errorCode: ErrorCodes.INVALID_PARAMS,+ });+ }+ if (+ Object.prototype.hasOwnProperty.call(value, "autoCollapseThinking") &&+ typeof value.autoCollapseThinking !== "boolean"+ ) {+ throw Object.assign(new Error("autoCollapseThinking is invalid"), {+ errorCode: ErrorCodes.INVALID_PARAMS,+ });+ }if (Object.prototype.hasOwnProperty.call(value, "macosWindowTranslucency") &&typeof value.macosWindowTranslucency !== "boolean"diff --git a/apps/desktop/src/components/settings/TranscriptFoldingRows.tsx b/apps/desktop/src/components/settings/TranscriptFoldingRows.tsxnew file mode 100644index 000000000..cd6ed924d--- /dev/null+++ b/apps/desktop/src/components/settings/TranscriptFoldingRows.tsx@@ -0,0 +1,75 @@+import { useTranslation } from "react-i18next";+import type { AppSettings } from "@pi-desktop/shared";+import { resolveShowThinking } from "../../lib/thinking-visibility";+import { resolveTranscriptDisplayMode } from "../../lib/transcript-display-mode";+import {+ resolveAutoCollapseSettledGroups,+ resolveAutoCollapseThinking,+} from "../../lib/transcript-folding";+import { SettingsRow } from "../../features/settings/primitives";+import { SettingsToggle } from "../ui";++/*+ * The two switches behind a folded transcript (issue #2094).+ *+ * Both are sub-rows: each one only makes sense while the row above it is+ * offering content to fold. Hiding a sub-row never writes a value, so a reader+ * who turns `Show thinking` off and on again, or switches to the flat layout and+ * back, finds the choice they made still in place.+ */++/** Fold reasoning that is no longer streaming. */+export function AutoCollapseThinkingRow({+ settings,+ saveSettings,+}: {+ settings: AppSettings;+ saveSettings: (patch: Partial<AppSettings>) => Promise<void>;+}) {+ const { t } = useTranslation();+ // With `Show thinking` off no completed reasoning renders at all, so the+ // switch would have nothing to act on.+ if (!resolveShowThinking(settings)) return null;+ const collapse = resolveAutoCollapseThinking(settings);+ return (+ <SettingsRow+ nested+ title={t("settings.autoCollapseThinking")}+ description={t("settings.autoCollapseThinkingDesc")}+ >+ <SettingsToggle+ checked={collapse}+ label={t("settings.autoCollapseThinking")}+ onChange={() => void saveSettings({ autoCollapseThinking: !collapse })}+ />+ </SettingsRow>+ );+}++/** Fold activity groups that are no longer running. */+export function AutoCollapseSettledGroupsRow({+ settings,+ saveSettings,+}: {+ settings: AppSettings;+ saveSettings: (patch: Partial<AppSettings>) => Promise<void>;+}) {+ const { t } = useTranslation();+ // The flat layout renders rows without activity groups, so the switch has no+ // effect there; hiding it keeps the settings page honest about the mode.+ if (resolveTranscriptDisplayMode(settings) === "flat") return null;+ const collapse = resolveAutoCollapseSettledGroups(settings);+ return (+ <SettingsRow+ nested+ title={t("settings.autoCollapseSettledGroups")}+ description={t("settings.autoCollapseSettledGroupsDesc")}+ >+ <SettingsToggle+ checked={collapse}+ label={t("settings.autoCollapseSettledGroups")}+ onChange={() => void saveSettings({ autoCollapseSettledGroups: !collapse })}+ />+ </SettingsRow>+ );+}diff --git a/apps/desktop/src/features/chat/transcript/ActivityGroup.tsx b/apps/desktop/src/features/chat/transcript/ActivityGroup.tsxindex 59a5bc9f4..254c9d1d4 100644--- a/apps/desktop/src/features/chat/transcript/ActivityGroup.tsx+++ b/apps/desktop/src/features/chat/transcript/ActivityGroup.tsx@@ -56,6 +56,10 @@ import {import { TranscriptSearchContext } from "../../../lib/transcript-search-context";import { useAppStore } from "../../../stores/app-store";import { resolveShowThinking } from "../../../lib/thinking-visibility";+import {+ resolveAutoCollapseSettledGroups,+ resolveAutoCollapseThinking,+} from "../../../lib/transcript-folding";import { resolveTranscriptDisplayMode } from "../../../lib/transcript-display-mode";type Translate = (key: string, options?: Record<string, unknown>) => string;@@ -208,6 +212,8 @@ export const ActivityGroup = memo(function ActivityGroup({const showThinking = useAppStore((state) => resolveShowThinking(state.settings));const hideThinking = !showThinking;const displayMode = useAppStore((state) => resolveTranscriptDisplayMode(state.settings));+ const collapseSettledGroups = useAppStore((state) => resolveAutoCollapseSettledGroups(state.settings));+ const collapseThinking = useAppStore((state) => resolveAutoCollapseThinking(state.settings));const { t } = useTranslation();const detailsId = useId();const rawDelegateItems = useMemo(() => items.filter(isDelegationActivityItem), [items]);@@ -245,13 +251,17 @@ export const ActivityGroup = memo(function ActivityGroup({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.- // Work the turn still owns and reasoning the reader asked to see stay open;- // only a settled group of plain tool rows falls back to the size rule.- const automaticallyOpen = activityGroupStartsOpen(visibleItems, {- subagentTopology: hasSubagentTopology,+ // disclosure, so leaving a group open never reveals tool details.+ //+ // Live work stays visible; everything settled follows the reader's+ // `autoCollapseSettledGroups` preference. A group no longer inherits "open"+ // from the reasoning it contains - the group and its Thinking rows answer to+ // their own switch, and the group's header states what it holds, so folding it+ // hides no detail the reader needs to expand the group to discover.+ const automaticallyOpen = activityGroupStartsOpen({turnActive,groupActive: live,+ collapseSettled: collapseSettledGroups,});const disclosure = useAutomaticDisclosure(automaticallyOpen,@@ -332,6 +342,7 @@ export const ActivityGroup = memo(function ActivityGroup({delegateItems={delegateItems}delegationStatuses={delegationStatuses}delegationTimings={delegationTimings}+ collapseThinking={collapseThinking}onUserInteraction={claimDisclosure}/>;diff --git a/apps/desktop/src/features/chat/transcript/ActivityItems.tsx b/apps/desktop/src/features/chat/transcript/ActivityItems.tsxindex 55fb68979..6b3b68a86 100644--- a/apps/desktop/src/features/chat/transcript/ActivityItems.tsx+++ b/apps/desktop/src/features/chat/transcript/ActivityItems.tsx@@ -3,6 +3,7 @@ import type { AssistantActivityItem } from "../../../lib/assistant-turns";import { isDelegationActivityItem, type DelegationActivityItem, type SubagentOutcome, type SubagentTiming } from "../../../lib/subagent-topology";import { reviewChangeFromMessage } from "../../../lib/workspace-review";import { ReviewChangeCard } from "../../../components/ReviewChangeCard";+import { thinkingRowStartsOpen } from "../../../lib/activity-group-folding";import { ThinkingRow } from "./shared";import { HostedSearchRow } from "./HostedSearchRow";import { SubagentTopology } from "./SubagentDetail";@@ -23,6 +24,8 @@ type ActivityItemsProps = {delegationStatuses: ReadonlyMap<string, SubagentOutcome>;delegationTimings: ReadonlyMap<string, SubagentTiming>;onUserInteraction: () => void;+ /** `resolveAutoCollapseThinking`: folded reasoning stays folded by default. */+ collapseThinking: boolean;};type ActivityItemBlockProps = Omit<ActivityItemsProps, "items" | "delegateItems" | "delegationStatuses" | "delegationTimings"> & {@@ -36,6 +39,7 @@ type ActivityItemBlockProps = Omit<ActivityItemsProps, "items" | "delegateItems"const ActivityItemBlock = memo(function ActivityItemBlock({block, isActive, live, topologyItem,delegateItems, delegationStatuses, delegationTimings, onUserInteraction,+ collapseThinking,}: ActivityItemBlockProps) {return <>{block.items.map((item) => {// The topology predicate narrows to all tools, but a false result can still@@ -78,11 +82,15 @@ const ActivityItemBlock = memo(function ActivityItemBlock({streaming={isActive && item.message.status === "streaming"}onUserInteraction={onUserInteraction}/>;+ // Reasoning folds once it stops streaming, unless the reader turned+ // `autoCollapseThinking` off; the row keeps its own explicit choice either+ // way.+ const streaming = isActive && item.message.status === "streaming";return <ThinkingRowkey={`thinking-${item.message.id}`}message={item.message}- streaming={isActive && item.message.status === "streaming"}- autoOpen+ streaming={streaming}+ autoOpen={thinkingRowStartsOpen({ streaming, collapseSettled: collapseThinking })}onUserInteraction={onUserInteraction}/>;})}</>;@@ -103,6 +111,7 @@ export const ActivityItems = memo(function ActivityItems({ items, ...context }:delegationStatuses={ownsTopology ? context.delegationStatuses : undefined}delegationTimings={ownsTopology ? context.delegationTimings : undefined}onUserInteraction={context.onUserInteraction}+ collapseThinking={context.collapseThinking}/>;})}</>;});diff --git a/apps/desktop/src/features/chat/transcript/AssistantTurn.tsx b/apps/desktop/src/features/chat/transcript/AssistantTurn.tsxindex 5c85a3700..3ce11cb7d 100644--- a/apps/desktop/src/features/chat/transcript/AssistantTurn.tsx+++ b/apps/desktop/src/features/chat/transcript/AssistantTurn.tsx@@ -409,7 +409,6 @@ export const AssistantTurn = memo(function AssistantTurn({turnParts={entry.parts}visibleSteps={visibleSteps}isActive={isActive}- delegationStatuses={turnDelegationStatuses}failed={summary.hasError}activity={runtimeActivity}>diff --git a/apps/desktop/src/features/chat/transcript/ProcessActivityGroup.tsx b/apps/desktop/src/features/chat/transcript/ProcessActivityGroup.tsxindex 4739eeb18..2d2a9bff9 100644--- a/apps/desktop/src/features/chat/transcript/ProcessActivityGroup.tsx+++ b/apps/desktop/src/features/chat/transcript/ProcessActivityGroup.tsx@@ -1,8 +1,13 @@import { useId, useMemo, type ReactNode } from "react";import { useTranslation } from "react-i18next";import type { AssistantActivityItem } from "../../../lib/assistant-turns";+import {+ activityBucketPhrase,+ activityLabelBuckets,+ activityOpsText,+} from "../../../lib/activity-group-label";import { cachedActivitySummary } from "../../../lib/transcript-activity-summary";-import { IconChevronRight, IconCircleAlert, IconSparkles } from "../../../components/icons";+import { IconChevronRight, IconSparkles } from "../../../components/icons";import { DisclosureCollapseRail } from "./shared";import { DisclosureScope, type useAutomaticDisclosure } from "./disclosure";@@ -26,7 +31,18 @@ export function ProcessActivityGroup({// choice itself survives so reopening the process restores it.const parentVisible = disclosure.parentVisible;const open = (!grouped || disclosure.open) && parentVisible;- const summary = useMemo(() => cachedActivitySummary(items), [items]);+ // A folded group is one line, so the line has to state what the group did and+ // how much of it: the composition phrase and the operation count are separate+ // values so the count can never be the part that gets ellipsized away.+ // Failures are not repeated here - the tool row that failed already says so.+ const { phrase, ops } = useMemo(() => {+ const summary = cachedActivitySummary(items);+ const { named, hidden } = activityLabelBuckets(summary.buckets);+ return {+ phrase: activityBucketPhrase(named, hidden, t),+ ops: activityOpsText(summary.tools, summary.thinking, t),+ };+ }, [items, t]);if (items.length === 0) return null;return (<div className={`process-activity-group${grouped ? " grouped" : " singleton"}${open ? " open" : ""}`}>@@ -41,19 +57,16 @@ export function ProcessActivityGroup({><span className="tool-activity-icon" aria-hidden><IconSparkles size={14} /></span><span className={`tool-activity-label${active ? " running" : ""}`}>- {t(summary.label, { count: summary.count })}+ {phrase}</span>{active ? <span className="activity-marker" aria-hidden /> : null}- {summary.thinking > 0 && summary.tools > 0 ? (- <span className="tool-activity-count">{t("chat.activityIncludesThinking")}</span>+ {ops ? (+ <>+ <span className="turn-sep" aria-hidden>·</span>+ <span className="tool-activity-count tool-activity-ops">{ops}</span>+ </>) : null}{active ? <span className="tool-activity-count">{t("chat.running")}</span> : null}- {summary.issues > 0 ? (- <span className="activity-issue-count">- <IconCircleAlert size={14} aria-hidden />- <span>{t("chat.activityFailures", { count: summary.issues })}</span>- </span>- ) : null}<span className="tool-activity-caret" aria-hidden><IconChevronRight size={12} /></span></button>) : null}diff --git a/apps/desktop/src/features/chat/transcript/TurnProcess.tsx b/apps/desktop/src/features/chat/transcript/TurnProcess.tsxindex fdd6cc797..eaccb09de 100644--- a/apps/desktop/src/features/chat/transcript/TurnProcess.tsx+++ b/apps/desktop/src/features/chat/transcript/TurnProcess.tsx@@ -1,4 +1,3 @@-import type { SubagentOutcome } from "../../../lib/subagent-topology";import { useContext, useEffect, useId, useMemo, useState, type ReactNode } from "react";import { useTranslation } from "react-i18next";import type { AgentActivity } from "@pi-desktop/shared";@@ -58,7 +57,6 @@ export function TurnProcess({processParts,turnParts,visibleSteps,- delegationStatuses,isActive,failed,activity,@@ -74,7 +72,6 @@ export function TurnProcess({failed: boolean;/** Live runtime stage, when the runtime reports one. */activity?: AgentActivity;- delegationStatuses?: ReadonlyMap<string, SubagentOutcome>;children: ReactNode;}) {const { t } = useTranslation();@@ -82,8 +79,8 @@ export function TurnProcess({const revealRequest = useMemo(() => search && processContainsMessage(processParts, search.messageId)? search.requestId : undefined, [processParts, search]);const summary = useMemo(() => cachedActivitySummary(- processParts.flatMap((part) => part.kind === "activity" ? part.items : []), delegationStatuses,- ), [processParts, delegationStatuses]);+ processParts.flatMap((part) => part.kind === "activity" ? part.items : []),+ ), [processParts]);const thinkingNow = useMemo(() => isTurnThinking(turnParts, isActive), [turnParts, isActive]);// Active processes start open and untouched completed ones close by default;// an explicit user choice stays authoritative. This does not depend on thediff --git a/apps/desktop/src/features/settings/SettingsPage.tsx b/apps/desktop/src/features/settings/SettingsPage.tsxindex 59f8262c2..c319a352a 100644--- a/apps/desktop/src/features/settings/SettingsPage.tsx+++ b/apps/desktop/src/features/settings/SettingsPage.tsx@@ -38,6 +38,10 @@ import { KeyboardShortcutsSection } from "../../components/settings/KeyboardShorimport { FontFamilyRow } from "../../components/settings/FontFamilyRow";import { ShowThinkingRow } from "../../components/settings/ShowThinkingRow";import { TranscriptDisplayModeRow } from "../../components/settings/TranscriptDisplayModeRow";+import {+ AutoCollapseSettledGroupsRow,+ AutoCollapseThinkingRow,+} from "../../components/settings/TranscriptFoldingRows";import { RadialMenuSettings } from "../../components/settings/RadialMenuSettings";import { FontSizeRow } from "../../components/settings/FontSizeRow";import { LanguageRow } from "../../components/settings/LanguageRow";@@ -570,7 +574,9 @@ export function SettingsPage() {<CommandShellRow settings={settings} saveSettings={saveSettings} /><LinkOpenTargetRow settings={settings} saveSettings={saveSettings} /><ShowThinkingRow settings={settings} saveSettings={saveSettings} />+ <AutoCollapseThinkingRow settings={settings} saveSettings={saveSettings} /><TranscriptDisplayModeRow settings={settings} saveSettings={saveSettings} />+ <AutoCollapseSettledGroupsRow settings={settings} saveSettings={saveSettings} /><ContextUsageDisplayRowsettings={settings}saveSettings={saveSettings}diff --git a/apps/desktop/src/features/settings/primitives.tsx b/apps/desktop/src/features/settings/primitives.tsxindex 0df8482d4..52dc47582 100644--- a/apps/desktop/src/features/settings/primitives.tsx+++ b/apps/desktop/src/features/settings/primitives.tsx@@ -29,6 +29,7 @@ export function SettingsRow({title,description,detail,+ nested = false,children,}: {title: string;@@ -37,9 +38,15 @@ export function SettingsRow({/** Live row metadata that stays visible (not an explanation). */detail?: ReactNode;children: ReactNode;+ /**+ * A row that only exists while the row above it is on. It indents one step and+ * keeps its own control, so the dependency is visible without a second+ * explanation, and hiding it must never rewrite the value it holds.+ */+ nested?: boolean;}) {return (- <div className="settings-row">+ <div className={nested ? "settings-row settings-row-nested" : "settings-row"}><div className="settings-row-copy"><div className="settings-row-title">{title}diff --git a/apps/desktop/src/lib/activity-group-folding.ts b/apps/desktop/src/lib/activity-group-folding.tsindex 92350eff7..14fa65d3e 100644--- a/apps/desktop/src/lib/activity-group-folding.ts+++ b/apps/desktop/src/lib/activity-group-folding.ts@@ -1,36 +1,38 @@-import type { AssistantActivityItem } from "./assistant-turns";--/** A settled ordinary group stays open up to this many visible rows. */-export const ACTIVITY_GROUP_AUTO_OPEN_MAX_ITEMS = 4;--/**- * Whether a rendered activity group starts open.+/*+ * Folding defaults for the two nested levels of a turn's process.+ *+ * A turn's process disclosure is one level; the activity groups and the+ * Thinking rows inside it are the two levels below. Each level answers only its+ * own question here; the disclosure machinery combines this default with the+ * reader's explicit choice, the parent's visibility, and transient reading+ * protection (see `disclosure.tsx`).*- * Folding is decided once per state, not per row: work the turn still owns stays- * visible, reader-requested reasoning stays visible, and only a settled group of- * plain tool rows falls back to the small-group rule. Explicit user choices are- * applied on top of this default and are never derived from it.+ * Live work always stays visible. Everything else is settled, and the reader's+ * preference decides: by default a completed turn folds both levels, so opening+ * it reads as a compact list of what the agent did rather than a wall of rows.+ * Size is deliberately not part of either rule - the old "groups of up to four+ * rows stay open" tier was the reason `Show thinking` and small groups looked+ * permanently expanded, and it is replaced by the two switches.*/-export function activityGroupStartsOpen(- visibleItems: readonly AssistantActivityItem[],- state: {- /** Task fan-out is its own topology and keeps its released open default. */- subagentTopology: boolean;- /** The assistant turn is still running. */- turnActive: boolean;- /** This group still owns live work, including running delegations. */- groupActive: boolean;- },-): boolean {- // `visibleItems` already excludes reasoning hidden by the preference, so a- // remaining Thinking row is content the reader asked to see. Folding it away- // would make `Show thinking` look broken.- const visibleReasoning = visibleItems.some((item) => item.kind === "thinking");- return (- state.subagentTopology ||- state.turnActive ||- state.groupActive ||- visibleReasoning ||- visibleItems.length <= ACTIVITY_GROUP_AUTO_OPEN_MAX_ITEMS- );++/** Whether a rendered activity group starts open. */+export function activityGroupStartsOpen(state: {+ /** The assistant turn this group belongs to is still running. */+ turnActive: boolean;+ /** This group still owns live work, including running delegations. */+ groupActive: boolean;+ /** `resolveAutoCollapseSettledGroups` for the current settings. */+ collapseSettled: boolean;+}): boolean {+ return state.turnActive || state.groupActive || !state.collapseSettled;+}++/** Whether a rendered Thinking row starts open. */+export function thinkingRowStartsOpen(state: {+ /** The live turn is still producing this row's reasoning. */+ streaming: boolean;+ /** `resolveAutoCollapseThinking` for the current settings. */+ collapseSettled: boolean;+}): boolean {+ return state.streaming || !state.collapseSettled;}diff --git a/apps/desktop/src/lib/activity-group-label.ts b/apps/desktop/src/lib/activity-group-label.tsnew file mode 100644index 000000000..d383ca066--- /dev/null+++ b/apps/desktop/src/lib/activity-group-label.ts@@ -0,0 +1,127 @@+import type { ToolAction } from "./tool-display";++/*+ * The header of an activity group says what the group did.+ *+ * A folded group is a single line, so "12 tool actions" cannot be the whole+ * story: the reader has to know whether the agent searched, read, edited, or ran+ * commands without opening the group. The label therefore names the actions the+ * group actually contains, joined with the locales' own list wording, and+ * appends the call count as a separate token.+ *+ * Only three actions are named. Naming all of them does not fit a transcript+ * band, and the four most common mixes are already unreadable at 320px; beyond+ * three the label says "and more" and the group itself carries the detail.+ */++/** Reasoning plus the tool actions, in the order a label lists them. */+export type ActivityBucketId = "thinking" | ToolAction;++/**+ * Reading order, not priority.+ *+ * Reasoning leads because it is what the reader most often probes for, and+ * `run` sits after the file work so a Chinese label ends on a verb phrase+ * ("搜索、读取并执行命令") instead of starting the list with a command.+ */+export const ACTIVITY_BUCKET_ORDER: readonly ActivityBucketId[] = [+ "thinking",+ "search",+ "read",+ "list",+ "write",+ "edit",+ "run",+ "fetch",+ "fork",+ "delegate",+ "use",+ "todo",+];++/** Distinct actions a label names before it summarizes the rest. */+export const ACTIVITY_LABEL_MAX_BUCKETS = 3;++const BUCKET_LABEL_KEYS: Record<ActivityBucketId, string> = {+ thinking: "chat.activityBucket.thinking",+ search: "chat.activityBucket.search",+ read: "chat.activityBucket.read",+ list: "chat.activityBucket.list",+ write: "chat.activityBucket.write",+ edit: "chat.activityBucket.edit",+ run: "chat.activityBucket.run",+ fetch: "chat.activityBucket.fetch",+ fork: "chat.activityBucket.fork",+ delegate: "chat.activityBucket.delegate",+ use: "chat.activityBucket.use",+ todo: "chat.activityBucket.todo",+};++export type ActivityBucket = {+ id: ActivityBucketId;+ /** How many visible rows of this action the group contains. */+ count: number;+};++type Translate = (key: string, options?: Record<string, unknown>) => string;++function bucketRank(id: ActivityBucketId): number {+ return ACTIVITY_BUCKET_ORDER.indexOf(id);+}++/**+ * The actions a label names, plus how many distinct actions it leaves out.+ *+ * Selection ranks by call count so the busiest actions survive the three-name+ * cap, then renders in reading order. Renders can therefore only change+ * membership when an action enters or leaves the top three - a stream that keeps+ * incrementing one count never reorders the label.+ */+export function activityLabelBuckets(buckets: readonly ActivityBucket[]): {+ named: ActivityBucket[];+ hidden: number;+} {+ const present = buckets.filter((bucket) => bucket.count > 0);+ const ranked = [...present].sort(+ (left, right) => right.count - left.count || bucketRank(left.id) - bucketRank(right.id),+ );+ const named = ranked.slice(0, ACTIVITY_LABEL_MAX_BUCKETS);+ named.sort((left, right) => bucketRank(left.id) - bucketRank(right.id));+ return { named, hidden: ranked.length - named.length };+}++/** The localized "what it did" phrase, e.g. `搜索并读取文件`. */+export function activityBucketPhrase(+ named: readonly ActivityBucket[],+ hidden: number,+ t: Translate,+): string {+ const words = named.map((bucket) => t(BUCKET_LABEL_KEYS[bucket.id]));+ if (words.length === 0) return "";+ if (words.length === 1) return words[0];+ if (words.length === 2) {+ return t("chat.activityJoin.two", { a: words[0], b: words[1] });+ }+ const list = { a: words[0], b: words[1], c: words[2] };+ return hidden > 0+ ? t("chat.activityJoin.threeMore", list)+ : t("chat.activityJoin.three", list);+}++/**+ * The count token beside the phrase.+ *+ * Reasoning is not an operation, so it never enters this number: a group of+ * three thinking rows and nine reads states nine operations and still names the+ * reasoning in front of it. A group with nothing but reasoning counts steps+ * instead, because "0 operations" would be the only alternative.+ */+export function activityOpsText(+ tools: number,+ thinking: number,+ t: Translate,+): string {+ if (tools > 0) return t("chat.activityOps", { count: tools });+ if (thinking > 0) return t("chat.activityThinkingSteps", { count: thinking });+ return "";+}diff --git a/apps/desktop/src/lib/api.ts b/apps/desktop/src/lib/api.tsindex cb003fc31..5760bb432 100644--- a/apps/desktop/src/lib/api.ts+++ b/apps/desktop/src/lib/api.ts@@ -446,6 +446,8 @@ export function normalizeSettings(settings: AppSettings): AppSettings {transcriptDisplayMode: isTranscriptDisplayModeValue(settings.transcriptDisplayMode)? settings.transcriptDisplayMode: "fully-folded",+ autoCollapseSettledGroups: settings.autoCollapseSettledGroups !== false,+ autoCollapseThinking: settings.autoCollapseThinking !== false,defaultMode: normalizeMode((settings as { defaultMode?: unknown }).defaultMode),infiniteProviderRetry:(settings as { infiniteProviderRetry?: unknown }).infiniteProviderRetry === true,@@ -496,6 +498,22 @@ export function validateSettingsWrite(settings: AppSettings): AppSettings {errorCode: "INVALID_PARAMS",});}+ if (+ Object.prototype.hasOwnProperty.call(settings, "autoCollapseSettledGroups") &&+ typeof settings.autoCollapseSettledGroups !== "boolean"+ ) {+ throw Object.assign(new Error("autoCollapseSettledGroups is invalid"), {+ errorCode: "INVALID_PARAMS",+ });+ }+ if (+ Object.prototype.hasOwnProperty.call(settings, "autoCollapseThinking") &&+ typeof settings.autoCollapseThinking !== "boolean"+ ) {+ throw Object.assign(new Error("autoCollapseThinking is invalid"), {+ errorCode: "INVALID_PARAMS",+ });+ }const radialMenuProblem = radialMenuWriteError(settings.radialMenu);if (radialMenuProblem) {throw Object.assign(new Error(radialMenuProblem), {diff --git a/apps/desktop/src/lib/settings-search.ts b/apps/desktop/src/lib/settings-search.tsindex f8d0456cd..443caa29f 100644--- a/apps/desktop/src/lib/settings-search.ts+++ b/apps/desktop/src/lib/settings-search.ts@@ -139,6 +139,10 @@ export const SETTINGS_NAV: SettingsNavEntry[] = ["settings.showThinkingDesc","settings.transcriptDisplayMode","settings.transcriptDisplayModeDesc",+ "settings.autoCollapseThinking",+ "settings.autoCollapseThinkingDesc",+ "settings.autoCollapseSettledGroups",+ "settings.autoCollapseSettledGroupsDesc","settings.contextUsageDisplay","settings.contextUsageDisplayRemaining","settings.contextUsageDisplayUsed",diff --git a/apps/desktop/src/lib/transcript-activity-summary.ts b/apps/desktop/src/lib/transcript-activity-summary.tsindex 53efdea73..4b4c0490b 100644--- a/apps/desktop/src/lib/transcript-activity-summary.ts+++ b/apps/desktop/src/lib/transcript-activity-summary.ts@@ -1,60 +1,56 @@import type { UiMessage } from "@pi-desktop/shared";import type { AssistantActivityItem, AssistantTurnPart } from "./assistant-turns";-import { activityItemHasIssue } from "./activity-summary";+import {+ ACTIVITY_BUCKET_ORDER,+ type ActivityBucket,+ type ActivityBucketId,+} from "./activity-group-label";import { getToolAction } from "./tool-display";-import { isDelegationActivityItem, subagentOutcome, type SubagentOutcome } from "./subagent-topology";import { messageContentFacts } from "./transcript-summary";-const toolFacts = new WeakMap<UiMessage, { action: ReturnType<typeof getToolAction>; issue: boolean }>();-const outcomes = new WeakMap<UiMessage, {- fallback?: SubagentOutcome;- byStatuses: WeakMap<ReadonlyMap<string, SubagentOutcome>, SubagentOutcome>;-}>();+const actionCache = new WeakMap<UiMessage, ActivityBucketId>();-function cachedOutcome(message: UiMessage, statuses?: ReadonlyMap<string, SubagentOutcome>) {- let cache = outcomes.get(message);- if (!cache) {- cache = { byStatuses: new WeakMap() };- outcomes.set(message, cache);- }- const cached = statuses ? cache.byStatuses.get(statuses) : cache.fallback;+/** Which label bucket a tool row belongs to, cached per message. */+function cachedAction(message: UiMessage): ActivityBucketId {+ const cached = actionCache.get(message);if (cached) return cached;- const outcome = subagentOutcome(message, statuses);- if (statuses) cache.byStatuses.set(statuses, outcome);- else cache.fallback = outcome;- return outcome;+ // Every `ToolAction` is a bucket id, so the mapping is the identity.+ const action = getToolAction(message.toolName);+ actionCache.set(message, action);+ return action;}-/** Same labels/counts as activitySummary, with payload work keyed by message. */-export function cachedActivitySummary(items: readonly AssistantActivityItem[], statuses?: ReadonlyMap<string, SubagentOutcome>) {+/**+ * What a group or a whole turn did, in one scan.+ *+ * The counts behind the group header: rows per action (reasoning counted apart,+ * because it is not an operation), the operation total, and the reasoning total.+ * Payload reads are cached per message so a streaming tail only costs the row+ * that changed.+ */+export function cachedActivitySummary(items: readonly AssistantActivityItem[]): {+ /** Every action, in label reading order, zero counts included. */+ buckets: ActivityBucket[];+ tools: number;+ thinking: number;+} {+ const counts = new Map<ActivityBucketId, number>();let tools = 0;let thinking = 0;- let issues = 0;- let allRun = true;- let allSearch = true;for (const item of items) {- if (item.kind === "thinking") { thinking += 1; continue; }- tools += 1;- if (item.kind === "hostedSearch") {- allRun = false;- if (item.round.status === "failed") issues += 1;+ if (item.kind === "thinking") {+ thinking += 1;continue;}- let facts = toolFacts.get(item.message);- if (!facts) {- facts = { action: getToolAction(item.message.toolName), issue: activityItemHasIssue(item) };- toolFacts.set(item.message, facts);- }- allRun &&= facts.action === "run";- allSearch &&= facts.action === "search";- if (isDelegationActivityItem(item)) {- const outcome = cachedOutcome(item.message, statuses);- if (outcome === "failed" || outcome === "denied") issues += 1;- } else if (facts.issue) issues += 1;+ tools += 1;+ // A hosted search is a search even though it carries no tool name.+ const id = item.kind === "hostedSearch" ? "search" : cachedAction(item.message);+ counts.set(id, (counts.get(id) ?? 0) + 1);}return {- label: tools === 0 ? "chat.activityThinking" : allRun ? "chat.activityCommands" : allSearch ? "chat.activitySearches" : "chat.activityTools",- count: tools || thinking, tools, thinking, issues,+ buckets: ACTIVITY_BUCKET_ORDER.map((id) => ({ id, count: counts.get(id) ?? 0 })),+ tools,+ thinking,};}diff --git a/apps/desktop/src/lib/transcript-folding.ts b/apps/desktop/src/lib/transcript-folding.tsnew file mode 100644index 000000000..af892cd1e--- /dev/null+++ b/apps/desktop/src/lib/transcript-folding.ts@@ -0,0 +1,31 @@+import type { AppSettings } from "@pi-desktop/shared";++/*+ * Which levels of a settled turn fold themselves (issue #2094).+ *+ * Both preferences are opt-out on purpose: a completed turn should read as its+ * answer plus a compact list of what the agent did, and the two switches are+ * there for readers who would rather keep the rows open. Absent, invalid, and+ * `true` all mean "fold", so a settings file written before these fields+ * existed behaves the way the product ships today.+ */++/**+ * Whether a settled activity group folds itself.+ *+ * `false` means every settled group stays open - it is not "keep the old+ * size-based tier": the four-row rule that used to decide this is gone, because+ * a switch labelled "auto-collapse" must not still collapse something.+ */+export function resolveAutoCollapseSettledGroups(+ settings: AppSettings | undefined,+): boolean {+ return settings?.autoCollapseSettledGroups !== false;+}++/** Whether reasoning that is no longer being generated folds itself. */+export function resolveAutoCollapseThinking(+ settings: AppSettings | undefined,+): boolean {+ return settings?.autoCollapseThinking !== false;+}diff --git a/apps/desktop/src/styles/messages.css b/apps/desktop/src/styles/messages.cssindex 2dc30dc58..0c618cea8 100644--- a/apps/desktop/src/styles/messages.css+++ b/apps/desktop/src/styles/messages.css@@ -2339,6 +2339,15 @@white-space: nowrap;}+/*+ * The operation count beside a group label never truncates: the composition+ * phrase ellipsizes first, because "12 次操作" is the part that has to survive a+ * narrow band (see `.tool-activity-label`).+ */+.tool-activity-count.tool-activity-ops {+ flex: none;+}+/** Issue counts are inline metadata in an activity-group header, never a second* line of the row. The icon and its localized count stay on one centered linediff --git a/apps/desktop/src/styles/settings.css b/apps/desktop/src/styles/settings.cssindex 5fdf62f97..cd6e6d50f 100644--- a/apps/desktop/src/styles/settings.css+++ b/apps/desktop/src/styles/settings.css@@ -1132,6 +1132,15 @@background: var(--ds-tile);}+/*+ * A row that exists only because the row above it is on ("Show thinking",+ * "Transcript display") indents one step. It keeps the parent's tile surface, so+ * the pair reads as one setting with a condition instead of two siblings.+ */+.settings-row.settings-row-nested {+ margin-inline-start: 20px;+}+.settings-row-copy {min-width: 0;flex: 1;diff --git a/apps/desktop/test/activity-group-folding.test.mjs b/apps/desktop/test/activity-group-folding.test.mjsindex 159f22507..bf3d84065 100644--- a/apps/desktop/test/activity-group-folding.test.mjs+++ b/apps/desktop/test/activity-group-folding.test.mjs@@ -5,72 +5,171 @@ import { loadStyles } from "./helpers/styles.mjs";import { readTranscriptModule } from "./helpers/source-contracts.mjs";register(new URL("./helpers/ts-import-hooks.mjs", import.meta.url));-const { ACTIVITY_GROUP_AUTO_OPEN_MAX_ITEMS, activityGroupStartsOpen } = await import(++const { activityGroupStartsOpen, thinkingRowStartsOpen } = await import("../src/lib/activity-group-folding.ts");+const {+ ACTIVITY_LABEL_MAX_BUCKETS,+ activityBucketPhrase,+ activityLabelBuckets,+ activityOpsText,+} = await import("../src/lib/activity-group-label.ts");+const { catalogs } = await import("../../../packages/i18n/src/index.ts");+const { flattenCatalog } = await import("../../../packages/i18n/src/locale-info.ts");-const items = (count, kind = "tool") =>- Array.from({ length: count }, () => ({ kind }));-const settled = {- subagentTopology: false,- turnActive: false,- groupActive: false,-};+/** Minimal i18next stand-in: plural suffix, then `{{name}}` interpolation. */+function translator(catalog) {+ const copy = flattenCatalog(catalog);+ return (key, options = {}) => {+ const plural =+ options.count === undefined ? undefined : options.count === 1 ? "one" : "other";+ const template =+ (plural && copy[`${key}_${plural}`]) ??+ copy[`${key}_other`] ??+ copy[key] ??+ `!${key}`;+ return template.replace(/\{\{(\w+)\}\}/g, (_, name) => String(options[name] ?? ""));+ };+}-test("a settled group of plain tool rows follows the small-group rule", () => {- assert.equal(ACTIVITY_GROUP_AUTO_OPEN_MAX_ITEMS, 4);- assert.equal(activityGroupStartsOpen(items(4), settled), true);- assert.equal(activityGroupStartsOpen(items(5), settled), false);-});+const buckets = (...pairs) => pairs.map(([id, count]) => ({ id, count }));-test("work the turn still owns stays open regardless of group size", () => {+test("a settled group folds by default and follows the switch", () => {+ // The old size tier is gone: a two-row group and a twenty-row group answer the+ // same way, because the setting - not the row count - decides.+ for (const collapseSettled of [true]) {+ assert.equal(+ activityGroupStartsOpen({ turnActive: false, groupActive: false, collapseSettled }),+ false,+ );+ }assert.equal(- activityGroupStartsOpen(items(20), { ...settled, turnActive: true }),+ activityGroupStartsOpen({ turnActive: false, groupActive: false, collapseSettled: false }),true,- "an assistant turn that is still running keeps every group visible",+ "turning auto-collapse off keeps every settled group open",+ );+ assert.equal(ACTIVITY_LABEL_MAX_BUCKETS, 3);+});++test("live work never folds", () => {+ for (const collapseSettled of [true, false]) {+ assert.equal(+ activityGroupStartsOpen({ turnActive: true, groupActive: false, collapseSettled }),+ true,+ "a running turn keeps every group visible",+ );+ assert.equal(+ activityGroupStartsOpen({ turnActive: false, groupActive: true, collapseSettled }),+ true,+ "a group that still owns live work keeps its rows visible",+ );+ }+});++test("reasoning stays open only while the live turn is generating it", () => {+ assert.equal(thinkingRowStartsOpen({ streaming: true, collapseSettled: true }), true);+ assert.equal(thinkingRowStartsOpen({ streaming: false, collapseSettled: true }), false);+ assert.equal(thinkingRowStartsOpen({ streaming: false, collapseSettled: false }), true);+});++test("the group label names what the group did", () => {+ const t = translator(catalogs["zh-CN"]);+ const label = (entries, tools, thinking) => {+ const { named, hidden } = activityLabelBuckets(entries);+ return `${activityBucketPhrase(named, hidden, t)} · ${activityOpsText(tools, thinking, t)}`;+ };+ assert.equal(+ label(buckets(["search", 3], ["read", 9]), 12, 0),+ "搜索并读取文件 · 12 次操作",);+ assert.equal(label(buckets(["read", 9]), 9, 0), "读取文件 · 9 次操作");+ assert.equal(label(buckets(["run", 8]), 8, 0), "执行命令 · 8 次操作");assert.equal(- activityGroupStartsOpen(items(20), { ...settled, groupActive: true }),- true,- "a group that still owns live work keeps its rows visible",+ label(buckets(["thinking", 3], ["search", 3], ["read", 9]), 12, 3),+ "进行了思考、搜索并读取文件 · 12 次操作",+ "reasoning is named but never counted as an operation",);assert.equal(- activityGroupStartsOpen(items(20), { ...settled, subagentTopology: true }),- true,- "Task topology keeps its released open default",+ label(buckets(["thinking", 2]), 0, 2),+ "进行了思考 · 2 段",+ "a reasoning-only group counts steps instead of operations",);});-test("reasoning the reader asked to see never folds away", () => {+test("labels cap at three actions and summarize the rest", () => {+ const t = translator(catalogs["zh-CN"]);+ const phrase = (entries) => {+ const { named, hidden } = activityLabelBuckets(entries);+ return activityBucketPhrase(named, hidden, t);+ };assert.equal(- activityGroupStartsOpen([...items(20), { kind: "thinking" }], settled),- true,- "a visible Thinking row is reader-requested content",+ phrase(buckets(["search", 10], ["read", 9], ["edit", 8], ["run", 2])),+ "搜索、读取文件、编辑文件等",+ "the busiest three are named and the rest is summarized",+ );+ assert.equal(+ phrase(buckets(["run", 5], ["search", 1], ["read", 1], ["edit", 1])),+ "搜索、读取文件、执行命令等",+ "selection ranks by count, then renders in reading order",);- // Reasoning hidden by `Show thinking` never reaches this list, so a group of- // plain tool rows is still allowed to fold.- assert.equal(activityGroupStartsOpen(items(20), settled), false);+ // Counting up never reshuffles the label: membership is what changes it.+ assert.deepEqual(+ activityLabelBuckets(buckets(["read", 2], ["search", 1])).named.map((b) => b.id),+ activityLabelBuckets(buckets(["read", 7], ["search", 1])).named.map((b) => b.id),+ );+ assert.deepEqual(+ activityLabelBuckets(buckets(["read", 2], ["search", 1])).named.map((b) => b.id),+ ["search", "read"],+ );+ // A new action entering the top three is the only reordering event.+ assert.equal(activityOpsText(0, 0, t), "", "an empty group prints no count");});-test("issue counters stay on one inline line in the group header", async () => {- const [styles, groupSource] = await Promise.all([- loadStyles(),+test("every locale carries the label fragments the header composes", async () => {+ const { ACTIVITY_BUCKET_ORDER } = await import("../src/lib/activity-group-label.ts");+ for (const [locale, catalog] of Object.entries(catalogs)) {+ const t = translator(catalog);+ // Every action the classifier can produce must have a localized noun in+ // every shipped locale, or a group header would print a raw key.+ for (const id of ACTIVITY_BUCKET_ORDER) {+ const word = t(`chat.activityBucket.${id}`);+ assert.doesNotMatch(word, /!/, `${locale} is missing the "${id}" bucket label`);+ }+ const { named, hidden } = activityLabelBuckets(+ buckets(["thinking", 1], ["search", 2], ["read", 3], ["edit", 1]),+ );+ const phrase = activityBucketPhrase(named, hidden, t);+ assert.doesNotMatch(phrase, /!/, `${locale} is missing a bucket or join translation`);+ assert.equal(phrase.includes("{{"), false, `${locale} left an interpolation raw`);+ const ops = activityOpsText(12, 3, t);+ assert.doesNotMatch(ops, /!/, `${locale} is missing the operation count`);+ assert.equal(ops.includes("{{"), false, `${locale} left the count raw`);+ assert.equal(activityOpsText(0, 4, t).includes("!"), false, `${locale} lacks the step count`);+ }+});++test("the group header states composition and count and drops the issue badge", async () => {+ const [group, items, activityGroup, styles] = await Promise.all([readTranscriptModule("ProcessActivityGroup.tsx"),+ readTranscriptModule("ActivityItems.tsx"),+ readTranscriptModule("ActivityGroup.tsx"),+ loadStyles(),]);- assert.match(groupSource, /className="activity-issue-count"/);- assert.match(- groupSource,- /<IconCircleAlert size=\{14\} aria-hidden \/>\s*<span>\{t\("chat\.activityFailures"/,- );- const badge = styles.match(/\.activity-issue-count \{([^}]*)\}/)?.[1];- assert.ok(badge, "the activity issue counter has no layout rule");- assert.match(badge, /display:\s*inline-flex;/);- assert.match(badge, /align-items:\s*center;/);- assert.match(badge, /white-space:\s*nowrap;/);+ assert.match(group, /activityBucketPhrase\(/);+ assert.match(group, /activityOpsText\(/);+ assert.match(group, /className="tool-activity-count tool-activity-ops"/);+ // Failures stay on the tool row that failed; the group header repeats none.+ assert.doesNotMatch(group, /activity-issue-count/);+ assert.doesNotMatch(group, /activityFailures/);+ assert.doesNotMatch(group, /activityIncludesThinking/);+ // The count token is the part that never truncates.+ assert.match(styles, /\.tool-activity-count\.tool-activity-ops\s*\{[^}]*flex:\s*none;/);+ assert.match(styles, /\.tool-activity-label\s*\{[^}]*text-overflow:\s*ellipsis;/);+ // Both nested levels read their own switch; neither inherits the other.assert.match(- styles,- /\.activity-issue-count > span \{[^}]*text-overflow:\s*ellipsis;/,+ activityGroup,+ /activityGroupStartsOpen\(\{\s*turnActive,\s*groupActive: live,\s*collapseSettled: collapseSettledGroups,\s*\}\)/,);- // The top-level turn header still carries no issue count at all.- assert.doesNotMatch(styles, /\.turn-process-error/);+ assert.match(items, /autoOpen=\{thinkingRowStartsOpen\(\{ streaming, collapseSettled: collapseThinking \}\)\}/);});diff --git a/apps/desktop/test/thinking-ui.test.mjs b/apps/desktop/test/thinking-ui.test.mjsindex b71a4b9b6..5dc7e8ed7 100644--- a/apps/desktop/test/thinking-ui.test.mjs+++ b/apps/desktop/test/thinking-ui.test.mjs@@ -277,18 +277,18 @@ test("expanded assistant activity rails collapse their disclosures", () => {assert.match(stylesSource, /\.disclosure-collapse-rail:focus-visible\s*\{/);});-test("tool and search rows stay collapsed while thinking keeps its leaf default", () => {+test("tool and search rows stay collapsed while reasoning follows its own switch", () => {assert.match(transcriptDisclosureSource, /export function useAutomaticDisclosure\(/);assert.match(transcriptDisclosureSource, /revealRequest\?: number/);assert.match(transcriptDisclosureSource, /const currentOpen = useRef\(open\)/);assert.match(transcriptDisclosureSource, /const setManualOpen = useCallback/);assert.match(transcriptSource,- /const automaticallyOpen = activityGroupStartsOpen\(visibleItems, \{\s*subagentTopology: hasSubagentTopology,\s*turnActive,\s*groupActive: live,\s*\}\);/,+ /const automaticallyOpen = activityGroupStartsOpen\(\{\s*turnActive,\s*groupActive: live,\s*collapseSettled: collapseSettledGroups,\s*\}\);/,);assert.match(transcriptSource,- /<ThinkingRow[\s\S]*?\n\s*autoOpen\n/,+ /<ThinkingRow[\s\S]*?\n\s*autoOpen=\{thinkingRowStartsOpen\(/,);// 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 fffa6dcbe..23f81b073 100644--- a/apps/desktop/test/transcript-display-modes-ui.test.mjs+++ b/apps/desktop/test/transcript-display-modes-ui.test.mjs@@ -33,9 +33,9 @@ test("command-first and fully-folded use distinct process segmentation", () => {assert.match(turnProcessSource, /isStandaloneRunActivity\(item\)/);});-test("thinking rows expand by default in every transcript display mode", () => {+test("reasoning rows start open only while they are still streaming", () => {assert.doesNotMatch(activityGroupSource, /thinkingDefaultOpen/);- assert.match(activityItemsSource, /<ThinkingRow[\s\S]*?\n\s*autoOpen\n/);+ assert.match(activityItemsSource, /<ThinkingRow[\s\S]*?\n\s*autoOpen=\{thinkingRowStartsOpen\(/);});test("thinking collapsed state uses the whole-run TextShimmer, not a spinner", () => {diff --git a/apps/desktop/test/transcript-folding-settings.test.mjs b/apps/desktop/test/transcript-folding-settings.test.mjsnew file mode 100644index 000000000..d7a17c635--- /dev/null+++ b/apps/desktop/test/transcript-folding-settings.test.mjs@@ -0,0 +1,126 @@+import assert from "node:assert/strict";+import { readFile } from "node:fs/promises";+import { register } from "node:module";+import test from "node:test";+import { IPC } from "@pi-desktop/shared";++register(new URL("./helpers/ts-import-hooks.mjs", import.meta.url));++const renderer = await import("../src/lib/api.ts");+const { createProviderCatalogRuntime } = await import(+ "../electron/main/runtime/provider-catalog.ts"+);+const main = createProviderCatalogRuntime({ getHost: () => null, modelsDevCatalog: {} });+const { resolveAutoCollapseSettledGroups, resolveAutoCollapseThinking } = await import(+ "../src/lib/transcript-folding.ts"+);+const { SETTINGS_NAV } = await import("../src/lib/settings-search.ts");++const ROWS = new URL("../src/components/settings/TranscriptFoldingRows.tsx", import.meta.url);+const PAGE = new URL("../src/features/settings/SettingsPage.tsx", import.meta.url);++function withWindow(run) {+ const previous = globalThis.window;+ globalThis.window = { piDesktop: { platform: "win32" } };+ try {+ return run();+ } finally {+ if (previous === undefined) delete globalThis.window;+ else globalThis.window = previous;+ }+}++test("folding defaults are on; only an explicit false turns them off", () => {+ for (const settings of [+ undefined,+ {},+ { showThinking: true },+ { autoCollapseThinking: true },+ { autoCollapseSettledGroups: true },+ ]) {+ assert.equal(resolveAutoCollapseThinking(settings), true);+ assert.equal(resolveAutoCollapseSettledGroups(settings), true);+ }+ assert.equal(resolveAutoCollapseThinking({ autoCollapseThinking: false }), false);+ assert.equal(resolveAutoCollapseSettledGroups({ autoCollapseSettledGroups: false }), false);+});++test("both settings boundaries default to on and keep an explicit false", () => {+ withWindow(() => {+ for (const stored of [+ {},+ { autoCollapseThinking: false },+ { autoCollapseSettledGroups: false },+ { autoCollapseThinking: false, autoCollapseSettledGroups: false },+ ]) {+ const received = structuredClone(main.normalizeSettings(stored));+ const displayed = renderer.normalizeSettings(received);+ assert.equal(displayed.autoCollapseThinking, stored.autoCollapseThinking !== false);+ assert.equal(+ displayed.autoCollapseSettledGroups,+ stored.autoCollapseSettledGroups !== false,+ );+ const persisted = main.validateSettingsWrite(+ structuredClone(renderer.validateSettingsWrite(displayed)),+ );+ assert.equal(persisted.autoCollapseThinking, stored.autoCollapseThinking !== false);+ assert.equal(+ persisted.autoCollapseSettledGroups,+ stored.autoCollapseSettledGroups !== false,+ );+ }+ });+});++test("non-boolean folding writes are rejected at both boundaries", () => {+ for (const field of ["autoCollapseThinking", "autoCollapseSettledGroups"]) {+ const settings = { theme: "light", [field]: "off" };+ assert.throws(+ () => renderer.validateSettingsWrite(settings),+ new RegExp(`${field} is invalid`),+ `the renderer must reject a non-boolean ${field}`,+ );+ assert.throws(+ () => main.validateSettingsWrite(settings),+ new RegExp(`${field} is invalid`),+ `the main process must reject a non-boolean ${field}`,+ );+ }+ assert.equal(typeof IPC, "object");+});++test("the two switches are sub-rows of the settings that gate them", async () => {+ const [rows, page] = await Promise.all([+ readFile(ROWS, "utf8"),+ readFile(PAGE, "utf8"),+ ]);+ // Hidden, never rewritten: the row bails out of rendering, so the stored value+ // survives turning `Show thinking` off or switching to the flat layout.+ assert.match(rows, /if \(!resolveShowThinking\(settings\)\) return null;/);+ assert.match(rows, /if \(resolveTranscriptDisplayMode\(settings\) === "flat"\) return null;/);+ assert.match(rows, /<SettingsRow\s*\n\s*nested/);+ assert.equal(+ rows.match(/saveSettings\(/g)?.length,+ 2,+ "only the two toggles write, so hiding a row can never persist a default",+ );+ const showThinkingAt = page.indexOf("<ShowThinkingRow");+ const thinkingAt = page.indexOf("<AutoCollapseThinkingRow");+ assert.ok(showThinkingAt >= 0 && thinkingAt > showThinkingAt);+ const modeAt = page.indexOf("<TranscriptDisplayModeRow");+ const groupsAt = page.indexOf("<AutoCollapseSettledGroupsRow");+ assert.ok(modeAt >= 0 && groupsAt > modeAt);+});++test("both switches are searchable inside the AI preferences", () => {+ const ai = SETTINGS_NAV.find((entry) => entry.id === "ai");+ assert.ok(ai);+ for (const key of [+ "settings.autoCollapseThinking",+ "settings.autoCollapseThinkingDesc",+ "settings.autoCollapseSettledGroups",+ "settings.autoCollapseSettledGroupsDesc",+ ]) {+ assert.ok(ai.keywordKeys.includes(key), `${key} is not indexed`);+ }+});diff --git a/apps/desktop/test/transcript-summary.test.mjs b/apps/desktop/test/transcript-summary.test.mjsindex 4062790ae..4066a85ea 100644--- a/apps/desktop/test/transcript-summary.test.mjs+++ b/apps/desktop/test/transcript-summary.test.mjs@@ -109,7 +109,12 @@ test("activity summary and compact visibility preserve error, search and thinkin{ kind: "hostedSearch", message: message("search", ""), round: { id: "r", status: "failed" } },];for (const subset of [[], items, items.slice(0, 1), items.slice(2, 4), items.slice(4)]) {- assert.deepEqual(cachedActivitySummary(subset), activitySummary(subset));+ const cached = cachedActivitySummary(subset);+ const legacy = activitySummary(subset);+ // The cached summary is the production path; the legacy helper still owns+ // the row counts it always reported, and nothing else is shared any more.+ assert.equal(cached.tools, legacy.tools);+ assert.equal(cached.thinking, legacy.thinking);for (const compact of [false, true]) for (const active of [false, true]) {assert.deepEqual(cachedVisibleActivityItems(subset, compact, active), visibleActivityItems(subset, compact, active));const parts = [{ kind: "activity", items: subset }, { kind: "message", message: message("progress", "progress") }];@@ -141,8 +146,11 @@ test("text and delegate-child changes keep tool inputs stable; cross-part TaskWaconst timings = collectDelegationTimings(inputs);assert.equal(statuses.get("d"), "failed");assert.deepEqual(delegationTimingBounds([task], timings), { startedAt: 1000, completedAt: 6000 });- assert.deepEqual(cachedActivitySummary([task], statuses), activitySummary([task], statuses));- assert.equal(cachedActivitySummary([task], statuses).issues, 1);+ assert.equal(cachedActivitySummary([task]).tools, 1);+ assert.deepEqual(+ cachedActivitySummary([task]).buckets.filter((bucket) => bucket.count > 0),+ [{ id: "delegate", count: 1 }],+ );assert.equal(collectDelegationStatuses(getAssistantTurnSummary(first).toolItems, { turnLive: false }).get("d"), "aborted");});diff --git a/apps/desktop/test/turn-process.test.mjs b/apps/desktop/test/turn-process.test.mjsindex 22b92ec32..a6679b844 100644--- a/apps/desktop/test/turn-process.test.mjs+++ b/apps/desktop/test/turn-process.test.mjs@@ -554,9 +554,16 @@ test("the header count comes from the production activity summary", () => {);const summary = cachedActivitySummary(items);assert.equal(summary.tools, 4);- assert.equal(summary.count, 4);- assert.equal(summary.issues, 0);- assert.equal(summary.label, "chat.activityTools");+ assert.equal(summary.thinking, 0);+ // The header names the actions the group contains, in reading order.+ assert.deepEqual(+ summary.buckets.filter((bucket) => bucket.count > 0),+ [+ { id: "search", count: 1 },+ { id: "read", count: 1 },+ { id: "run", count: 2 },+ ],+ );const bashOnly = turn([message("user", "user", "Run"),tool("bash1", "Bash", { toolArgs: { command: "a" } }),@@ -566,7 +573,10 @@ test("the header count comes from the production activity summary", () => {part.kind === "activity" ? part.items : [],);assert.equal(cachedActivitySummary(bashItems).tools, 2);- assert.equal(cachedActivitySummary(bashItems).label, "chat.activityCommands");+ assert.deepEqual(+ cachedActivitySummary(bashItems).buckets.filter((bucket) => bucket.count > 0),+ [{ id: "run", count: 2 }],+ );});test("the shared process-step helper counts message rows and hides content-backed thinking", () => {diff --git a/crates/host-core/src/config_sync/domains.rs b/crates/host-core/src/config_sync/domains.rsindex 7c5d09df6..70a1ed904 100644--- a/crates/host-core/src/config_sync/domains.rs+++ b/crates/host-core/src/config_sync/domains.rs@@ -37,6 +37,8 @@ pub(crate) const PORTABLE_APPLICATION_FIELDS: &[&str] = &["thinkingDisplayMode","transcriptDisplayMode","keepCommandsExpanded",+ "autoCollapseSettledGroups",+ "autoCollapseThinking","enterToSend","largePasteThreshold","defaultProviderId",@@ -105,6 +107,8 @@ pub const DOMAIN_ADAPTERS: &[DomainAdapterSpec] = &["transcriptDisplayMode","enterToSend","keepCommandsExpanded",+ "autoCollapseSettledGroups",+ "autoCollapseThinking","keybindings","display bindings","provider/model bindings",diff --git a/docs/adr/turn-process-and-thinking-display.md b/docs/adr/turn-process-and-thinking-display.mdindex 71613afcc..bad056f07 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-22-- Issues: #510, #461, #1806+- Amended: 2026-10-22, 2026-11-04+- Issues: #510, #461, #1806, #2094- Amends: D071, [ADR 0242](0242-delta-only-streaming-updates.md)## Context@@ -70,7 +70,32 @@ groups with at most four visible items stay open, larger groups of plain toolrows start closed, and Task topology groups stay open. A group that still rendersa Thinking row stays open too: with `Show thinking` on the reasoning is contentthe reader asked to see. Tool, search and run-row payloads keep their own closed-defaults. Explicit user choices remain authoritative.+ defaults. Explicit user choices remain authoritative.++The 2026-11-04 amendment (`#2094`) replaces those settled defaults. A settled+turn now folds both nested levels: its activity groups and every Thinking row+that is no longer streaming start closed, so expanding a completed turn reads as+a list of headings. Two opt-out settings carry the choice.+`autoCollapseSettledGroups` (`Auto-fold finished groups`) folds settled groups+whatever their size, and when it is off every settled group stays open - the+four-item tier is retired, because a switch labelled auto-collapse must not still+collapse something. `autoCollapseThinking` (`Auto-fold finished thinking`) folds+completed reasoning, and when it is off every rendered reasoning row stays open.+Each is a sub-row of the setting that gates it (`Show thinking`, and a non-flat+`Transcript display`), and hiding a sub-row never writes a value, so the stored+choice survives toggling its parent or switching layouts. The group level no+longer inherits open state from the reasoning it contains: closing a group hides+expanded reasoning inside it, and reopening restores each row's own answer, so+the two levels never cancel each other out. Live work still never folds: a+running turn, or a group that still owns a running tool or delegation, stays+open. Because a folded group is a single line, its header now states the+composition instead of a generic count - the actions it contains, joined with the+locale's own list wording, capped at three with "and more", followed by the call+count as a separate token that ellipsizes last (`搜索并读取文件 · 12 次操作`).+Reasoning is named in that sequence but is not an operation, and a reasoning-only+group counts steps instead. The group header no longer renders an issue counter:+a failed call is reported by the row that failed, and repeating it on the group+added noise without adding information.The turn's disclosure header states the turn's outcome and carries only itsbounded metadata: status, recorded duration and direct tool/search count. It@@ -190,6 +215,13 @@ own bounded issue summaries.central workflow-store concern.- This groups loaded transcript entries only; it does not reconstruct unloadedhistory or join turns across compaction boundaries.+- A settled turn folds its groups and its finished reasoning by default, and the+ two new switches are the only way to keep them open. The four-item tier and the+ "reasoning keeps its group open" rule are gone, so the two levels cannot cancel+ each other out.+- A folded group header names the actions it contains and appends the operation+ count; reasoning is named but not counted, and a failure is left to the tool+ row that reports it.## Validation@@ -240,3 +272,13 @@ folding, transient reading protection, manual-choice locality and `Show thinkingbehavior in real Chromium. The same suite measures the activity issue counter'sinline layout at 320/800px and 100%/150% zoom in English and Simplified Chinese.See E2E-CHAT-turn-process-and-thinking-display.++For the 2026-11-04 amendment, `apps/desktop/test/activity-group-folding.test.mjs`+covers both settled defaults, the two switches, the group-label composition+(three-name cap, reading order, reasoning-only step count) in every shipped+locale, and the source contracts for the header tokens, the non-truncating count+and the removed issue badge; `apps/desktop/test/transcript-folding-settings.test.mjs`+covers the resolver defaults, normalization and write validation at both+boundaries, the sub-row gating and the settings-search index. The transcript+disclosure E2E suites were not run for this amendment; E2E-CHAT-turn-process-and-thinking-display+carries the synchronized scenario text for the integration candidate.diff --git a/docs/spec/04-ux/06-settings-ia.md b/docs/spec/04-ux/06-settings-ia.mdindex 8c421cc13..6d666241b 100644--- a/docs/spec/04-ux/06-settings-ia.md+++ b/docs/spec/04-ux/06-settings-ia.md@@ -330,8 +330,9 @@ Settings is a **full-window page** that replaces the app sidebar + main chrome (reasoning is actively streaming, leaves only the whole-run TextShimmer`Thinking` indicator; a collapsed row shows that indicator without an excerpt.Stored reasoning is retained and reappears when the toggle is turned back on.- With it on, Thinking rows default expanded in Flat and Commands first, while- Fully folded keeps the released live-only auto-open exception. It affects+ With it on, a Thinking row starts folded once it is no longer streaming; the row+ the live turn is still generating stays open, and the **Auto-fold finished+ thinking** sub-row below can keep every row open instead. It affectspresentation only, not model reasoning configuration, and it does not controlturn-process or activity-group folding: active processes start open anduntouched completed processes fold by default regardless of the toggle. The@@ -339,6 +340,14 @@ Settings is a **full-window page** that replaces the app sidebar + main chrome (for persisted-settings compatibility and is no longer exposed; an absent orunknown value shows reasoning and an explicit `compact` hides it. Settingssearch indexes the row.+- **Auto-fold finished thinking** is an indented sub-row directly under **Show+ thinking** and appears only while that toggle is on, because with it off no+ completed reasoning row renders. It persists the optional+ `autoCollapseThinking` boolean, absent and `true` both meaning fold: only+ reasoning the live turn is still streaming stays open. Turning it off keeps+ every rendered Thinking row open. Hiding the sub-row by turning **Show+ thinking** off never writes a value, so the stored choice survives and comes+ back with the parent. Settings search indexes both the row and its description.- **Transcript display** is a segmented control in Defaults immediately after**Show thinking**. It persists the optional `transcriptDisplayMode` field as`flat`, `command-first`, or `fully-folded`, with the labels **Flat**,@@ -356,6 +365,16 @@ Settings is a **full-window page** that replaces the app sidebar + main chrome (standard 240px field-column cap. Labels stay on one line; when space isinsufficient, the control moves below the title and whole options wrapwithin the available pane width without horizontal overflow.+- **Auto-fold finished groups** is an indented sub-row directly under+ **Transcript display**, and appears only for **Commands first** and **Fully+ folded**; **Flat** renders no activity groups, so the row is hidden there and+ has no effect. It persists the optional `autoCollapseSettledGroups` boolean,+ absent and `true` both meaning fold: a group whose turn has settled starts+ closed whatever its size, while a running turn, or a group that still owns a+ running tool or delegation, stays open. Turning it off leaves every settled+ group open - there is no size tier. Hiding the sub-row by switching to **Flat**+ never writes a value, so the stored choice survives and returns with the mode.+ Settings search indexes both the row and its description.- **Radial context menu** is a card in General after Sidebar with one switch(**Enable on the transcript background**) and four direction pickers(**Up**, **Right**, **Down**, **Left**). The switch is off whendiff --git a/docs/spec/04-ux/08-component-spec.md b/docs/spec/04-ux/08-component-spec.mdindex 6605ac57d..8a94841a9 100644--- a/docs/spec/04-ux/08-component-spec.md+++ b/docs/spec/04-ux/08-component-spec.md@@ -933,18 +933,27 @@ 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.-Every ordinary group of a turn stays open while that turn is active, whether or-not it still owns the live execution segment, so work never folds away mid-run.-After the turn settles, ordinary groups with at most four visible items remain-open, larger groups start closed, and Task topology groups remain open. A group-that still renders a Thinking row also remains open: with `Show thinking` on the-reasoning is content the reader asked to see, and folding the group around it-would make the setting look broken. These defaults are unified across modes and-otherwise 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 issue counter is one inline-non-wrapping chip whose icon and localized count share a centred line and-truncate together when the band runs out of width.+Every group of a turn stays open while that turn is active, whether or not it+still owns the live execution segment, so work never folds away mid-run. Once the+turn settles both nested levels fold: expanding a completed turn lists what the+agent did instead of a wall of rows, and two opt-out switches carry the reader's+choice. `Auto-fold finished groups` (`autoCollapseSettledGroups`, on by default)+folds settled groups whatever their size; turned off it leaves every settled+group open, because the four-item tier is retired. `Auto-fold finished thinking`+(`autoCollapseThinking`, on by default) keeps only reasoning the live turn is+still streaming expanded. Each switch is a sub-row of the setting that gates it+(`Show thinking`, and a non-flat `Transcript display`), it disappears with that+parent, and hiding it never rewrites the stored value. A group does not inherit+open state from the reasoning it contains: the group and its Thinking rows each+answer to their own switch, so closing a group hides expanded reasoning inside+it. Explicit user choices remain authoritative, and a running turn - or a group+that still owns a running tool or delegation - never folds. The group header+states what the group did: the actions it contains, joined with the locale's own+list wording and capped at three with "and more", followed by the call count as+its own non-truncating token (`搜索并读取文件 · 12 次操作`). Reasoning is named in+that sequence but never counted as an operation, and a reasoning-only group+counts steps instead. Failures are not repeated here: the tool row that failed+already reports them.The turn disclosure header states the turn's outcome and carries only its boundedmetadata: status, recorded duration and direct tool/search count. It never echoes@@ -965,12 +974,12 @@ collapse rail in that gutter. The rail stays invisible at rest, shows a 2px barhover or focus, and collapses the group when clicked. The outer turn fold adds noextra hierarchy.-Except for the display mode's Thinking default, no item payload opens itself: a-tool, hosted-search or plan call stays a header row until the user opens its+Except for `Auto-fold finished thinking`, no item payload opens itself: a tool,+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. Groups stay open while their turn runs; after it settles, small groups (up to-four visible items), Task topology groups and groups that still render a Thinking-row remain open, while larger ordinary groups of plain tool rows start closed.+it. Groups stay open while their turn runs and fold once it settles, so a+settled process reads as a list of headings that each state composition and+count.With `Show thinking` on, Thinking rows expand by default in every display mode andcollapse only on user action. An expanded Thinking row shows its full reasoningmarkdown; a collapsed one shows only the Thinking indicator, with no summary ordiff --git a/docs/spec/04-ux/09-interaction-patterns.md b/docs/spec/04-ux/09-interaction-patterns.mdindex 6411fccbd..8a84cc5b9 100644--- a/docs/spec/04-ux/09-interaction-patterns.md+++ b/docs/spec/04-ux/09-interaction-patterns.md@@ -1082,14 +1082,17 @@ may be retained while exactly one workspace supplies the visible shell context.nested group header shares its left edge; the group body then indents childrows by 12px with the hover/focus collapse rail in that gutter, while a runrow lifted out of a group keeps the turn's left edge.-- No item payload opens itself, except the display mode's Thinking default: a- tool, hosted-search or plan call stays a header row until the user opens it,- 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.+- No item payload opens itself except reasoning: a tool, hosted-search or plan+ call stays a header row until the user opens it, including the literal final+ item of the last activity group. With `Show thinking` on, only the reasoning a+ live turn is still streaming starts expanded; completed rows start folded and+ open on user action, or stay open when `Auto-fold finished thinking` is off. A+ folded row shows only the Thinking indicator, with no excerpt.With `Show thinking` off, no completed reasoning row renders; only a livewhole-run TextShimmer `Thinking` indicator remains while reasoning streams.Stored reasoning is retained and reappears when the preference is turned back on.+ A group and its reasoning answer to their own switches: neither inherits the+ other's state, so folding a group hides the expanded reasoning inside it.- Activating a group or item header toggles only that level. Closing a parentpreserves child state, reopening restores it, and sibling groups remainindependent. Opening a parent is never an expand-all action.diff --git a/docs/spec/06-delivery/04-e2e-test-plan.md b/docs/spec/06-delivery/04-e2e-test-plan.mdindex 3dfd5973d..62882ec24 100644--- a/docs/spec/06-delivery/04-e2e-test-plan.md+++ b/docs/spec/06-delivery/04-e2e-test-plan.md@@ -18021,18 +18021,23 @@ plugin-form fixtures in an isolated temporary directory at runtime.- **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. 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, explicitly+ every settled group folded and every finished reasoning row folded, and that+ each group header names the actions it contains plus the call count+ (`搜索并读取文件 · 12 次操作`). Confirm tool and search payloads stay closed.+ Turn `Auto-fold finished groups` off and confirm every settled group opens+ whatever its size, then turn it back on; turn `Auto-fold finished thinking`+ off and confirm every reasoning row opens, then turn it back 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 stayinside their activity groups and that only ordinary assistant progress textsplits a group. In Commands first, confirm `Bash`/run rows render as standalonerows beside the groups, that a normal assistant progress message or a command- ends the current group, adjacent calls stay separate, and Thinking rows default- expanded. In Flat, confirm no nested activity group renders, the outer+ ends the current group, adjacent calls stay separate, and only the reasoning+ row the turn is still streaming is expanded. In Flat, confirm no nested+ activity group renders, that `Auto-fold finished groups` is absent from AI+ settings, and the outerdisclosure lists tools, commands, thinking and progress in transcript order,and tool details stay collapsed. In every mode confirm the turn renders exactlyone outer disclosure and that closing it hides, then reopening restores, the@@ -18070,14 +18075,20 @@ plugin-form fixtures in an isolated temporary directory at runtime.group, so the middle progress paragraph ends the preceding group and thefollowing activity starts a new one. A group appears only with at least twovisible items; a singleton has no group. Every group stays open while its turn- runs; after completion, groups with at most four visible items, Task topology- groups and groups that still render a Thinking row remain open, while larger- ordinary groups of plain tool rows start closed. Thinking rows default- expanded in every mode when `Show thinking` is on.+ runs; after completion both nested levels fold, so every settled group and+ every reasoning row that is no longer streaming starts closed, whatever the+ group's size. Only the reasoning a live turn is still streaming starts+ expanded when `Show thinking` is on, and a group does not inherit open state+ from the reasoning inside it, so folding a group hides expanded reasoning.+ Turning off `Auto-fold finished groups` opens every settled group; turning off+ `Auto-fold finished thinking` opens every rendered reasoning row. A settled+ group's header names the actions it contains, capped at three with "and more",+ and appends the operation count as its own non-truncating token; reasoning is+ named but not counted, and the header carries no issue counter.Explicit user choices persist and are restored when the enclosing disclosure isreopened, and never pin an ancestor; an automatic close is deferred only while- focus or a selection remains inside. Apart from visible reasoning, group- defaults do not depend on `Show thinking`. The header+ focus or a selection remains inside. Group defaults do not depend on+ `Show thinking` or on the reasoning a group contains. 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/zh-CN/adr/turn-process-and-thinking-display.md b/docs/zh-CN/adr/turn-process-and-thinking-display.mdindex 9b93733de..34a093174 100644--- a/docs/zh-CN/adr/turn-process-and-thinking-display.md+++ b/docs/zh-CN/adr/turn-process-and-thinking-display.md@@ -51,6 +51,19 @@ v0.20.0 发布的布局。三种模式都只渲染一个外层披露。尚未被用户接管的活动组就会在后续恢复期间保持展开,并在回合完成后收起。关闭回合披露会一并关闭其下的组,重新展开则恢复用户此前展开过的组。+2026-11-04 修正(`#2094`)替换上述已结算默认值。回合结束后其下两层默认都收起:活动组,以及+不再流式输出的思考行,因此展开一个已完成回合读到的是一串标题。两个可关开关承载读者的选择:+`autoCollapseSettledGroups`(已完成小组自动收起)对任意大小的已结算组都生效,关闭后已结算组+全部展开——「四条以内保持展开」的旧档位随之取消,因为名为自动收起的开关不应仍然收起任何东西;+`autoCollapseThinking`(已完成思考自动收起)收起已完成的思考行,关闭后所有会被渲染的思考行都+展开。两者各自作为其前置设置(`显示思考`、非平铺的 `过程显示`)的缩进子项出现,隐藏子项从不+写入任何值,所以在切换父项或布局后仍保留读者已选的值。组不再因为内部含有可见思考而强制展开:+收起组会遮住组内已展开的思考,重新展开则恢复各行自己的答案,两层互不抵消。进行中的工作永不+自动收起。组收起后只剩一行,因此组标题改为陈述构成:该组包含的动作(按语言自身的列举写法连接,+最多三项,超出以「等」收尾),其后是作为独立标记的调用次数,且最后才被省略号截断+(`搜索并读取文件 · 12 次操作`);思考会被命名但不计入操作数,只有思考的组改数段数。组标题不再+渲染问题计数:失败由失败的那一行自己报告,在组上重复只是噪音。+回合披露的标题陈述回合结果,并只保留有界元数据:状态、已记录的耗时与直接工具/搜索数。它绝不回显正在处理的具体项,因为一条 shell 命令或搜索词可能任意长。其取值优先级依次为失败、已停止、执行中、已完成:已记录的失败优先于停止,因为该回合没有产出答案,而看起来@@ -102,7 +115,7 @@ v0.20.0 发布的布局。三种模式都只渲染一个外层披露。运行时或模型上下文、已存推理、导出、权限、执行或复制载荷,思考偏好也不控制回合过程或活动组的折叠。过程标题使用已记录的计时、直接工具/搜索计数和运行状态;不会重复计算委派子任务,也不会把单个失败工具误报为整个助手回合失败。顶层折叠不重复显示-问题计数;活动组标题保留各自有界的问题摘要。+问题计数;活动组标题同样不再显示问题计数,只陈述构成与操作数。## 结果@@ -110,6 +123,9 @@ v0.20.0 发布的布局。三种模式都只渲染一个外层披露。- 活动组的折叠默认值在各显示模式间统一:运行中的工作保持可见,未操作的已完成组默认收起,无论思考偏好如何都保留用户明确的披露选择。关闭回合披露会关闭其下的组,重新展开则恢复用户此前展开过的组。+- 已结算回合默认收起其活动组与已结束的思考行,两个新开关是唯一让它们保持展开的方式;+ 「四条以内保持展开」与「含可见思考即展开组」两条规则取消,两层不再彼此抵消;组标题改为+ 陈述构成与操作数,组上不再显示问题计数。- 当 `showThinking` 关闭时,不再渲染任何已完成的推理行,仅在推理流式输出期间保留整段运行的TextShimmer `Thinking` 指示器。已存推理仍会保留,重新打开偏好时重新出现。- `transcriptDisplayMode` 保留三种布局,并默认使用已发布的 `fully-folded` 布局。diff --git a/packages/i18n/src/locales/de/index.ts b/packages/i18n/src/locales/de/index.tsindex 07d3f3ddc..1187b4036 100644--- a/packages/i18n/src/locales/de/index.ts+++ b/packages/i18n/src/locales/de/index.ts@@ -651,9 +651,29 @@ export const de = {"activityTools_other": "{{count}} Tool-Aktionen","activityThinking": "{{count}} Denkschritt","activityThinking_other": "{{count}} Denkschritte",- "activityIncludesThinking": "Enthält Denken",- "activityFailures": "{{count}} Problem",- "activityFailures_other": "{{count}} Probleme",+ "activityBucket": {+ "thinking": "nachgedacht",+ "search": "Suche",+ "read": "Dateien lesen",+ "list": "Dateien auflisten",+ "write": "Dateien schreiben",+ "edit": "Dateien bearbeiten",+ "run": "Befehle ausführen",+ "fetch": "Web abrufen",+ "fork": "Aufgaben abzweigen",+ "delegate": "Subagenten nutzen",+ "use": "Tools aufrufen",+ "todo": "To-dos aktualisieren"+ },+ "activityJoin": {+ "two": "{{a}} und {{b}}",+ "three": "{{a}}, {{b}} und {{c}}",+ "threeMore": "{{a}}, {{b}}, {{c}} und mehr"+ },+ "activityOps": "{{count}} Aktion",+ "activityOps_other": "{{count}} Aktionen",+ "activityThinkingSteps": "{{count}} Schritt",+ "activityThinkingSteps_other": "{{count}} Schritte","collapseTurnProcess": "Gesamten Turn-Prozess einklappen","collapseProcess": "Prozess einklappen","collapseActivityGroup": "Aktivitätsgruppe einklappen",@@ -1521,6 +1541,10 @@ sklm: {"thinkingDisplayCompact": "Kompakt","showThinking": "Denkprozess anzeigen","showThinkingDesc": "Zeigt den Denkprozess des Modells. Wenn aus, bleibt die Live-Denk-Anzeige sichtbar und abgeschlossene Denkzeilen und Auszüge werden ausgeblendet.",+ "autoCollapseThinking": "Abgeschlossenes Denken einklappen",+ "autoCollapseThinkingDesc": "Nur laufendes Denken bleibt offen. Aus lässt alle Denkzeilen offen.",+ "autoCollapseSettledGroups": "Abgeschlossene Gruppen einklappen",+ "autoCollapseSettledGroupsDesc": "Nach dem Ende eines Turns bleiben Aktivitätsgruppen eingeklappt; die Kopfzeile nennt, was die Gruppe getan hat. Aus lässt jede abgeschlossene Gruppe offen.","transcriptDisplayMode": "Prozessanzeige","transcriptDisplayModeDesc": "Legt fest, wie der Assistentenprozess im Transkript gruppiert wird.","radialMenu": "Radiales Kontextmenü",diff --git a/packages/i18n/src/locales/en/index.ts b/packages/i18n/src/locales/en/index.tsindex 615a82399..a119a53a1 100644--- a/packages/i18n/src/locales/en/index.ts+++ b/packages/i18n/src/locales/en/index.ts@@ -663,9 +663,29 @@ export const en = {activityTools_other: "{{count}} tool actions",activityThinking: "{{count}} thinking step",activityThinking_other: "{{count}} thinking steps",- activityIncludesThinking: "Includes thinking",- activityFailures: "{{count}} issue",- activityFailures_other: "{{count}} issues",+ activityBucket: {+ thinking: "reasoning",+ search: "search",+ read: "read files",+ list: "list files",+ write: "write files",+ edit: "edit files",+ run: "run commands",+ fetch: "fetch web",+ fork: "fork tasks",+ delegate: "use subagents",+ use: "call tools",+ todo: "update todos",+ },+ activityJoin: {+ two: "{{a}} and {{b}}",+ three: "{{a}}, {{b}} and {{c}}",+ threeMore: "{{a}}, {{b}}, {{c}} and more",+ },+ activityOps: "{{count}} operation",+ activityOps_other: "{{count}} operations",+ activityThinkingSteps: "{{count}} step",+ activityThinkingSteps_other: "{{count}} steps",collapseTurnProcess: "Collapse the whole turn's process",collapseProcess: "Collapse process",collapseActivityGroup: "Collapse activity group",@@ -1534,7 +1554,11 @@ sklm: {thinkingDisplayDetailed: "Detailed",thinkingDisplayCompact: "Compact",showThinking: "Show thinking",- showThinkingDesc: "Show the model's reasoning. Off keeps the live thinking indicator visible and hides completed reasoning rows and excerpts.",+ showThinkingDesc: "Show the model's reasoning. Turning this off keeps the live thinking indicator visible and hides completed reasoning rows and summaries.",+ autoCollapseThinking: "Fold finished thinking",+ autoCollapseThinkingDesc: "Only reasoning that is still being generated stays open. Turn this off to keep every reasoning row open.",+ autoCollapseSettledGroups: "Fold finished groups",+ autoCollapseSettledGroupsDesc: "Once a turn ends, its activity groups stay folded and each header says what the group did. Turn this off to keep every finished group open.",transcriptDisplayMode: "Transcript display",transcriptDisplayModeDesc: "Choose how the assistant process is grouped in the transcript.",radialMenu: "Radial context menu",diff --git a/packages/i18n/src/locales/es/index.ts b/packages/i18n/src/locales/es/index.tsindex 364aaa259..dd8c3b26f 100644--- a/packages/i18n/src/locales/es/index.ts+++ b/packages/i18n/src/locales/es/index.ts@@ -651,9 +651,29 @@ export const es = {"activityTools_other": "{{count}} acciones de herramienta","activityThinking": "{{count}} paso de razonamiento","activityThinking_other": "{{count}} pasos de razonamiento",- "activityIncludesThinking": "Incluye razonamiento",- "activityFailures": "{{count}} problema",- "activityFailures_other": "{{count}} problemas",+ "activityBucket": {+ "thinking": "razonamiento",+ "search": "búsqueda",+ "read": "lectura de archivos",+ "list": "listado de archivos",+ "write": "escritura de archivos",+ "edit": "edición de archivos",+ "run": "ejecución de comandos",+ "fetch": "consulta web",+ "fork": "bifurcación de tareas",+ "delegate": "uso de subagentes",+ "use": "llamada a herramientas",+ "todo": "actualización de pendientes"+ },+ "activityJoin": {+ "two": "{{a}} y {{b}}",+ "three": "{{a}}, {{b}} y {{c}}",+ "threeMore": "{{a}}, {{b}}, {{c}} y más"+ },+ "activityOps": "{{count}} operación",+ "activityOps_other": "{{count}} operaciones",+ "activityThinkingSteps": "{{count}} paso",+ "activityThinkingSteps_other": "{{count}} pasos","collapseTurnProcess": "Contraer el proceso del turno completo","collapseProcess": "Contraer proceso","collapseActivityGroup": "Contraer grupo de actividad",@@ -1521,6 +1541,10 @@ sklm: {"thinkingDisplayCompact": "Compacto","showThinking": "Mostrar razonamiento","showThinkingDesc": "Muestra el razonamiento del modelo. Desactivado, el indicador de razonamiento en vivo sigue visible y las filas y extractos de razonamiento completados quedan ocultos.",+ "autoCollapseThinking": "Plegar el razonamiento terminado",+ "autoCollapseThinkingDesc": "Solo el razonamiento en curso queda abierto. Desactívalo para dejar abiertas todas las filas de razonamiento.",+ "autoCollapseSettledGroups": "Plegar los grupos terminados",+ "autoCollapseSettledGroupsDesc": "Al terminar el turno sus grupos de actividad quedan plegados y la cabecera indica qué hizo el grupo. Desactívalo para dejar abierto cada grupo terminado.","transcriptDisplayMode": "Visualización del proceso","transcriptDisplayModeDesc": "Elige cómo se agrupa el proceso del asistente en la transcripción.","radialMenu": "Menú contextual radial",diff --git a/packages/i18n/src/locales/fr/index.ts b/packages/i18n/src/locales/fr/index.tsindex 9f6c303e5..8d68b46b9 100644--- a/packages/i18n/src/locales/fr/index.ts+++ b/packages/i18n/src/locales/fr/index.ts@@ -651,9 +651,29 @@ export const fr = {"activityTools_other": "{{count}} actions d'outil","activityThinking": "{{count}} étape de raisonnement","activityThinking_other": "{{count}} étapes de raisonnement",- "activityIncludesThinking": "Inclut le raisonnement",- "activityFailures": "{{count}} problème",- "activityFailures_other": "{{count}} problèmes",+ "activityBucket": {+ "thinking": "raisonnement",+ "search": "recherche",+ "read": "lecture de fichiers",+ "list": "liste de fichiers",+ "write": "écriture de fichiers",+ "edit": "édition de fichiers",+ "run": "exécution de commandes",+ "fetch": "accès web",+ "fork": "déploiement de tâches",+ "delegate": "appel de sous-agents",+ "use": "appel d'outils",+ "todo": "mise à jour des tâches"+ },+ "activityJoin": {+ "two": "{{a}} et {{b}}",+ "three": "{{a}}, {{b}} et {{c}}",+ "threeMore": "{{a}}, {{b}}, {{c}} et plus"+ },+ "activityOps": "{{count}} opération",+ "activityOps_other": "{{count}} opérations",+ "activityThinkingSteps": "{{count}} étape",+ "activityThinkingSteps_other": "{{count}} étapes","collapseTurnProcess": "Réduire le processus du tour complet","collapseProcess": "Réduire le processus","collapseActivityGroup": "Réduire le groupe d'activité",@@ -1521,6 +1541,10 @@ sklm: {"thinkingDisplayCompact": "Compact","showThinking": "Afficher le raisonnement","showThinkingDesc": "Affiche le raisonnement du modèle. Désactivé, l'indicateur de raisonnement en direct reste visible et les lignes et extraits de raisonnement terminés sont masqués.",+ "autoCollapseThinking": "Replier le raisonnement terminé",+ "autoCollapseThinkingDesc": "Seul le raisonnement en cours reste ouvert. Désactivez pour laisser toutes les lignes de raisonnement ouvertes.",+ "autoCollapseSettledGroups": "Replier les groupes terminés",+ "autoCollapseSettledGroupsDesc": "À la fin du tour, ses groupes d'activité restent repliés et l'en-tête indique ce que le groupe a fait. Désactivez pour laisser chaque groupe terminé ouvert.","transcriptDisplayMode": "Affichage du processus","transcriptDisplayModeDesc": "Choisit comment le processus de l'assistant est regroupé dans la transcription.","radialMenu": "Menu contextuel radial",diff --git a/packages/i18n/src/locales/ko/index.ts b/packages/i18n/src/locales/ko/index.tsindex 62cb57500..8656ae0e9 100644--- a/packages/i18n/src/locales/ko/index.ts+++ b/packages/i18n/src/locales/ko/index.ts@@ -660,9 +660,29 @@ export const ko = {activityTools_other: "도구 작업 {{count}}개",activityThinking: "생각 단계 {{count}}개",activityThinking_other: "생각 단계 {{count}}개",- activityIncludesThinking: "생각 포함",- activityFailures: "문제 {{count}}개",- activityFailures_other: "문제 {{count}}개",+ activityBucket: {+ thinking: "사고",+ search: "검색",+ read: "파일 읽기",+ list: "파일 목록",+ write: "파일 쓰기",+ edit: "파일 편집",+ run: "명령 실행",+ fetch: "웹 가져오기",+ fork: "작업 분기",+ delegate: "하위 에이전트 호출",+ use: "도구 호출",+ todo: "할 일 업데이트",+ },+ activityJoin: {+ two: "{{a}} 및 {{b}}",+ three: "{{a}}, {{b}} 및 {{c}}",+ threeMore: "{{a}}, {{b}}, {{c}} 등",+ },+ activityOps: "작업 {{count}}회",+ activityOps_other: "작업 {{count}}회",+ activityThinkingSteps: "{{count}}단계",+ activityThinkingSteps_other: "{{count}}단계",collapseTurnProcess: "전체 턴 처리 과정 접기",collapseProcess: "처리 과정 접기",collapseActivityGroup: "활동 그룹 접기",@@ -1531,6 +1551,10 @@ sklm: {thinkingDisplayCompact: "간결",showThinking: "사고 과정 표시",showThinkingDesc: "모델의 사고 과정을 표시합니다. 끄면 실시간 사고 표시기는 계속 보이고 완료된 사고 행과 발췌는 숨겨집니다.",+ autoCollapseThinking: "완료된 사고 접기",+ autoCollapseThinkingDesc: "생성 중인 사고만 펼쳐 둡니다. 끄면 모든 사고 행이 펼쳐진 채로 유지됩니다.",+ autoCollapseSettledGroups: "완료된 그룹 접기",+ autoCollapseSettledGroupsDesc: "턴이 끝나면 활동 그룹이 접힌 채로 남고, 헤더가 그룹이 한 일을 알려 줍니다. 끄면 완료된 그룹이 모두 펼쳐집니다.",transcriptDisplayMode: "프로세스 표시",transcriptDisplayModeDesc: "트랜스크립트에서 어시스턴트 프로세스를 묶는 방식을 선택합니다.",radialMenu: "방사형 컨텍스트 메뉴",diff --git a/packages/i18n/src/locales/pt-BR/index.ts b/packages/i18n/src/locales/pt-BR/index.tsindex 81a32b845..d65b2c968 100644--- a/packages/i18n/src/locales/pt-BR/index.ts+++ b/packages/i18n/src/locales/pt-BR/index.ts@@ -650,9 +650,29 @@ export const ptBR = {activityTools_other: "{{count}} ações de ferramenta",activityThinking: "{{count}} etapa de raciocínio",activityThinking_other: "{{count}} etapas de raciocínio",- activityIncludesThinking: "Inclui raciocínio",- activityFailures: "{{count}} problema",- activityFailures_other: "{{count}} problemas",+ activityBucket: {+ thinking: "raciocínio",+ search: "pesquisa",+ read: "leitura de arquivos",+ list: "listagem de arquivos",+ write: "escrita de arquivos",+ edit: "edição de arquivos",+ run: "execução de comandos",+ fetch: "acesso à web",+ fork: "ramificação de tarefas",+ delegate: "uso de subagentes",+ use: "chamada de ferramentas",+ todo: "atualização de tarefas",+ },+ activityJoin: {+ two: "{{a}} e {{b}}",+ three: "{{a}}, {{b}} e {{c}}",+ threeMore: "{{a}}, {{b}}, {{c}} e mais",+ },+ activityOps: "{{count}} operação",+ activityOps_other: "{{count}} operações",+ activityThinkingSteps: "{{count}} etapa",+ activityThinkingSteps_other: "{{count}} etapas",collapseTurnProcess: "Recolher o processo do turno inteiro",collapseProcess: "Recolher processo",collapseActivityGroup: "Recolher grupo de atividades",@@ -1494,6 +1514,10 @@ export const ptBR = {thinkingDisplayCompact: "Compacto",showThinking: "Mostrar raciocínio",showThinkingDesc: "Mostra o raciocínio do modelo. Quando desativado, o indicador de raciocínio ao vivo continua visível e as linhas e trechos de raciocínio concluídos ficam ocultos.",+ autoCollapseThinking: "Recolher raciocínio concluído",+ autoCollapseThinkingDesc: "Apenas o raciocínio em geração fica aberto. Desative para manter todas as linhas de raciocínio abertas.",+ autoCollapseSettledGroups: "Recolher grupos concluídos",+ autoCollapseSettledGroupsDesc: "Ao terminar o turno, os grupos de atividade ficam recolhidos e o cabeçalho indica o que o grupo fez. Desative para manter cada grupo concluído aberto.",transcriptDisplayMode: "Exibição do processo",transcriptDisplayModeDesc: "Escolha como o processo do assistente é agrupado na transcrição.",radialMenu: "Menu de contexto radial",diff --git a/packages/i18n/src/locales/tr/index.ts b/packages/i18n/src/locales/tr/index.tsindex ec4f6b65c..25ba486d0 100644--- a/packages/i18n/src/locales/tr/index.ts+++ b/packages/i18n/src/locales/tr/index.ts@@ -660,9 +660,29 @@ export const tr = {activityTools_other: "{{count}} araç işlemi",activityThinking: "{{count}} düşünme adımı",activityThinking_other: "{{count}} düşünme adımı",- activityIncludesThinking: "Düşünmeyi içerir",- activityFailures: "{{count}} sorun",- activityFailures_other: "{{count}} sorun",+ activityBucket: {+ thinking: "düşünme",+ search: "arama",+ read: "dosya okuma",+ list: "dosya listeleme",+ write: "dosya yazma",+ edit: "dosya düzenleme",+ run: "komut çalıştırma",+ fetch: "web getirme",+ fork: "görev dallandırma",+ delegate: "alt ajan kullanımı",+ use: "araç çağırma",+ todo: "görev güncelleme",+ },+ activityJoin: {+ two: "{{a}} ve {{b}}",+ three: "{{a}}, {{b}} ve {{c}}",+ threeMore: "{{a}}, {{b}}, {{c}} ve daha fazlası",+ },+ activityOps: "{{count}} işlem",+ activityOps_other: "{{count}} işlem",+ activityThinkingSteps: "{{count}} adım",+ activityThinkingSteps_other: "{{count}} adım",collapseTurnProcess: "Tüm tur işlemini daralt",collapseProcess: "İşlemi daralt",collapseActivityGroup: "Etkinlik grubunu daralt",@@ -1525,6 +1545,10 @@ sklm: {thinkingDisplayCompact: "Sade",showThinking: "Düşünmeyi göster",showThinkingDesc: "Modelin düşünmesini gösterir. Kapalıyken canlı düşünme göstergesi görünür kalır; tamamlanan düşünme satırları ve alıntılar gizlenir.",+ autoCollapseThinking: "Tamamlanan düşünmeyi katla",+ autoCollapseThinkingDesc: "Yalnızca üretilmekte olan düşünme açık kalır. Kapatınca tüm düşünme satırları açık kalır.",+ autoCollapseSettledGroups: "Tamamlanan grupları katla",+ autoCollapseSettledGroupsDesc: "Tur bittiğinde etkinlik grupları katlı kalır ve başlık grubun ne yaptığını söyler. Kapatınca tamamlanan her grup açık kalır.",transcriptDisplayMode: "Süreç görünümü",transcriptDisplayModeDesc: "Asistan sürecinin transkriptte nasıl gruplanacağını seçer.",radialMenu: "Dairesel bağlam menüsü",diff --git a/packages/i18n/src/locales/zh-CN/index.ts b/packages/i18n/src/locales/zh-CN/index.tsindex 6d72b69c5..622194afa 100644--- a/packages/i18n/src/locales/zh-CN/index.ts+++ b/packages/i18n/src/locales/zh-CN/index.ts@@ -656,9 +656,29 @@ export const zhCN = {activityTools_other: "{{count}} 次工具操作",activityThinking: "{{count}} 个思考步骤",activityThinking_other: "{{count}} 个思考步骤",- activityIncludesThinking: "包含思考",- activityFailures: "{{count}} 个问题",- activityFailures_other: "{{count}} 个问题",+ activityBucket: {+ thinking: "进行了思考",+ search: "搜索",+ read: "读取文件",+ list: "列出文件",+ write: "写入文件",+ edit: "编辑文件",+ run: "执行命令",+ fetch: "联网获取",+ fork: "派生任务",+ delegate: "调度子代理",+ use: "调用工具",+ todo: "更新待办",+ },+ activityJoin: {+ two: "{{a}}并{{b}}",+ three: "{{a}}、{{b}}并{{c}}",+ threeMore: "{{a}}、{{b}}、{{c}}等",+ },+ activityOps: "{{count}} 次操作",+ activityOps_other: "{{count}} 次操作",+ activityThinkingSteps: "{{count}} 段",+ activityThinkingSteps_other: "{{count}} 段",collapseTurnProcess: "折叠整轮处理过程",collapseProcess: "折叠处理过程",collapseActivityGroup: "折叠活动分组",@@ -1515,6 +1535,10 @@ sklm: {thinkingDisplayCompact: "精简",showThinking: "显示思考",showThinkingDesc: "显示模型的推理内容。关闭后仍显示实时思考指示器,并隐藏已完成的推理行和摘要。",+ autoCollapseThinking: "已完成思考自动收起",+ autoCollapseThinkingDesc: "只有正在生成的思考保持展开;关闭后所有思考内容保持展开。",+ autoCollapseSettledGroups: "已完成小组自动收起",+ autoCollapseSettledGroupsDesc: "任务结束后,过程小组默认收起,标题会说明这一组做过什么。关闭后已结束的小组全部展开。",transcriptDisplayMode: "过程显示",transcriptDisplayModeDesc: "选择助手过程在对话中的分组方式。",radialMenu: "环形右键菜单",diff --git a/packages/i18n/src/locales/zh-TW/index.ts b/packages/i18n/src/locales/zh-TW/index.tsindex 4a5e77068..511672b18 100644--- a/packages/i18n/src/locales/zh-TW/index.ts+++ b/packages/i18n/src/locales/zh-TW/index.ts@@ -656,9 +656,29 @@ export const zhTW = {activityTools_other: "{{count}} 次工具操作",activityThinking: "{{count}} 個思考步驟",activityThinking_other: "{{count}} 個思考步驟",- activityIncludesThinking: "包含思考",- activityFailures: "{{count}} 個問題",- activityFailures_other: "{{count}} 個問題",+ activityBucket: {+ thinking: "進行了思考",+ search: "搜尋",+ read: "讀取檔案",+ list: "列出檔案",+ write: "寫入檔案",+ edit: "編輯檔案",+ run: "執行指令",+ fetch: "連網取得",+ fork: "派生任務",+ delegate: "調度子代理",+ use: "呼叫工具",+ todo: "更新待辦",+ },+ activityJoin: {+ two: "{{a}}並{{b}}",+ three: "{{a}}、{{b}}並{{c}}",+ threeMore: "{{a}}、{{b}}、{{c}}等",+ },+ activityOps: "{{count}} 次操作",+ activityOps_other: "{{count}} 次操作",+ activityThinkingSteps: "{{count}} 段",+ activityThinkingSteps_other: "{{count}} 段",collapseTurnProcess: "摺疊整輪處理過程",collapseProcess: "摺疊處理過程",collapseActivityGroup: "摺疊活動群組",@@ -1514,7 +1534,11 @@ sklm: {thinkingDisplayDetailed: "詳細",thinkingDisplayCompact: "精簡",showThinking: "顯示思考",- showThinkingDesc: "顯示模型的推理內容。關閉後仍顯示即時思考指示器,並隱藏已完成的推理列和摘要。",+ showThinkingDesc: "顯示模型的推理內容。關閉後仍顯示即時思考指示器,並隱藏已完成的推理列與摘要。",+ autoCollapseThinking: "已完成思考自動收合",+ autoCollapseThinkingDesc: "只有正在生成的思考保持展開;關閉後所有思考內容保持展開。",+ autoCollapseSettledGroups: "已完成群組自動收合",+ autoCollapseSettledGroupsDesc: "任務結束後,過程群組預設收合,標題會說明這一組做過什麼。關閉後已結束的群組全部展開。",transcriptDisplayMode: "過程顯示",transcriptDisplayModeDesc: "選擇助理過程在對話中的分組方式。",radialMenu: "環形右鍵選單",diff --git a/packages/shared/src/types/settings.ts b/packages/shared/src/types/settings.tsindex a52dbd6f1..51f97eae7 100644--- a/packages/shared/src/types/settings.ts+++ b/packages/shared/src/types/settings.ts@@ -148,6 +148,23 @@ export type AppSettings = {* This is presentation only and never changes tool execution or stored data.*/transcriptDisplayMode?: TranscriptDisplayMode;+ /**+ * Fold a settled activity group by default (issue #2094).+ *+ * `false` keeps every settled group open; absent and `true` fold them, so a+ * completed turn expands to a compact list of what the agent did. There is no+ * other tier: the old "groups of up to four rows stay open" rule is gone,+ * because a switch labelled auto-collapse must not still collapse something.+ */+ autoCollapseSettledGroups?: boolean;+ /**+ * Fold reasoning that is no longer being generated (issue #2094).+ *+ * Only meaningful while `showThinking` renders reasoning rows. `false` keeps+ * every rendered Thinking row open; absent and `true` fold all of them except+ * the row the live turn is still streaming.+ */+ autoCollapseThinking?: boolean;/*** @deprecated Replaced by `transcriptDisplayMode`. Retained for persisted* settings and older clients; current rendering no longer reads it.