diff --git a/packages/client/ui-chat/src/chat-settings.ts b/packages/client/ui-chat/src/chat-settings.ts index 7335a49db5..640f416043 100644 --- a/packages/client/ui-chat/src/chat-settings.ts +++ b/packages/client/ui-chat/src/chat-settings.ts @@ -15,7 +15,7 @@ export const TRANSCRIPT_VIEW_MODES = ['compact', 'standard', 'detailed', 'verbos export type TranscriptViewMode = typeof TRANSCRIPT_VIEW_MODES[number] /** - * Saved value from the two-mode generation of this setting. Read as `standard`; + * Saved value from the two-mode generation of this setting. Read as `detailed`; * never offered as a choice and never written back. */ export const LEGACY_TRANSCRIPT_VIEW_MODE = 'normal' diff --git a/packages/client/ui-chat/src/client/conversation-nodes/README.i18n.yaml b/packages/client/ui-chat/src/client/conversation-nodes/README.i18n.yaml index 3017e3eaed..9ef9c65e93 100644 --- a/packages/client/ui-chat/src/client/conversation-nodes/README.i18n.yaml +++ b/packages/client/ui-chat/src/client/conversation-nodes/README.i18n.yaml @@ -27,8 +27,8 @@ en: 8db4991626210708 zh: e18c8aa3cb434980 /chat-conversation-node-rules/display-modes: - en: 42342a06ef189075 - zh: 1a554b50125fcdda + en: b67a97af6578be4e + zh: 45511f59d45746fe /chat-conversation-node-rules/display-modes/group-title-rules: en: a6d29a5ea3fd2362 zh: dbd07bf82cdd61b1 diff --git a/packages/client/ui-chat/src/client/conversation-nodes/README.md b/packages/client/ui-chat/src/client/conversation-nodes/README.md index 12c63b5497..d75b5b20e7 100644 --- a/packages/client/ui-chat/src/client/conversation-nodes/README.md +++ b/packages/client/ui-chat/src/client/conversation-nodes/README.md @@ -108,7 +108,7 @@ Automatic collapse keeps the process open if hiding it would hide keyboard focus ## Display modes -Settings → General → Work details offers `compact`, `standard` (default), `detailed`, and `verbose`; its description is “Choose how much detail to show for tool calls”. A saved `normal` reads as `standard`, and a saved `expanded` reads as `detailed`, without automatic write-back. Existing `detailed` remains `detailed`. Missing or invalid values, including the period before Host settings arrive, use `standard`; invalid values in other settings still fail validation. +Settings → General → Work details offers `compact`, `standard` (default), `detailed`, and `verbose`; its description is “Choose how much detail to show for tool calls”. Saved `normal` and `expanded` values read as `detailed`, without automatic write-back. Existing `detailed` remains `detailed`. Missing or invalid values, including the period before Host settings arrive, use `standard`; invalid values in other settings still fail validation. | Behavior | Compact | Standard | Detailed | Verbose | |---|---|---|---|---| diff --git a/packages/client/ui-chat/src/client/conversation-nodes/README.zh.md b/packages/client/ui-chat/src/client/conversation-nodes/README.zh.md index 341c2826a1..9925f4b449 100644 --- a/packages/client/ui-chat/src/client/conversation-nodes/README.zh.md +++ b/packages/client/ui-chat/src/client/conversation-nodes/README.zh.md @@ -108,7 +108,7 @@ description: "Chat 过程分组与活动摘要的明细业务规则。" ## 展示模式 -设置 → 通用设置 → 工作步骤展示提供 `compact`、`standard`(默认)、`detailed` 和 `verbose`,说明为「选择希望看到多少工具调用细节」。旧值 `normal` 读取为 `standard`,`expanded` 读取为 `detailed`,不自动回写;已有 `detailed` 保持不变。未配置、无效值以及 Host 设置到达前均使用 `standard`;其他设置的无效值仍会校验失败。 +设置 → 通用设置 → 工作步骤展示提供 `compact`、`standard`(默认)、`detailed` 和 `verbose`,说明为「选择希望看到多少工具调用细节」。旧值 `normal` 和 `expanded` 均读取为 `detailed`,不自动回写;已有 `detailed` 保持不变。未配置、无效值以及 Host 设置到达前均使用 `standard`;其他设置的无效值仍会校验失败。 | 行为 | 简洁 | 标准 | 详细 | 完全展开 | |---|---|---|---|---| diff --git a/packages/client/ui-chat/src/client/transcript-view.ts b/packages/client/ui-chat/src/client/transcript-view.ts index e7f6cc4fde..729b5443a0 100644 --- a/packages/client/ui-chat/src/client/transcript-view.ts +++ b/packages/client/ui-chat/src/client/transcript-view.ts @@ -39,8 +39,8 @@ export class TranscriptViewPolicy { const section = this.host.getSnapshot().value if (section === undefined) return const saved = section.transcriptView - const mode = saved === LEGACY_TRANSCRIPT_VIEW_MODE ? 'standard' - : saved === LEGACY_EXPANDED_TRANSCRIPT_VIEW_MODE ? 'detailed' : saved + const mode = saved === LEGACY_TRANSCRIPT_VIEW_MODE || saved === LEGACY_EXPANDED_TRANSCRIPT_VIEW_MODE + ? 'detailed' : saved if (this.mode.getSnapshot() !== mode) this.mode.set(mode) } } diff --git a/packages/client/ui-chat/tests/transcript-view-policy.client.spec.ts b/packages/client/ui-chat/tests/transcript-view-policy.client.spec.ts index 28a9212054..752f5f19ea 100644 --- a/packages/client/ui-chat/tests/transcript-view-policy.client.spec.ts +++ b/packages/client/ui-chat/tests/transcript-view-policy.client.spec.ts @@ -26,22 +26,27 @@ describe('TranscriptViewPolicy', () => { expect(host.set).toHaveBeenCalledWith('transcriptView', 'detailed') }) - it('adopts Host state, reads normal as Standard, and ignores identical writes', () => { + it.each(['normal', 'expanded'] as const)('reads a later Host %s setting as Detailed without writing it back', (mode) => { const host = stubConfigForm() const policy = new TranscriptViewPolicy(host.scope) - host.publish({ status: 'ready', value: { linkOpening: 'sidebar', transcriptView: 'normal', performanceUsage: 'detailed' }, revision: 1, writable: true }) - expect(policy.mode.getSnapshot()).toBe('standard') - policy.setMode('standard') + host.publish({ status: 'ready', value: { linkOpening: 'sidebar', transcriptView: mode, performanceUsage: 'detailed' }, revision: 1, writable: true }) + expect(policy.mode.getSnapshot()).toBe('detailed') expect(host.set).not.toHaveBeenCalled() + policy.setMode('detailed') + expect(host.set).not.toHaveBeenCalled() + + policy.setMode('standard') + expect(policy.mode.getSnapshot()).toBe('standard') + expect(host.set).toHaveBeenCalledExactlyOnceWith('transcriptView', 'standard') host.publish({ value: { linkOpening: 'sidebar', transcriptView: 'compact', performanceUsage: 'detailed' }, revision: 2 }) expect(policy.mode.getSnapshot()).toBe('compact') }) - it('adopts an accepted section standing at construction', () => { + it.each(['normal', 'expanded'] as const)('reads an initial Host %s setting as Detailed without writing it back', (mode) => { const host = stubConfigForm() - host.publish({ status: 'ready', value: { linkOpening: 'sidebar', transcriptView: 'expanded', performanceUsage: 'detailed' }, revision: 1, writable: true }) + host.publish({ status: 'ready', value: { linkOpening: 'sidebar', transcriptView: mode, performanceUsage: 'detailed' }, revision: 1, writable: true }) expect(new TranscriptViewPolicy(host.scope).mode.getSnapshot()).toBe('detailed') expect(host.set).not.toHaveBeenCalled() })