From 58fa61401deee618e7dfd78d2fd0ffa60bcc0b04 Mon Sep 17 00:00:00 2001 From: Yif <877193178@qq.com> Date: Tue, 24 Nov 2026 02:24:14 +0800 Subject: [PATCH] fix(client): hide empty groups exactly and refresh grouped expectations --- .../desktop-locale/automatic.expected.md | 73 +++++++++++-------- .../desktop-locale/selected.expected.md | 73 +++++++++++-------- .../dialog-no-browser.expected.md | 73 +++++++++++-------- apps/web/tests/settings-chrome.e2e.ts | 10 +-- .../src/client/SettingsRow.tsx | 2 +- packages/client/ui-chat/README.i18n.yaml | 8 +- packages/client/ui-chat/README.md | 4 +- packages/client/ui-chat/README.zh.md | 4 +- .../src/client/settings/LinkOpeningRow.tsx | 2 +- .../client/settings/PerformanceUsageRow.tsx | 2 +- .../src/client/settings/TranscriptViewRow.tsx | 2 +- .../src/client/settings/EnterBehaviorRow.tsx | 2 +- .../src/client/PermissionRow.tsx | 2 +- .../ui-settings-general/README.i18n.yaml | 4 +- packages/client/ui-settings-general/README.md | 3 +- .../client/ui-settings-general/README.zh.md | 3 +- .../src/client/CurrentVersionRow.tsx | 2 +- .../src/client/DesktopChannelRow.tsx | 2 +- .../src/client/DeveloperToolsRow.tsx | 2 +- .../src/client/GeneralGroup.tsx | 5 -- .../src/client/GeneralSection.module.css | 4 +- .../ui-settings-general/src/client/index.ts | 7 +- .../ui-settings-general/src/client/locales.ts | 8 -- .../tests/components.client.spec.tsx | 3 +- .../tests/groups.client.spec.tsx | 26 ++++--- .../ui-settings-session-log/README.i18n.yaml | 4 +- .../client/ui-settings-session-log/README.md | 4 +- .../src/client/UploadRow.tsx | 2 +- .../ui-settings/src/client/contract/slots.ts | 3 - .../ui-shortcuts/src/client/Reference.tsx | 2 +- .../src/client/slot-catalog.ts | 64 ++-------------- .../session-log-deepseek/README.i18n.yaml | 2 +- .../session/session-log-deepseek/README.md | 2 +- 33 files changed, 187 insertions(+), 222 deletions(-) diff --git a/apps/web/tests/expected/desktop-locale/automatic.expected.md b/apps/web/tests/expected/desktop-locale/automatic.expected.md index 7f3c40fb01..301b222850 100644 --- a/apps/web/tests/expected/desktop-locale/automatic.expected.md +++ b/apps/web/tests/expected/desktop-locale/automatic.expected.md @@ -7,34 +7,45 @@ - button "Agent 预设" - button "打开配置文件" - button "关闭" - - text: 权限 选择新会话的默认权限模式 - - button "工作区内修改" - - text: 语言 - - button "中文" - - text: 外观 - - button "浅色" - - button "深色" - - button "跟随系统" [pressed] - - text: 字号大小 仅影响会话内容的字号 14 - - button "增大字号" - - button "减小字号" - - text: px - - button "更多字体设置" - - text: 工作步骤展示 选择希望看到多少工具调用细节 - - button "标准" - - text: 工作步骤收起时机 选择何时自动收起工作步骤 - - button "回答结束后" - - text: 收起后显示的回复 工作步骤收起后,保留哪些助手回复 - - button "全部回复" - - text: 显示代码工作视图 开启后,显示轨迹、本轮代码差异,可选择完整的 Agent 预设切换 - - switch "显示代码工作视图" [checked] - - text: 快捷键 - - paragraph: 查看和编辑当前可用的快捷键和输入操作 - - button "编辑快捷键" - - text: 繁忙时的发送行为 智能体运行时 Enter 键和发送按钮的行为;Cmd/Ctrl+Enter 使用另一行为 - - button "排队发送" - - text: 性能与用量 选择性能与用量信息展示的详细程度 - - button "详细" - - text: 在使用官方模型 API 时上传 Session Log 帮助改进 DeepSeek 模型与产品 - - switch "在使用官方模型 API 时上传 Session Log" - - text: 当前版本:{{version}} + - heading "通用设置" [level=2] + - region "常规": + - heading "常规" [level=3] + - text: 语言 + - button "中文" + - text: 外观 + - button "浅色" + - button "深色" + - button "跟随系统" [pressed] + - text: 字号大小 仅影响会话内容的字号 14 + - button "增大字号" + - button "减小字号" + - text: px + - button "更多字体设置" + - region "会话偏好": + - heading "会话偏好" [level=3] + - text: 会话默认权限 选择新会话的默认权限模式 + - button "工作区内修改" + - text: 工作步骤展示 选择希望看到多少工具调用细节 + - button "标准" + - text: 工作步骤收起时机 选择何时自动收起工作步骤 + - button "回答结束后" + - text: 收起后显示的回复 工作步骤收起后,保留哪些助手回复 + - button "全部回复" + - text: 显示代码工作视图 开启后,显示轨迹、本轮代码差异,可选择完整的 Agent 预设切换 + - switch "显示代码工作视图" [checked] + - text: 性能与用量 选择性能与用量信息展示的详细程度 + - button "详细" + - region "交互与快捷键": + - heading "交互与快捷键" [level=3] + - text: 繁忙时的发送行为 智能体运行时 Enter 键和发送按钮的行为;Cmd/Ctrl+Enter 使用另一行为 + - button "排队发送" + - text: 快捷键 + - paragraph: 查看和编辑当前可用的快捷键和输入操作 + - button "编辑快捷键" + - region "数据管理": + - heading "数据管理" [level=3] + - text: 在使用官方模型 API 时上传 Session Log 帮助改进 DeepSeek 模型与产品 + - switch "在使用官方模型 API 时上传 Session Log" + - region "版本与更新": + - heading "版本与更新" [level=3] + - text: 当前版本:{{version}} diff --git a/apps/web/tests/expected/desktop-locale/selected.expected.md b/apps/web/tests/expected/desktop-locale/selected.expected.md index ec34f15dec..f10334319b 100644 --- a/apps/web/tests/expected/desktop-locale/selected.expected.md +++ b/apps/web/tests/expected/desktop-locale/selected.expected.md @@ -7,34 +7,45 @@ - button "Agent presets" - button "Open configuration file" - button "Close" - - text: Permission Choose the default permission mode for new sessions - - button "Workspace Write" - - text: Language - - button "English" - - text: Appearance - - button "Light" - - button "Dark" - - button "System" [pressed] - - text: Font size Only affects conversation content 14 - - button "Increase font size" - - button "Decrease font size" - - text: px - - button "More font settings" - - text: Work details Choose how much detail to show for tool calls - - button "Standard" - - text: When to Collapse Work Details Choose when to automatically collapse work details - - button "On completion" - - text: Replies After Collapse Choose which assistant replies stay visible when work details collapse - - button "All replies" - - text: Show coding view Shows trajectory, code diffs, and all Agent presets - - switch "Show coding view" [checked] - - text: Keyboard shortcuts - - paragraph: View and edit available shortcuts and input actions - - button "Edit shortcuts" - - text: Send behavior while busy What Enter and the Send button do while the agent is running; Cmd/Ctrl+Enter uses the other behavior - - button "Queue" - - text: Performance & usage Choose how much performance and usage information to show - - button "Detailed" - - text: Upload session log when using the official model API Help improve DeepSeek models and products. - - switch "Upload session log when using the official model API" - - text: "Current version: {{version}}" + - heading "General" [level=2] + - region "Preferences": + - heading "Preferences" [level=3] + - text: Language + - button "English" + - text: Appearance + - button "Light" + - button "Dark" + - button "System" [pressed] + - text: Font size Only affects conversation content 14 + - button "Increase font size" + - button "Decrease font size" + - text: px + - button "More font settings" + - region "Chat experience": + - heading "Chat experience" [level=3] + - text: Default session permission Choose the default permission mode for new sessions + - button "Workspace Write" + - text: Work details Choose how much detail to show for tool calls + - button "Standard" + - text: When to Collapse Work Details Choose when to automatically collapse work details + - button "On completion" + - text: Replies After Collapse Choose which assistant replies stay visible when work details collapse + - button "All replies" + - text: Show coding view Shows trajectory, code diffs, and all Agent presets + - switch "Show coding view" [checked] + - text: Performance & usage Choose how much performance and usage information to show + - button "Detailed" + - region "Interaction and shortcuts": + - heading "Interaction and shortcuts" [level=3] + - text: Send behavior while busy What Enter and the Send button do while the agent is running; Cmd/Ctrl+Enter uses the other behavior + - button "Queue" + - text: Keyboard shortcuts + - paragraph: View and edit available shortcuts and input actions + - button "Edit shortcuts" + - region "Data management": + - heading "Data management" [level=3] + - text: Upload session log when using the official model API Help improve DeepSeek models and products. + - switch "Upload session log when using the official model API" + - region "Version and updates": + - heading "Version and updates" [level=3] + - text: "Current version: {{version}}" diff --git a/apps/web/tests/expected/settings-chrome/dialog-no-browser.expected.md b/apps/web/tests/expected/settings-chrome/dialog-no-browser.expected.md index 8022027dbd..e4f04315c4 100644 --- a/apps/web/tests/expected/settings-chrome/dialog-no-browser.expected.md +++ b/apps/web/tests/expected/settings-chrome/dialog-no-browser.expected.md @@ -8,34 +8,45 @@ - button "Remote connection" - button "Open configuration file" - button "Close" - - text: Permission Choose the default permission mode for new sessions - - button "Workspace Write" - - text: Language - - button "English" - - text: Appearance - - button "Light" - - button "Dark" - - button "System" [pressed] - - text: Font size Only affects conversation content 14 - - button "Increase font size" - - button "Decrease font size" - - text: px - - button "More font settings" - - text: Work details Choose how much detail to show for tool calls - - button "Detailed" - - text: When to Collapse Work Details Choose when to automatically collapse work details - - button "On completion" - - text: Replies After Collapse Choose which assistant replies stay visible when work details collapse - - button "All replies" - - text: Show coding view Shows trajectory, code diffs, and all Agent presets - - switch "Show coding view" - - text: Keyboard shortcuts - - paragraph: View and edit available shortcuts and input actions - - button "Edit shortcuts" - - text: Send behavior while busy What Enter and the Send button do while the agent is running; Cmd/Ctrl+Enter uses the other behavior - - button "Queue" - - text: Performance & usage Choose how much performance and usage information to show - - button "Detailed" - - text: Upload session log when using the official model API Help improve DeepSeek models and products. - - switch "Upload session log when using the official model API" - - text: "Current version: {{version}}" + - heading "General" [level=2] + - region "Preferences": + - heading "Preferences" [level=3] + - text: Language + - button "English" + - text: Appearance + - button "Light" + - button "Dark" + - button "System" [pressed] + - text: Font size Only affects conversation content 14 + - button "Increase font size" + - button "Decrease font size" + - text: px + - button "More font settings" + - region "Chat experience": + - heading "Chat experience" [level=3] + - text: Default session permission Choose the default permission mode for new sessions + - button "Workspace Write" + - text: Work details Choose how much detail to show for tool calls + - button "Detailed" + - text: When to Collapse Work Details Choose when to automatically collapse work details + - button "On completion" + - text: Replies After Collapse Choose which assistant replies stay visible when work details collapse + - button "All replies" + - text: Show coding view Shows trajectory, code diffs, and all Agent presets + - switch "Show coding view" + - text: Performance & usage Choose how much performance and usage information to show + - button "Detailed" + - region "Interaction and shortcuts": + - heading "Interaction and shortcuts" [level=3] + - text: Send behavior while busy What Enter and the Send button do while the agent is running; Cmd/Ctrl+Enter uses the other behavior + - button "Queue" + - text: Keyboard shortcuts + - paragraph: View and edit available shortcuts and input actions + - button "Edit shortcuts" + - region "Data management": + - heading "Data management" [level=3] + - text: Upload session log when using the official model API Help improve DeepSeek models and products. + - switch "Upload session log when using the official model API" + - region "Version and updates": + - heading "Version and updates" [level=3] + - text: "Current version: {{version}}" diff --git a/apps/web/tests/settings-chrome.e2e.ts b/apps/web/tests/settings-chrome.e2e.ts index dea15ef684..26acc86056 100644 --- a/apps/web/tests/settings-chrome.e2e.ts +++ b/apps/web/tests/settings-chrome.e2e.ts @@ -255,20 +255,20 @@ describe('web e2e: settings modal and General preferences', () => { // control on one line rather than stacking. await cells.nth(1).click() await expect.poll(() => cells.nth(1).getAttribute('aria-current')).toBe('true') - await expect.poll(() => dialog.getByText('权限', { exact: true }).count()).toBe(0) + await expect.poll(() => dialog.getByText('会话默认权限', { exact: true }).count()).toBe(0) await cells.first().click() - await expect.poll(() => dialog.getByText('权限', { exact: true }).count(), { timeout: 5_000 }).toBe(1) - const permissionRow = dialog.getByText('权限', { exact: true }).locator('..') + await expect.poll(() => dialog.getByText('会话默认权限', { exact: true }).count(), { timeout: 5_000 }).toBe(1) + const permissionRow = dialog.getByText('会话默认权限', { exact: true }).locator('..') const permissionBox = await permissionRow.boundingBox() const controlBox = await dialog.getByRole('button', { name: '工作区内修改' }).boundingBox() expect(controlBox).not.toBeNull() expect(permissionBox).not.toBeNull() expect(controlBox!.y).toBeLessThan(permissionBox!.y + permissionBox!.height) - // The Appearance cubes share one row instead of wrapping to two. + // Below the 360px container width the three Appearance cubes stack. const cubes = dialog.getByRole('button', { name: /浅色|深色|跟随系统/ }) const cubeBoxes = await cubes.evaluateAll(nodes => nodes.map(node => node.getBoundingClientRect().top)) - expect(new Set(cubeBoxes.map(top => Math.round(top))).size).toBe(1) + expect(new Set(cubeBoxes.map(top => Math.round(top))).size).toBe(3) await cells.first().focus() for (let index = 1; index < await cells.count(); index += 1) { diff --git a/packages/client/ui-action-cards/src/client/SettingsRow.tsx b/packages/client/ui-action-cards/src/client/SettingsRow.tsx index 787ea259b1..f10192bd53 100644 --- a/packages/client/ui-action-cards/src/client/SettingsRow.tsx +++ b/packages/client/ui-action-cards/src/client/SettingsRow.tsx @@ -27,7 +27,7 @@ export interface SettingsRowInjected { * @returns the General settings row. */ export function SettingsRow({ useCardSettings, setEnabled, t }: - PropsRuntime<'settings.general.item'> & PropsLocale<'actionCards'> & InjectFace) { + PropsRuntime<'settings.general.group.display.item'> & PropsLocale<'actionCards'> & InjectFace) { const settings = useCardSettings(value => value) const [busy, setBusy] = useState(false) const [failed, setFailed] = useState(false) diff --git a/packages/client/ui-chat/README.i18n.yaml b/packages/client/ui-chat/README.i18n.yaml index 08131cc7cf..ae38b6c428 100644 --- a/packages/client/ui-chat/README.i18n.yaml +++ b/packages/client/ui-chat/README.i18n.yaml @@ -15,8 +15,8 @@ en: 5ee429751fcbeb4f zh: 981a37018b6cae3a /deepseek-ai-dsh-client-ui-chat/reference-previews: - en: 0501fb835108d448 - zh: e402464e08fadf3c + en: 3c16a373c6fe2b06 + zh: d5285ae6ee3561dc /deepseek-ai-dsh-client-ui-chat/hidden-chat-rows: en: 5d671be0cd016dbd zh: 21201362bc07e707 @@ -27,8 +27,8 @@ en: a191f90e9a64f6fe zh: 8e91b8660f9baa18 /deepseek-ai-dsh-client-ui-chat/turn-token-usage: - en: d363057b5c0b2571 - zh: 0f6fe864d9673576 + en: b36906686f3aefa7 + zh: 087741aa57c8988a /deepseek-ai-dsh-client-ui-chat/completed-turn-footer: en: 382821ca3ffa60dd zh: 9840ffa07c13082a diff --git a/packages/client/ui-chat/README.md b/packages/client/ui-chat/README.md index 85700c3d14..5795549e4e 100644 --- a/packages/client/ui-chat/README.md +++ b/packages/client/ui-chat/README.md @@ -54,7 +54,7 @@ The official user and steering renderer declares the session-scoped `conversatio Standalone Markdown images show contained previews and open the shared image lightbox; after settlement, an absolute local path loads as written and a relative one resolves against the Session’s current working directory, as a relative file link does. Image file links keep their sidebar activation and show a thumbnail after hover dwell or keyboard focus. Escape dismisses the thumbnail. Failed images retain a localized status and their description; no duplicate-image filtering is applied. -Settings → General → Open chat links in selects the destination for ordinary clicks on Chat HTTP(S) links: In-App Sidebar (default) opens a new right-Sidebar Browser tab, while Default Browser opens an external tab. The setting follows Keyboard shortcuts and is shown only while the Sidebar Browser is available. If the Sidebar Browser is not registered, both choices use the external browser; modified clicks retain native behavior. The `ui-chat.linkOpening` preference persists on the Host for authenticated browsers and stays process-local when settings cannot persist writes. Sent file references and skills confirmed by the message’s logged invocation also open in the right Sidebar. File paths use the viewed Session; skill names resolve through its current input-trigger source. Both use the prose file-link dotted underline on hover or focus. Sessions, directories, and command labels remain non-navigating references. +Settings → General → Open chat links in selects the destination for ordinary clicks on Chat HTTP(S) links: In-App Sidebar (default) opens a new right-Sidebar Browser tab, while Default Browser opens an external tab. The setting precedes Keyboard shortcuts and is shown only while the Sidebar Browser is available. If the Sidebar Browser is not registered, both choices use the external browser; modified clicks retain native behavior. The `ui-chat.linkOpening` preference persists on the Host for authenticated browsers and stays process-local when settings cannot persist writes. Sent file references and skills confirmed by the message’s logged invocation also open in the right Sidebar. File paths use the viewed Session; skill names resolve through its current input-trigger source. Both use the prose file-link dotted underline on hover or focus. Sessions, directories, and command labels remain non-navigating references. ## Hidden Chat rows @@ -90,7 +90,7 @@ A forked Session, such as a fork subagent or a branched conversation, shows a di A completed Turn shows an expandable usage row only when the loaded window includes `turn/start` and every started model attempt reports safe, exact usage. The row omits unavailable optional buckets. Incomplete or contradictory accounting hides the complete disclosure instead of presenting a partial total. -Settings → General → Performance & usage appears after Send behavior while busy and before Session Log upload, and stores `ui-chat.performanceUsage` as `detailed` (default) or `compact`. Compact shows only available output speed and cache-hit percentage beneath the composer, without interactive statistic dialogs or per-Turn usage. Detailed exposes session statistics and per-Turn token usage. Neither mode shows elapsed time in the completed-turn footer. The preference changes presentation only; accounting and Session events remain intact. +Settings → General → Chat experience → Performance & usage appears after Show coding view, and stores `ui-chat.performanceUsage` as `detailed` (default) or `compact`. Compact shows only available output speed and cache-hit percentage beneath the composer, without interactive statistic dialogs or per-Turn usage. Detailed exposes session statistics and per-Turn token usage. Neither mode shows elapsed time in the completed-turn footer. The preference changes presentation only; accounting and Session events remain intact. The composer statistics are two `conversation.composer.dock` list entries: `activity` (order 0, turn and step counts and output speed, with LLM time, tool time, and TTFT) and `usage` (order 1, token total and cache hit). The controls follow the shared [statistics-control radius](../../../docs/ui-radius.md#radius-scale). Another plugin replaces one control by registering the same id and the same `order`; the dock orders rows by `order`, while a lower `priority` picks the replacement: a dynamic plugin receives one automatically, and a statically composed plugin passes it explicitly. A new id adds a control. Each control carries its id in `data-composer-stat`. An open statistics dialog closes on Escape or on a pointerdown or click outside it, so activating another control by pointer or keyboard swaps dialogs instead of stacking them. When an ellipsis cuts off a reading, a tooltip shows the full reading. A dialog control shows it on hover or keyboard focus, but not while its dialog is open; a reading without a dialog shows it on hover, click, or tap. The session statistics dialog heads its rows with the turn and step counts. Statistics dialogs use CSS anchors and layout-viewport size limits; browser zoom and panning move them with the page, so they may extend beyond the visual viewport. Taller dialog content scrolls internally. diff --git a/packages/client/ui-chat/README.zh.md b/packages/client/ui-chat/README.zh.md index d8007dfb08..75af47f6d0 100644 --- a/packages/client/ui-chat/README.zh.md +++ b/packages/client/ui-chat/README.zh.md @@ -54,7 +54,7 @@ Session 作用域的 `conversation.chat.user.content` Factory 只渲染用户内 独立的 Markdown 图片以内嵌预览显示,点击打开共享图片浮层;消息落定后,绝对本地路径按原样加载,相对路径与相对文件链接一样按 Session 的当前工作目录解析。图片文件链接保持点击打开侧栏,鼠标停留或键盘聚焦时显示缩略图,Esc 关闭缩略图。图片加载失败时保留本地化状态与图片说明;不执行重复图片过滤。 -设置 → 通用设置 → 网页链接默认打开方式控制普通点击 Chat HTTP(S) 链接时的目标:「应用内侧边栏」(默认)打开新的右侧 Sidebar Browser tab,「默认浏览器」打开外部标签页。该设置项位于快捷键之后,仅在 Sidebar Browser 可用时显示。若 Sidebar Browser 未注册,两种选择均使用外部浏览器;带修饰键的点击保留原生行为。已认证浏览器的 `ui-chat.linkOpening` 偏好在 Host 上持久化,设置无法持久化写入时仅在当前进程内生效。已发送的文件引用及消息日志确认调用的 skill 也可在右侧栏打开预览。文件路径使用当前查看的 Session;skill 名称由该 Session 当前的输入触发源解析。两者悬停或聚焦时均使用正文文件链接的虚线下划线。会话、目录和命令标签仍只作为引用展示。 +设置 → 通用设置 → 网页链接默认打开方式控制普通点击 Chat HTTP(S) 链接时的目标:「应用内侧边栏」(默认)打开新的右侧 Sidebar Browser tab,「默认浏览器」打开外部标签页。该设置项位于快捷键之前,仅在 Sidebar Browser 可用时显示。若 Sidebar Browser 未注册,两种选择均使用外部浏览器;带修饰键的点击保留原生行为。已认证浏览器的 `ui-chat.linkOpening` 偏好在 Host 上持久化,设置无法持久化写入时仅在当前进程内生效。已发送的文件引用及消息日志确认调用的 skill 也可在右侧栏打开预览。文件路径使用当前查看的 Session;skill 名称由该 Session 当前的输入触发源解析。两者悬停或聚焦时均使用正文文件链接的虚线下划线。会话、目录和命令标签仍只作为引用展示。 ## Chat 隐藏的行 @@ -90,7 +90,7 @@ Chat 在 `MarkdownDelegateProvider.getTriggerProps` 接入处适配 Markdown 目 只有当已加载窗口包含 `turn/start`,且每次已启动的模型尝试都报告安全、精确的用量时,已完成轮次才显示可展开的用量行。该行会省略不可用的可选用量桶。记账不完整或相互矛盾时,整个详情都不显示,避免把部分总量冒充完整结果。 -设置 → 通用设置 → 性能与用量位于繁忙时的发送行为之后、Session Log 上传之前,将 `ui-chat.performanceUsage` 保存为 `detailed`(默认)或 `compact`。简洁模式仅在输入框下方显示可用的输出速度和缓存命中率,不显示统计交互卡片或每轮用量。详细模式提供会话统计和每轮 token 用量。两种模式的已完成轮次页脚均不显示耗时。该偏好仅影响展示,记账和 Session 事件保持完整。 +设置 → 通用设置 → 会话偏好 → 性能与用量位于显示代码工作视图之后,将 `ui-chat.performanceUsage` 保存为 `detailed`(默认)或 `compact`。简洁模式仅在输入框下方显示可用的输出速度和缓存命中率,不显示统计交互卡片或每轮用量。详细模式提供会话统计和每轮 token 用量。两种模式的已完成轮次页脚均不显示耗时。该偏好仅影响展示,记账和 Session 事件保持完整。 输入框统计信息由两个 `conversation.composer.dock` 列表条目组成:`activity`(order 0,轮次数、步骤数与输出速度,以及 LLM 耗时、工具耗时与 TTFT)和 `usage`(order 1,token 总量与缓存命中)。这些控件遵循公共的[统计控件圆角规则](../../../docs/ui-radius.zh.md#radius-scale)。其他插件以相同的 id 和相同的 `order` 注册即可替换某个控件;dock 按 `order` 排列各行,更低的 `priority` 决定由替换者渲染:动态插件会自动获得,静态组合的插件需显式传入。以新 id 注册则新增控件。每个控件在 `data-composer-stat` 中携带其 id。按下 Escape,或在已打开的对话框之外发生 pointerdown 或点击时,该对话框会关闭,因此用指针或键盘激活另一个控件会切换对话框,而不会叠加两个。读数被省略号截断时,提示气泡会显示完整读数。带对话框的控件在悬停或键盘聚焦时显示,对话框打开期间不显示;没有对话框的读数在悬停、点击或轻触时显示。会话统计对话框的标题行显示轮次数与步骤数。统计对话框通过 CSS 锚点定位,并按布局视口限制尺寸;浏览器缩放和平移时随页面移动,因此可以超出视觉视口。较高的对话框内容可在内部滚动。 diff --git a/packages/client/ui-chat/src/client/settings/LinkOpeningRow.tsx b/packages/client/ui-chat/src/client/settings/LinkOpeningRow.tsx index b17a3e4929..3ddc2dc4b1 100644 --- a/packages/client/ui-chat/src/client/settings/LinkOpeningRow.tsx +++ b/packages/client/ui-chat/src/client/settings/LinkOpeningRow.tsx @@ -18,7 +18,7 @@ export interface LinkOpeningRowInjected { /** Full Settings-row props. */ export type LinkOpeningRowProps = - PropsRuntime<'settings.general.item'> + PropsRuntime<'settings.general.group.interaction.item'> & PropsLocale<'chat'> & InjectFace diff --git a/packages/client/ui-chat/src/client/settings/PerformanceUsageRow.tsx b/packages/client/ui-chat/src/client/settings/PerformanceUsageRow.tsx index db05aaebb9..ed72ec2b34 100644 --- a/packages/client/ui-chat/src/client/settings/PerformanceUsageRow.tsx +++ b/packages/client/ui-chat/src/client/settings/PerformanceUsageRow.tsx @@ -14,7 +14,7 @@ export interface PerformanceUsageRowInjected extends PerformanceUsageInjected { /** Full Settings-row props. */ export type PerformanceUsageRowProps = - PropsRuntime<'settings.general.item'> + PropsRuntime<'settings.general.group.display.item'> & PropsLocale<'chat'> & InjectFace diff --git a/packages/client/ui-chat/src/client/settings/TranscriptViewRow.tsx b/packages/client/ui-chat/src/client/settings/TranscriptViewRow.tsx index ee0d5de836..fa5af80c20 100644 --- a/packages/client/ui-chat/src/client/settings/TranscriptViewRow.tsx +++ b/packages/client/ui-chat/src/client/settings/TranscriptViewRow.tsx @@ -27,7 +27,7 @@ export interface TranscriptViewRowInjected { /** Full Settings-row props. */ export type TranscriptViewRowProps = - PropsRuntime<'settings.general.item'> + PropsRuntime<'settings.general.group.display.item'> & PropsLocale<'chat'> & InjectFace diff --git a/packages/client/ui-conversation/src/client/settings/EnterBehaviorRow.tsx b/packages/client/ui-conversation/src/client/settings/EnterBehaviorRow.tsx index cf8588067f..06fe47d081 100644 --- a/packages/client/ui-conversation/src/client/settings/EnterBehaviorRow.tsx +++ b/packages/client/ui-conversation/src/client/settings/EnterBehaviorRow.tsx @@ -19,7 +19,7 @@ export interface EnterBehaviorRowInjected { /** Full Settings-row props. */ export type EnterBehaviorRowProps = - PropsRuntime<'settings.general.item'> + PropsRuntime<'settings.general.group.interaction.item'> & PropsLocale<'conversation'> & InjectFace diff --git a/packages/client/ui-permission-presets/src/client/PermissionRow.tsx b/packages/client/ui-permission-presets/src/client/PermissionRow.tsx index 2136974522..096a3a2e83 100644 --- a/packages/client/ui-permission-presets/src/client/PermissionRow.tsx +++ b/packages/client/ui-permission-presets/src/client/PermissionRow.tsx @@ -29,7 +29,7 @@ export interface PermissionRowInjected { /** Full component props. */ export type PermissionRowProps = - PropsRuntime<'settings.general.item'> + PropsRuntime<'settings.general.group.display.item'> & PropsLocale<'settings.permission'> & InjectFace diff --git a/packages/client/ui-settings-general/README.i18n.yaml b/packages/client/ui-settings-general/README.i18n.yaml index 98832f986e..f5bc3d3a81 100644 --- a/packages/client/ui-settings-general/README.i18n.yaml +++ b/packages/client/ui-settings-general/README.i18n.yaml @@ -18,8 +18,8 @@ en: 2b3320655142ffdf zh: 20dde077885f62aa /deepseek-ai-dsh-client-ui-settings-general/use-this-package/the-general-section: - en: 0219deacad831a49 - zh: 61b49ce41e859e65 + en: 12622f15a9689aaf + zh: 531bfab4d24355be /deepseek-ai-dsh-client-ui-settings-general/use-this-package/opening-the-configuration-file: en: 597df68b5913e8d7 zh: bc9114f3e877679a diff --git a/packages/client/ui-settings-general/README.md b/packages/client/ui-settings-general/README.md index cc442ebaa9..8cc467d80d 100644 --- a/packages/client/ui-settings-general/README.md +++ b/packages/client/ui-settings-general/README.md @@ -56,7 +56,6 @@ Register into an existing group’s item slot to choose its location: | Group ID | Order | Item slot | |---|---|---| -| `permissions` | 0 | `settings.general.group.permissions.item` | | `general` | 10 | `settings.general.item` | | `display` | 20 | `settings.general.group.display.item` | | `interaction` | 30 | `settings.general.group.interaction.item` | @@ -64,7 +63,7 @@ Register into an existing group’s item slot to choose its location: | `data` | 50 | `settings.general.group.data.item` | | `updates` | 60 | `settings.general.group.updates.item` | -The default Preferences group retains language, appearance, fonts, and additive `settings.general.item` contributions. Chat experience contains Default session permission, the three work-details preferences (Work details, When to collapse work details, and Replies after collapse), Personalized recommendations, Show coding view, and performance/usage, in that order; Interaction contains busy-session sending, link opening, and shortcuts. Data management contains Session log preferences. The Permissions group remains an extension target with no built-in rows and stays hidden until a plugin supplies content. Item `id` and `order` apply within the chosen slot; no `groupId` option is needed. +The default Preferences group retains language, appearance, fonts, and additive `settings.general.item` contributions. Chat experience contains Default session permission, the three work-details preferences (Work details, When to collapse work details, and Replies after collapse), Personalized recommendations, Show coding view, and performance/usage, in that order; Interaction contains busy-session sending, link opening, and shortcuts. Data management contains Session log preferences. Notifications stays hidden until a plugin supplies rows. Item `id` and `order` apply within the chosen slot; no `groupId` option is needed. A custom group declaration-merges its exact item key into `SlotMap`, registers its own component, and declares that item slot at runtime in `children`. The component renders the child outlet through `PropsRenderSlots`; the page supplies the surrounding header and card. Given `ctx` in your plugin’s `apply`, a namespace-bound `t`, and your module-level `AcmeRow` component, register: diff --git a/packages/client/ui-settings-general/README.zh.md b/packages/client/ui-settings-general/README.zh.md index 90e666607a..3af7119389 100644 --- a/packages/client/ui-settings-general/README.zh.md +++ b/packages/client/ui-settings-general/README.zh.md @@ -56,7 +56,6 @@ Web 与桌面端的通用设置底部显示当前发布版本,使用构建注 | 分组 ID | 顺序 | 设置行 slot | |---|---|---| -| `permissions` | 0 | `settings.general.group.permissions.item` | | `general` | 10 | `settings.general.item` | | `display` | 20 | `settings.general.group.display.item` | | `interaction` | 30 | `settings.general.group.interaction.item` | @@ -64,7 +63,7 @@ Web 与桌面端的通用设置底部显示当前发布版本,使用构建注 | `data` | 50 | `settings.general.group.data.item` | | `updates` | 60 | `settings.general.group.updates.item` | -默认「常规」分组保留语言、外观、字体,以及通过 `settings.general.item` 添加的贡献。「会话偏好」依次包含会话默认权限、工作步骤的三项偏好(工作步骤展示、工作步骤收起时机和收起后显示的回复)、个性化推荐、显示代码工作视图,以及性能与用量;「交互与快捷键」包含繁忙时发送、链接打开方式和快捷键。「数据管理」包含会话日志偏好。「权限」分组仍可供扩展注册,但没有内置设置行,在插件提供内容前保持隐藏。设置行的 `id` 与 `order` 仅作用于所选 slot;无需 `groupId` 选项。 +默认「常规」分组保留语言、外观、字体,以及通过 `settings.general.item` 添加的贡献。「会话偏好」依次包含会话默认权限、工作步骤的三项偏好(工作步骤展示、工作步骤收起时机和收起后显示的回复)、个性化推荐、显示代码工作视图,以及性能与用量;「交互与快捷键」包含繁忙时发送、链接打开方式和快捷键。「数据管理」包含会话日志偏好。「通知」分组在插件提供设置行前保持隐藏。设置行的 `id` 与 `order` 仅作用于所选 slot;无需 `groupId` 选项。 自定义分组通过声明合并把确切的设置行 key 加入 `SlotMap`,注册自己的组件,并在 `children` 中声明该设置行 slot 的运行时类型。组件通过 `PropsRenderSlots` 渲染子 outlet;页面提供外层标题和卡片。已有插件 `apply` 中的 `ctx`、绑定命名空间的 `t` 和模块级 `AcmeRow` 组件时,可这样注册: diff --git a/packages/client/ui-settings-general/src/client/CurrentVersionRow.tsx b/packages/client/ui-settings-general/src/client/CurrentVersionRow.tsx index e3c8cb702f..e104e40e3a 100644 --- a/packages/client/ui-settings-general/src/client/CurrentVersionRow.tsx +++ b/packages/client/ui-settings-general/src/client/CurrentVersionRow.tsx @@ -7,7 +7,7 @@ import css from './CurrentVersionRow.module.css' * @param props - runtime share and localized copy. * @returns the current release label, or nothing when build metadata is absent. */ -export function CurrentVersionRow({ t }: PropsRuntime<'settings.general.item'> & PropsLocale<'settings'>) { +export function CurrentVersionRow({ t }: PropsRuntime<'settings.general.group.updates.item'> & PropsLocale<'settings'>) { const version = process.env.DSH_CLIENT_VERSION if (version === undefined) return null return
{t('general.currentVersion', { version })}
diff --git a/packages/client/ui-settings-general/src/client/DesktopChannelRow.tsx b/packages/client/ui-settings-general/src/client/DesktopChannelRow.tsx index 4027e7bf47..b0bc8bde9a 100644 --- a/packages/client/ui-settings-general/src/client/DesktopChannelRow.tsx +++ b/packages/client/ui-settings-general/src/client/DesktopChannelRow.tsx @@ -18,7 +18,7 @@ export interface DesktopChannelRowInjected { * @returns The General settings row. */ export function DesktopChannelRow({ useChannel, select, t }: - PropsRuntime<'settings.general.item'> & PropsLocale<'settings'> & InjectFace) { + PropsRuntime<'settings.general.group.updates.item'> & PropsLocale<'settings'> & InjectFace) { const { state, failed, pending } = useChannel(value => value) const [open, setOpen] = useState(false) const busy = pending !== undefined || state?.changing === true diff --git a/packages/client/ui-settings-general/src/client/DeveloperToolsRow.tsx b/packages/client/ui-settings-general/src/client/DeveloperToolsRow.tsx index bedc732892..197a017231 100644 --- a/packages/client/ui-settings-general/src/client/DeveloperToolsRow.tsx +++ b/packages/client/ui-settings-general/src/client/DeveloperToolsRow.tsx @@ -17,7 +17,7 @@ export interface DeveloperToolsRowInjected { * @returns the General Settings row. */ export function DeveloperToolsRow({ useDeveloperTools, setEnabled, t }: - PropsRuntime<'settings.general.item'> & PropsLocale<'settings'> & InjectFace) { + PropsRuntime<'settings.general.group.display.item'> & PropsLocale<'settings'> & InjectFace) { const enabled = useDeveloperTools(value => value) const [busy, setBusy] = useState(false) const [failed, setFailed] = useState(false) diff --git a/packages/client/ui-settings-general/src/client/GeneralGroup.tsx b/packages/client/ui-settings-general/src/client/GeneralGroup.tsx index 118c293cc2..258925d566 100644 --- a/packages/client/ui-settings-general/src/client/GeneralGroup.tsx +++ b/packages/client/ui-settings-general/src/client/GeneralGroup.tsx @@ -9,11 +9,6 @@ export function GeneralGroup({ renderSlot }: GroupProps<'settings.general.item'> return renderSlot('settings.general.item', {}) } -/** @param props - authorized permissions renderer. @returns the permission preferences. */ -export function PermissionsGroup({ renderSlot }: GroupProps<'settings.general.group.permissions.item'>) { - return renderSlot('settings.general.group.permissions.item', {}) -} - /** @param props - authorized display renderer. @returns the session display preferences. */ export function DisplayGroup({ renderSlot }: GroupProps<'settings.general.group.display.item'>) { return renderSlot('settings.general.group.display.item', {}) diff --git a/packages/client/ui-settings-general/src/client/GeneralSection.module.css b/packages/client/ui-settings-general/src/client/GeneralSection.module.css index 858d7edf18..889a3e4054 100644 --- a/packages/client/ui-settings-general/src/client/GeneralSection.module.css +++ b/packages/client/ui-settings-general/src/client/GeneralSection.module.css @@ -46,8 +46,8 @@ } /* Empty outlets remain mounted so late registrations can reveal the group. */ -.group:has(.card > [data-slot='settings.general.group']:empty), -.group:has(.card > [data-slot='settings.general.group'] > [data-slot]:only-child:empty) { +.group:has(.card > [data-slot='settings.general.group'] > [data-slot-item]:empty), +.group:has(.card > [data-slot='settings.general.group'] > [data-slot-item] > [data-slot]:only-child:empty) { display: none; } diff --git a/packages/client/ui-settings-general/src/client/index.ts b/packages/client/ui-settings-general/src/client/index.ts index 998e0aca5f..aa8d0fae46 100644 --- a/packages/client/ui-settings-general/src/client/index.ts +++ b/packages/client/ui-settings-general/src/client/index.ts @@ -41,7 +41,7 @@ import { DesktopUpdateSource } from './desktop-update-source.ts' import { CloseLabel, HeaderContent, TriggerContent } from './chrome.tsx' import { GeneralSection, type GeneralSectionInjected } from './GeneralSection.tsx' import { SettingsSectionView } from './SettingsSectionView.tsx' -import { GeneralGroup, PermissionsGroup, DisplayGroup, InteractionGroup, NotificationsGroup, DataGroup, UpdatesGroup } from './GeneralGroup.tsx' +import { GeneralGroup, DisplayGroup, InteractionGroup, NotificationsGroup, DataGroup, UpdatesGroup } from './GeneralGroup.tsx' import { CurrentVersionRow } from './CurrentVersionRow.tsx' import { DeveloperToolsRow, type DeveloperToolsRowInjected } from './DeveloperToolsRow.tsx' import { SettingsDocumentAction } from './SettingsDocumentAction.tsx' @@ -132,11 +132,6 @@ export function apply(ctx: ClientContext): void { // seat, and the nav label is a thunk the owner resolves per render — no // locale/change re-registration wiring. const t = ctx.locale.bind(NS) - ctx.slots.inject('settings.general.group', () => ctx.slots.register({ - name: 'settings.general.group', id: 'permissions', order: 0, - label: () => t('general.group.permissions'), - children: { 'settings.general.group.permissions.item': { kind: 'list', scope: 'root' } }, - }, PermissionsGroup)) ctx.slots.inject('settings.general.group', () => ctx.slots.register({ name: 'settings.general.group', id: 'general', order: 10, label: () => t('general.group.general'), diff --git a/packages/client/ui-settings-general/src/client/locales.ts b/packages/client/ui-settings-general/src/client/locales.ts index c1f4891b19..0771a4c1ed 100644 --- a/packages/client/ui-settings-general/src/client/locales.ts +++ b/packages/client/ui-settings-general/src/client/locales.ts @@ -51,7 +51,6 @@ export const zh = { 'openDocument': '打开配置文件', 'openDocument.error': '无法打开配置文件', 'general.nav': '通用设置', - 'general.group.permissions': '权限', 'general.group.general': '常规', 'general.group.display': '会话偏好', 'general.group.interaction': '交互与快捷键', @@ -130,7 +129,6 @@ export const en = { 'openDocument': 'Open configuration file', 'openDocument.error': 'Could not open configuration file', 'general.nav': 'General', - 'general.group.permissions': 'Permissions', 'general.group.general': 'Preferences', 'general.group.display': 'Chat experience', 'general.group.interaction': 'Interaction and shortcuts', @@ -206,7 +204,6 @@ export const ja = { 'openDocument': '設定ファイルを開く', 'openDocument.error': '設定ファイルを開けませんでした', 'general.nav': '一般', - 'general.group.permissions': '権限', 'general.group.general': '環境設定', 'general.group.display': 'チャット体験', 'general.group.interaction': '操作とキーボードショートカット', @@ -282,7 +279,6 @@ export const es = { 'openDocument': 'Abrir archivo de configuración', 'openDocument.error': 'No se pudo abrir el archivo de configuración', 'general.nav': 'General', - 'general.group.permissions': 'Permisos', 'general.group.general': 'Preferencias', 'general.group.display': 'Experiencia de chat', 'general.group.interaction': 'Interacción y atajos de teclado', @@ -358,7 +354,6 @@ export const fr = { 'openDocument': 'Ouvrir le fichier de configuration', 'openDocument.error': "Impossible d'ouvrir le fichier de configuration", 'general.nav': 'Général', - 'general.group.permissions': 'Autorisations', 'general.group.general': 'Préférences', 'general.group.display': 'Expérience de chat', 'general.group.interaction': 'Interaction et raccourcis clavier', @@ -434,7 +429,6 @@ export const de = { 'openDocument': 'Konfigurationsdatei öffnen', 'openDocument.error': 'Die Konfigurationsdatei konnte nicht geöffnet werden', 'general.nav': 'Allgemein', - 'general.group.permissions': 'Berechtigungen', 'general.group.general': 'Voreinstellungen', 'general.group.display': 'Chat-Erlebnis', 'general.group.interaction': 'Interaktion und Tastaturkürzel', @@ -510,7 +504,6 @@ export const ru = { 'openDocument': 'Открыть файл конфигурации', 'openDocument.error': 'Не удалось открыть файл конфигурации', 'general.nav': 'Общие', - 'general.group.permissions': 'Разрешения', 'general.group.general': 'Предпочтения', 'general.group.display': 'Работа с чатом', 'general.group.interaction': 'Взаимодействие и сочетания клавиш', @@ -586,7 +579,6 @@ export const pt = { 'openDocument': 'Abra o arquivo de configuração', 'openDocument.error': 'Não foi possível abrir o arquivo de configuração', 'general.nav': 'Geral', - 'general.group.permissions': 'Permissões', 'general.group.general': 'Preferências', 'general.group.display': 'Experiência de chat', 'general.group.interaction': 'Interação e atalhos de teclado', diff --git a/packages/client/ui-settings-general/tests/components.client.spec.tsx b/packages/client/ui-settings-general/tests/components.client.spec.tsx index f81f0717a2..cdfab65c64 100644 --- a/packages/client/ui-settings-general/tests/components.client.spec.tsx +++ b/packages/client/ui-settings-general/tests/components.client.spec.tsx @@ -9,7 +9,7 @@ import { allowAllAccess, bindSnapshotSelector, RemoteError } from '@deepseek-ai/ import type { GeneralSectionComponentProps } from '../src/client/GeneralSection.tsx' import { GeneralSection } from '../src/client/GeneralSection.tsx' import { - GeneralGroup, PermissionsGroup, DisplayGroup, InteractionGroup, NotificationsGroup, DataGroup, UpdatesGroup, + GeneralGroup, DisplayGroup, InteractionGroup, NotificationsGroup, DataGroup, UpdatesGroup, } from '../src/client/GeneralGroup.tsx' import { CloseLabel, HeaderContent, TriggerContent } from '../src/client/chrome.tsx' import type { TriggerContentProps } from '../src/client/chrome.tsx' @@ -133,7 +133,6 @@ describe('chrome content', () => { describe('General group bodies', () => { it.each([ [GeneralGroup, 'settings.general.item'], - [PermissionsGroup, 'settings.general.group.permissions.item'], [DisplayGroup, 'settings.general.group.display.item'], [InteractionGroup, 'settings.general.group.interaction.item'], [NotificationsGroup, 'settings.general.group.notifications.item'], diff --git a/packages/client/ui-settings-general/tests/groups.client.spec.tsx b/packages/client/ui-settings-general/tests/groups.client.spec.tsx index b2bc54a96d..01e3c74688 100644 --- a/packages/client/ui-settings-general/tests/groups.client.spec.tsx +++ b/packages/client/ui-settings-general/tests/groups.client.spec.tsx @@ -35,9 +35,9 @@ afterAll(() => { const GROUP_OWNER = 'test-settings-group-owner' const ROW_OWNER = 'test-settings-group-rows' const CUSTOM_SLOT = 'settings.general.group.custom.item' -const BUILTIN_IDS = ['permissions', 'general', 'display', 'interaction', 'notifications', 'data', 'updates'] -const ZH_LABELS = ['权限', '常规', '会话偏好', '交互与快捷键', '通知', '数据管理', '版本与更新'] -const EN_LABELS = ['Permissions', 'Preferences', 'Chat experience', 'Interaction and shortcuts', 'Notifications', 'Data management', 'Version and updates'] +const BUILTIN_IDS = ['general', 'display', 'interaction', 'notifications', 'data', 'updates'] +const ZH_LABELS = ['常规', '会话偏好', '交互与快捷键', '通知', '数据管理', '版本与更新'] +const EN_LABELS = ['Preferences', 'Chat experience', 'Interaction and shortcuts', 'Notifications', 'Data management', 'Version and updates'] function CustomGroup({ renderSlot }: PropsRuntime<'settings.general.group'> & PropsRenderSlots) { return renderSlot(CUSTOM_SLOT, {}) @@ -114,10 +114,18 @@ it('assembles ordered localized groups, legacy and targeted rows, and restores c expect(product.map(row => row.id)).toEqual(BUILTIN_IDS) expect(product.map(row => row.label)).toEqual(ZH_LABELS) expect(client.ctx.slots.entries('settings.general.group').map(row => row.options.order)) - .toEqual([0, 10, 15, 20, 30, 40, 50, 60]) + .toEqual([10, 15, 20, 30, 40, 50, 60]) + // A registrant that omits both order and label still projects a first-position row. + let removeBare = () => {} + act(() => { + removeBare = client.ctx.slots.register({ name: 'settings.general.group', id: 'bare' } as never, NullRow) + }) + expect(groups.getSnapshot()[0]).toEqual({ id: 'bare', label: '' }) + act(() => { removeBare() }) + expect(groups.getSnapshot().some(row => row.id === 'bare')).toBe(false) expect(client.ctx.slots.entries('settings.general.group').filter(row => row.options.id !== 'custom') .map(row => Object.keys(row.children ?? {}))).toEqual([ - ['settings.general.group.permissions.item'], ['settings.general.item'], + ['settings.general.item'], ['settings.general.group.display.item'], ['settings.general.group.interaction.item'], ['settings.general.group.notifications.item'], ['settings.general.group.data.item'], ['settings.general.group.updates.item'], @@ -127,7 +135,7 @@ it('assembles ordered localized groups, legacy and targeted rows, and restores c { id: 'composer-enter', order: 0 }, { id: 'link-opening', order: 10 }, { id: 'shortcuts', order: 20 }, ]) expect(groups.getSnapshot().map(row => row.id)) - .toEqual(['permissions', 'general', 'custom', 'display', 'interaction', 'notifications', 'data', 'updates']) + .toEqual(['general', 'custom', 'display', 'interaction', 'notifications', 'data', 'updates']) expect(groups.getSnapshot()).toBe(groups.getSnapshot()) expect(client.ctx.slots.spec(CUSTOM_SLOT)).toEqual({ kind: 'list', scope: 'root' }) expect(client.ctx.slots.entries(CUSTOM_SLOT).map(row => row.options.id)).toEqual(['custom-child', 'null-child']) @@ -139,7 +147,7 @@ it('assembles ordered localized groups, legacy and targeted rows, and restores c expect(within(screen.getByRole('region', { name: '常规' })).getByText('Legacy general preference')).toBeTruthy() expect(within(screen.getByRole('region', { name: '会话偏好' })).getByText('Targeted display preference')).toBeTruthy() expect(screen.getAllByRole('heading', { level: 3 }).map(row => row.textContent)) - .toEqual(['权限', '常规', '扩展偏好', '会话偏好', '交互与快捷键', '通知', '数据管理', '版本与更新']) + .toEqual(['常规', '扩展偏好', '会话偏好', '交互与快捷键', '通知', '数据管理', '版本与更新']) let removeShadow = () => {} act(() => { @@ -152,7 +160,7 @@ it('assembles ordered localized groups, legacy and targeted rows, and restores c expect(client.ctx.slots.entries('settings.general.group').filter(row => row.options.id === 'custom')).toHaveLength(2) expect(groups.getSnapshot().filter(row => row.id === 'custom')).toEqual([{ id: 'custom', label: '扩展偏好' }]) expect(groups.getSnapshot().map(row => row.id)) - .toEqual(['permissions', 'general', 'custom', 'display', 'interaction', 'notifications', 'data', 'updates']) + .toEqual(['general', 'custom', 'display', 'interaction', 'notifications', 'data', 'updates']) expect(screen.getAllByRole('region', { name: '扩展偏好' })).toHaveLength(1) expect(screen.queryByRole('region', { name: 'Shadowed preferences' })).toBeNull() expect(screen.getAllByText('Custom child preference')).toHaveLength(1) @@ -178,7 +186,7 @@ it('assembles ordered localized groups, legacy and targeted rows, and restores c await client.flush() expect(client.ctx.slots.entries(CUSTOM_SLOT).map(row => row.options.id)).toEqual(['custom-child', 'null-child']) expect(screen.getAllByText('Custom child preference')).toHaveLength(1) - expect(groups.getSnapshot().map(row => row.id)).toEqual(['permissions', 'general', 'custom', 'display', 'interaction', 'notifications', 'data', 'updates']) + expect(groups.getSnapshot().map(row => row.id)).toEqual(['general', 'custom', 'display', 'interaction', 'notifications', 'data', 'updates']) await client.unload(GROUP_OWNER) await client.flush() diff --git a/packages/client/ui-settings-session-log/README.i18n.yaml b/packages/client/ui-settings-session-log/README.i18n.yaml index 1ae4954c16..8ba1c851b8 100644 --- a/packages/client/ui-settings-session-log/README.i18n.yaml +++ b/packages/client/ui-settings-session-log/README.i18n.yaml @@ -9,7 +9,7 @@ en: 12fe698ae615f9ea zh: a6331c5e6a70830b /deepseek-ai-dsh-client-ui-settings-session-log/summary: - en: 39c3846ca9dfd3e4 + en: b0900c996ef27d6d zh: 8a745b54482403f8 /deepseek-ai-dsh-client-ui-settings-session-log/table-of-contents: en: d152484eb41ac6b4 @@ -18,7 +18,7 @@ en: 57f1a5defa6e8d89 zh: 88525c972f18b6ac /deepseek-ai-dsh-client-ui-settings-session-log/understand-the-implementation: - en: 573cd565e22a6f6e + en: 4c1d962264f31a64 zh: d214978ce1c43a86 /deepseek-ai-dsh-client-ui-settings-session-log/further-exploration: en: a78c5129dd79131e diff --git a/packages/client/ui-settings-session-log/README.md b/packages/client/ui-settings-session-log/README.md index 8da5994678..10d6ae2b77 100644 --- a/packages/client/ui-settings-session-log/README.md +++ b/packages/client/ui-settings-session-log/README.md @@ -9,7 +9,7 @@ English | [中文](README.zh.md) ## Summary -Use **Upload Session Log when using the official model API** above the version number in **Settings → General** to control Session-log upload with DeepSeek API requests. The switch shows the accepted Host setting and saves each change immediately. It appears only while the Host exposes the upload setting; read-only clients cannot change it. +Use **Upload session log when using the official model API** in **Settings → General → Data management** to control Session-log upload with DeepSeek API requests. The switch shows the accepted Host setting and saves each change immediately. It appears only while the Host exposes the upload setting; read-only clients cannot change it. ## Table of Contents @@ -35,7 +35,7 @@ The Web bundle mounts this companion. Its switch edits the Host plugin's `enable
Implementation details — click to expand -The companion contributes a `settings.general.item` row while `session-log-deepseek` is served and a `shell.overlay` toast for mutation outcomes. The shared form owns persistence and reconnect synchronization; the companion owns only pending-write state and localized notices. +The companion contributes a `settings.general.group.data.item` row while `session-log-deepseek` is served and a `shell.overlay` toast for mutation outcomes. The shared form owns persistence and reconnect synchronization; the companion owns only pending-write state and localized notices.
diff --git a/packages/client/ui-settings-session-log/src/client/UploadRow.tsx b/packages/client/ui-settings-session-log/src/client/UploadRow.tsx index 458752156c..0270bd3ac1 100644 --- a/packages/client/ui-settings-session-log/src/client/UploadRow.tsx +++ b/packages/client/ui-settings-session-log/src/client/UploadRow.tsx @@ -23,7 +23,7 @@ type Face = InjectFace & PropsLocale<'settings.sessionLog'> * @param props - settings hooks, writer and localized copy. * @returns the bottom preference row. */ -export function UploadRow({ useUpload, useMutation, setEnabled, t }: PropsRuntime<'settings.general.item'> & Face) { +export function UploadRow({ useUpload, useMutation, setEnabled, t }: PropsRuntime<'settings.general.group.data.item'> & Face) { const upload = useUpload(value => value) const busy = useMutation(value => value.busy) return
diff --git a/packages/client/ui-settings/src/client/contract/slots.ts b/packages/client/ui-settings/src/client/contract/slots.ts index 8ab7f4dc70..d8382c897d 100644 --- a/packages/client/ui-settings/src/client/contract/slots.ts +++ b/packages/client/ui-settings/src/client/contract/slots.ts @@ -103,8 +103,6 @@ declare module '@deepseek-ai/dsh-client-ui-slots' { * registrant owns content and any child item-slot declarations. */ 'settings.general.group': { kind: 'list'; scope: 'root'; owner: SettingsGeneralGroupOwnerProps } - /** Default permission preferences. */ - 'settings.general.group.permissions.item': { kind: 'list'; scope: 'root'; owner: SettingsGeneralItemOwnerProps } /** Session and work-step display preferences. */ 'settings.general.group.display.item': { kind: 'list'; scope: 'root'; owner: SettingsGeneralItemOwnerProps } /** Sending behavior, shortcuts, and link preferences. */ @@ -126,7 +124,6 @@ declare module '@deepseek-ai/dsh-client-ui-slots' { } /** Built-in group item slots; custom groups declare their own SlotMap keys. */ export type SettingsGeneralGroupItemSlot = - | 'settings.general.group.permissions.item' | 'settings.general.group.display.item' | 'settings.general.group.interaction.item' | 'settings.general.group.notifications.item' diff --git a/packages/client/ui-shortcuts/src/client/Reference.tsx b/packages/client/ui-shortcuts/src/client/Reference.tsx index 8a63b237d5..7990f33e7a 100644 --- a/packages/client/ui-shortcuts/src/client/Reference.tsx +++ b/packages/client/ui-shortcuts/src/client/Reference.tsx @@ -52,7 +52,7 @@ const coreActionOrder = new Map([ * @param props - shared dialog action and localized labels. * @returns the settings row. */ -export function ShortcutsRow({ actions, t, useCatalog }: PropsRuntime<'settings.general.item'> & Store & Locale & InjectFace) { +export function ShortcutsRow({ actions, t, useCatalog }: PropsRuntime<'settings.general.group.interaction.item'> & Store & Locale & InjectFace) { const shortcut = useCatalog(rows => rows.find(row => row.id === 'shortcuts.open')) return
diff --git a/packages/extensions/cordis-client-runner/src/client/slot-catalog.ts b/packages/extensions/cordis-client-runner/src/client/slot-catalog.ts index 37f808a6e2..4d4d383724 100644 --- a/packages/extensions/cordis-client-runner/src/client/slot-catalog.ts +++ b/packages/extensions/cordis-client-runner/src/client/slot-catalog.ts @@ -4139,7 +4139,6 @@ export const CLIENT_SLOT_API: readonly ClientSlotEntry[] = [ slotInject: '', declaredBy: 'an entry in \'settings.section\' (client-ui-settings-general), so it exists while that entry is mounted', occupants: [ - 'client-ui-settings-general PermissionsGroup id \'permissions\'', 'client-ui-settings-general GeneralGroup id \'general\'', 'client-ui-settings-general DisplayGroup id \'display\'', 'client-ui-settings-general InteractionGroup id \'interaction\'', @@ -4202,7 +4201,7 @@ export const CLIENT_SLOT_API: readonly ClientSlotEntry[] = [ ], replaceRisk: 'none', example: 'return {\n inject: [\'slots\'],\n apply(ctx) {\n ctx.slots.inject(\'settings.general.group.data.item\', () => ctx.slots.register(\n { name: \'settings.general.group.data.item\', id: \'my-entry\', order: 100, label: \'My entry\' },\n () => React.createElement(\'div\', null, \'hello\'),\n ))\n },\n}', - source: 'packages/client/ui-settings/src/client/contract/slots.ts:115', + source: 'packages/client/ui-settings/src/client/contract/slots.ts:113', }, { key: 'settings.general.group.display.item', @@ -4259,7 +4258,7 @@ export const CLIENT_SLOT_API: readonly ClientSlotEntry[] = [ ], replaceRisk: 'none', example: 'return {\n inject: [\'slots\'],\n apply(ctx) {\n ctx.slots.inject(\'settings.general.group.display.item\', () => ctx.slots.register(\n { name: \'settings.general.group.display.item\', id: \'my-entry\', order: 100, label: \'My entry\' },\n () => React.createElement(\'div\', null, \'hello\'),\n ))\n },\n}', - source: 'packages/client/ui-settings/src/client/contract/slots.ts:109', + source: 'packages/client/ui-settings/src/client/contract/slots.ts:107', }, { key: 'settings.general.group.interaction.item', @@ -4314,7 +4313,7 @@ export const CLIENT_SLOT_API: readonly ClientSlotEntry[] = [ ], replaceRisk: 'none', example: 'return {\n inject: [\'slots\'],\n apply(ctx) {\n ctx.slots.inject(\'settings.general.group.interaction.item\', () => ctx.slots.register(\n { name: \'settings.general.group.interaction.item\', id: \'my-entry\', order: 100, label: \'My entry\' },\n () => React.createElement(\'div\', null, \'hello\'),\n ))\n },\n}', - source: 'packages/client/ui-settings/src/client/contract/slots.ts:111', + source: 'packages/client/ui-settings/src/client/contract/slots.ts:109', }, { key: 'settings.general.group.notifications.item', @@ -4365,58 +4364,7 @@ export const CLIENT_SLOT_API: readonly ClientSlotEntry[] = [ occupants: [], replaceRisk: 'none', example: 'return {\n inject: [\'slots\'],\n apply(ctx) {\n ctx.slots.inject(\'settings.general.group.notifications.item\', () => ctx.slots.register(\n { name: \'settings.general.group.notifications.item\', id: \'my-entry\', order: 100, label: \'My entry\' },\n () => React.createElement(\'div\', null, \'hello\'),\n ))\n },\n}', - source: 'packages/client/ui-settings/src/client/contract/slots.ts:113', - }, - { - key: 'settings.general.group.permissions.item', - kind: 'list', - scope: 'root', - summary: 'Default permission preferences.', - doc: 'Default permission preferences.', - registerOptions: [ - { - name: 'id', - requirement: 'required', - type: 'string', - doc: 'Your cell key. Use an id of your own: a fresh id is added beside the shipped entries, while reusing a shipped id puts you in THAT cell and replaces it. Owners that filter by id address you by it.', - }, - { - name: 'order', - requirement: 'optional', - type: 'number', - doc: 'Position among the entries, ascending (default 0).', - }, - { - name: 'label', - requirement: 'optional', - type: 'string | (() => string)', - doc: 'Display text where the owner projects one (nav rows, tabs). A thunk is re-read on every projection, so localized text follows the active locale without re-registering.', - }, - ], - ownerProps: [ - '/** Owner share of a General preference row (the section supplies nothing). */\nexport interface SettingsGeneralItemOwnerProps {\n /** Marker field: item owner props are intentionally empty. */\n children?: never\n}', - ], - ownerPropsReferences: [], - standardProps: [ - 'useRemoteAccess: (action: RemoteEndpoint) => boolean', - 'useResource: UseResource', - 'useContextMenu: UseContextMenu', - 'useWorkspaces: SnapshotSelectorHook', - 'usePanelInfo: UsePanelInfo', - 'useSessionStatus: UseSessionStatus', - 'useSessions: UseSessions', - 'useSessionRetainInfo: UseSessionRetainInfo', - 'useSessionAccess: (sessionId: SessionId, action: RemoteEndpoint) => boolean', - 'useWorkspaceAccess: (workspaceId: WorkspaceId, action: RemoteEndpoint) => boolean', - ], - keyDomain: '', - hookContext: '', - slotInject: '', - declaredBy: 'an entry in \'settings.general.group\' (client-ui-settings-general), so it exists while that entry is mounted', - occupants: [], - replaceRisk: 'none', - example: 'return {\n inject: [\'slots\'],\n apply(ctx) {\n ctx.slots.inject(\'settings.general.group.permissions.item\', () => ctx.slots.register(\n { name: \'settings.general.group.permissions.item\', id: \'my-entry\', order: 100, label: \'My entry\' },\n () => React.createElement(\'div\', null, \'hello\'),\n ))\n },\n}', - source: 'packages/client/ui-settings/src/client/contract/slots.ts:107', + source: 'packages/client/ui-settings/src/client/contract/slots.ts:111', }, { key: 'settings.general.group.updates.item', @@ -4470,7 +4418,7 @@ export const CLIENT_SLOT_API: readonly ClientSlotEntry[] = [ ], replaceRisk: 'none', example: 'return {\n inject: [\'slots\'],\n apply(ctx) {\n ctx.slots.inject(\'settings.general.group.updates.item\', () => ctx.slots.register(\n { name: \'settings.general.group.updates.item\', id: \'my-entry\', order: 100, label: \'My entry\' },\n () => React.createElement(\'div\', null, \'hello\'),\n ))\n },\n}', - source: 'packages/client/ui-settings/src/client/contract/slots.ts:117', + source: 'packages/client/ui-settings/src/client/contract/slots.ts:115', }, { key: 'settings.general.item', @@ -4525,7 +4473,7 @@ export const CLIENT_SLOT_API: readonly ClientSlotEntry[] = [ ], replaceRisk: 'none', example: 'return {\n inject: [\'slots\'],\n apply(ctx) {\n ctx.slots.inject(\'settings.general.item\', () => ctx.slots.register(\n { name: \'settings.general.item\', id: \'my-entry\', order: 100, label: \'My entry\' },\n () => React.createElement(\'div\', null, \'hello\'),\n ))\n },\n}', - source: 'packages/client/ui-settings/src/client/contract/slots.ts:124', + source: 'packages/client/ui-settings/src/client/contract/slots.ts:122', }, { key: 'settings.header', diff --git a/packages/session/session-log-deepseek/README.i18n.yaml b/packages/session/session-log-deepseek/README.i18n.yaml index 3fec12ee52..f5cf293f7b 100644 --- a/packages/session/session-log-deepseek/README.i18n.yaml +++ b/packages/session/session-log-deepseek/README.i18n.yaml @@ -15,7 +15,7 @@ en: eb945093933ee19b zh: 7a40fe2e98a491c5 /deepseek-ai-dsh-session-log-deepseek/configuration: - en: 1b899e63d8039643 + en: 01e38210905d95bf zh: d489461bbb618b5d /deepseek-ai-dsh-session-log-deepseek/request-field: en: f11095717a9aec6f diff --git a/packages/session/session-log-deepseek/README.md b/packages/session/session-log-deepseek/README.md index f686732ba9..13ef709ffe 100644 --- a/packages/session/session-log-deepseek/README.md +++ b/packages/session/session-log-deepseek/README.md @@ -33,7 +33,7 @@ Incremental canonical session-log upload for official DeepSeek LLM API requests. Shipped profiles mount the plugin, so the default configuration registers the request field and appends the acceptance watermark; `enabled: false` stops the contribution. The Web switch can override bundle defaults through the active profile; home patches and command-line overlays retain precedence and reject conflicting form writes. -The Web **Settings → General → Upload Session Log when using the official model API** switch persists `enabled` through the Host configuration. In-flight requests keep their prepared payload. Re-enabling resumes the unaccepted suffix, including events recorded while disabled. OpenTelemetry feedback uploads have a separate setting. +The Web **Settings → General → Data management → Upload session log when using the official model API** switch persists `enabled` through the Host configuration. In-flight requests keep their prepared payload. Re-enabling resumes the unaccepted suffix, including events recorded while disabled. OpenTelemetry feedback uploads have a separate setting. ## Request field