dsh-claude-project-ui 0.3.0 → 0.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,123 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.4.3 — 2026-11-19
4
+
5
+ **只改描述,没有代码变化。** 把 `package.json` 的 `description` 换成与 README / GitHub About 一致的说法。
6
+
7
+ 为什么为此单发一版:npm 包页面**和 dsh-plugin.org 的商店标题**都读这个字段,旧描述还停在
8
+ 「shared project briefs, a cross-thread board panel」,没提 0.4.x 加的东西(多文件夹挂载、
9
+ 中英双语、⚙ 面板设置、原生文件夹选择器)。改 description 必须发新版才会生效。
10
+ ## 0.4.2 — 2026-11-19
11
+
12
+ **原生文件夹选择器**。0.4.1 只发到了 GitHub(tag 与 Release),**没有发 npm**;0.4.2 是 0.4.1 之后的
13
+ 第一个 npm 版本,内容等于 0.4.1 + 本节。
14
+
15
+ - **「浏览…」按钮**(辅助文件夹那一行):点了直接弹 DSH 自己用的原生文件夹选择器。
16
+ - Desktop 应用走 `window.__DSH_DIRECTORY_PICKER__.pick()`(preload 的 contextBridge 桥到
17
+ 主进程 `dsh-desktop:directory-pick` → `dialog.showOpenDialog`);其余环境走宿主
18
+ `uiWorkspace.pickDirectory()`。
19
+ - 选中只把**绝对路径填进输入框**,仍要按「添加」才写入——不会误点一次就挂载。
20
+ - 宿主没有选择器时按钮**根本不渲染**;调用中途失败则静默收起,手输路径照旧。
21
+ - 证据链(主进程 / preload / 渲染端消费点,含文件与行号)记录在
22
+ [`docs/native-directory-picker.md`](docs/native-directory-picker.md)。
23
+ - 文案:`浏览…` / `Browse…`,以及两条失败提示,中英各一份。
24
+ - 测试:harness 52 → **54** 条全绿。
25
+
26
+ ## 0.4.1 — 2026-11-18
27
+
28
+ **弹窗真的在最上层 + 弹窗信息结构重做**(0.4.0 的真机反馈)。仍是 0.4.x,只改浏览器半的弹窗与文案。
29
+
30
+ - **置顶问题(修复根因)**:0.4.0 的弹窗只写了 `position: fixed; z-index: 9999`,但父级若有
31
+ `transform` / `filter` / `contain` / `isolation` 就会形成新的层叠上下文,9999 只在该上下文内部有效,
32
+ 所以会被面板或 dsh-threads 自己的 Modal 压住。现在弹窗通过 **React portal** 挂到
33
+ `document.body` 下的专用容器 `#project-hub-dialog-root`(`role="dialog"` / `aria-modal="true"` /
34
+ `aria-labelledby` 指向标题),彻底离开宿主的层叠上下文。找不到 `react-dom` 或没有 `document` 时
35
+ 退回原地渲染(不会消失)。打开时锁 `body` 滚动、恢复原值;**Esc** 关闭、**点遮罩**关闭。
36
+ - **弹窗信息结构(照着用户给的结构重做)**:
37
+ - 头部:项目名(粗体)→ 浅色小字「当前主文件夹」→ 路径(monospace、单行省略、hover 显示全路径);
38
+ 右上 `✕`。
39
+ - 主文件夹行:`[更换…]` 主按钮 + 小链接「手动输入路径」(点了才出现输入框,不再常驻第二个按钮)。
40
+ - 分隔线。
41
+ - 辅助文件夹:标题 + 数量徽标;为空只有一行浅灰提示;非空每行 = 文件夹图标(内联 SVG)+ 路径
42
+ (mono、省略)+ 右侧 `[移除]`;下面是输入框 + `[添加]`(placeholder 保持「绝对路径,或 ~/开头」)。
43
+ - 底部**一行**浅灰脚注(沙箱可写根 + 写入 dsh-threads 记录 + 其面板重启后同步)。
44
+ - 成功反馈:受影响那一行右侧出现 2 秒「已保存」(`role="status"`),不再有 toast / alert / 大段说明。
45
+ - 说明文字从两大段砍到一行脚注,其余解释性长句移到 README。
46
+ - **弹窗读实时数据**:弹窗内的项目/工作区对象改为从看板快照里按 id 取最新一份,
47
+ 增删辅助文件夹后列表立即更新(不再需要关掉再打开)。
48
+ - **双语**:新增/改写的弹窗文案 zh/en 同时补齐(两张表各 79 个 key);
49
+ 面板除订阅 `locale/change` 事件外,**同时订阅 locale 服务的快照**,语言一换就重渲染 ——
50
+ 不是挂载时读一次 `<html lang>`。测试新增四条:locale 服务切换后语言与文案跟着变、
51
+ 文案表与调用点一致(没有未用 key、也没有用到不存在的 key)、弹窗容器只创建一次且角色正确、
52
+ 三个入口都只走同一个弹窗。
53
+ - **文档**:新增 [`docs/dialog-redesign-0.4.1.md`](docs/dialog-redesign-0.4.1.md)(新旧结构对比 + 只能真机验的项);
54
+ README 补「文件夹弹窗」与「如何切语言」两节。
55
+ - **看板设置入口(⚙,并入 0.4.1)**:面板头部「刷新」左边新增 ⚙,用**同一套 portal** 打开 360 宽的紧凑
56
+ 设置面板(不是全屏弹窗)。六项:语言(跟随应用(中文)/ 中文 / English,手动选择优先于应用语言)、
57
+ 显示已解决 / 已归档的讨论串(默认关)、自动把讨论串回报汇总成任务(默认开)、「其他项目」卡片默认
58
+ 折叠 / 展开、排序(最近活动 / 名称)、项目文件夹管理…。
59
+ - **存储**:新增 `src/settings.js` + `ProjectStore` 的全局读写,存 `<dataDir>/settings.json`
60
+ (默认 `~/.dsh/project-hub/settings.json`),**不写 dsh-threads 的存储**;越界值夹回默认,写入串行化。
61
+ - **立刻生效**:客户端 store 改完立刻重渲染 + 写入;宿主半下次快照用新值。其中「隐藏讨论串」与
62
+ 「回报汇总」是**宿主侧**行为(快照过滤 + sweep),两条路径读同一份设置,不是前端假装。
63
+ - **语言优先级**:手动 `zh`/`en` > locale 服务 > `<html lang>`/navigator > `en`;
64
+ 「跟随应用(中文)」括号里显示当前应用语言。
65
+ - **管理页链接**:DSH 没有公开「打开设置页某个分节」的客户端 API(核实 `dsh-client-ui-settings-general`:
66
+ shell store 是槽位内部状态,未导出服务),所以它在同一面板里渲染**同一个** `SettingsSection`
67
+ 组件(宽 460),不假装跳转。
68
+ - **配置项定位变化**:`hideResolvedThreads` / `autoConvergeReports` 现在是**初始默认值**,一旦在 ⚙ 里改过就以
69
+ 设置文件为准。
70
+ - 新增测试 5 条(语言覆盖优先级、客户端设置归一化、宿主设置往返与夹取、隐藏讨论串确实是宿主侧过滤、
71
+ 同一时间只开一个浮层且写入失败会回滚),`npm test` 共 52 条。
72
+
73
+ ## 0.4.0 — 2026-11-18
74
+
75
+ **看板版式重做 + 真正的双语 + 文件夹的三个入口**。看板从「一堆项目平铺」变成两层结构;
76
+ 面板/弹窗/设置页的文案全部抽成 zh/en 两套并跟随 DSH 的 locale 服务;改文件夹新增看板、设置页、
77
+ dsh-threads 面板三处入口,共用一套组件与一条写入路径。
78
+
79
+ - **看板版式(浏览器半,`src/client.js`)**:
80
+ - 当前项目置顶:独立卡片 + 左侧 3px 强调色竖条 + 名称 + monospace 11 路径;右上「切换文件夹⋯」+
81
+ 展开箭头;卡片内是「辅助文件夹」折叠区。
82
+ 「当前项目」由宿主半解析:面板把所在对话的 session id 发到 `POST /project-hub/board`,
83
+ 宿主用 `registry.roleOf(sessionId)` 找到项目并回填 `currentProjectId`;解析不出来就不置顶。
84
+ - 当前卡片与其余项目之间是一条 2px 粗分隔 + 文字「其他项目 · N」(`Other projects · N`),
85
+ **滚动吸顶**(`position: sticky`)。
86
+ - 其余项目按**最近活动时间**倒序(宿主在快照里给每个项目算 `activity` = 项目记录与所有讨论串里最新的那个),
87
+ 紧凑卡片(名称 + 讨论串/任务数量 + 最近活动)默认收起,点开才展开讨论串与任务行;
88
+ 卡片之间 1px 细线 + 12px 间距。
89
+ - 讨论串行 = 6px 状态点 + `#编号` + 单行省略标题 + 右侧状态词;任务行 = 状态 pill + 任务号 + 主题 +
90
+ 右侧「+」复制任务号(配合 `/hub done <id>`)。空状态只有一行浅色提示。
91
+ - 视觉规范:8px 网格、圆角 10、边框 `rgba(127,127,127,0.18)`、hover `rgba(127,127,127,0.06)`、
92
+ 无大阴影、字号 12/13、monospace 11;状态点颜色 进行中=蓝、待办=灰、受阻/待决策=橙、
93
+ 已完成/已解决=绿、空闲/已停止=浅灰。
94
+ - 讨论串状态改用**稳定 code**(`threadStateCode()` 新增在 `src/project.js`),
95
+ `boardView()` 额外返回 `code`,面板据此翻译(不再把中文状态词直接显示在英文界面里)。
96
+ - **双语**:`src/client.js` 里 `MESSAGES.zh` / `MESSAGES.en` 各 93 个 key,覆盖面板、弹窗、设置页、
97
+ 注入按钮的**全部**文案。语言读 DSH 的 locale 服务(`ctx.locale.getLocale()` + `ctx.on("locale/change")`,
98
+ 并用 `ctx.locale.register("project-hub", { zh, en })` 登记字典);切换语言立即生效。
99
+ **缺 key 回退顺序:当前语言 → 英文 → 中文 → key**。客户端 `inject` 因此新增 `locale`。
100
+ - **入口 A(看板内)**:当前项目卡片的「切换文件夹⋯」打开共用弹窗;卡片内的「辅助文件夹」折叠区可以增删挂载。
101
+ - **入口 B(设置页)**:`slots.inject("settings.section")` 注册「项目文件夹 / Project folders」分节,
102
+ 列出**所有项目与工作区**,逐行显示路径 + 修改按钮 + 辅助文件夹数量;**只做逐个修改,没有批量改全部**。
103
+ 已被项目占用的工作区不能单独改(会被拒绝并提示去项目那一行改)。
104
+ 新增 `src/workspaces.js`(工作区只读视图 + 与项目的 join)与 `src/mainfolder.js` 的
105
+ `setWorkspaceFolder()`(复用同一条备份 / realpath / 串行 / 回滚纪律,只动 `workspace.json`);
106
+ `POST /project-hub/folders` 新增 `action: "workspace"`。
107
+ - **入口 C(注入 dsh-threads 面板)**:`MutationObserver` 找 dsh-threads「项目设置 → 通用 → 文件夹」
108
+ 卡片里的 `.dsht-setting-path` 锚点,注入「⚙ 更多文件夹⋯」按钮,点击打开同一个弹窗(按路径认领项目)。
109
+ 找不到锚点静默不注入;重复触发幂等(一个卡片只有一个按钮);所有 DOM 操作 `try/catch`,
110
+ 结构变化最多掉按钮,不抛到宿主、不白屏。
111
+ - **共用弹窗**:`shell.overlay` 里挂一个 `FolderDialog`,A/B/C 三处都打开它(Esc / 点遮罩关闭);
112
+ 文件夹表单与看板内嵌的是**同一个组件**(`FolderForm`)。三处都写明
113
+ 「改动会写入 dsh-threads 的项目记录与 workspace 记录;dsh-threads 自己的设置面板要重启后才同步显示」。
114
+ - **宿主半**:`boardSnapshot()` 接受 `sessionId` 并额外返回 `currentProjectId`、`workspaces`、
115
+ 每个项目的 `activity` 与 `workspaceId`;`project.js` 透出 `workspaceId` 并新增 `projectActivity()`。
116
+ - **测试**:新增 `test/client-checks.mjs`(11 条浏览器半检查:i18n 两侧 key 一致 / 缺 key 回退英文 /
117
+ 当前项目置顶与活跃度排序 / 相对时间 / 状态色 / 路径认领 / 注入幂等与降级 / `apply` 注册五种 slot 且
118
+ 没有 DOM 也不抛),`test/harness.mjs` 新增「看板快照形状」「工作区写入与拒绝」两组宿主检查。
119
+ `npm test` 共 43 条全绿,`npm run prepublishOnly` 里的 `spec-check` 也通过。
120
+
3
121
  ## 0.3.0 — 2026-11-18
4
122
 
5
123
  新增**辅助文件夹(多目录挂载)**与**项目主文件夹切换**:一个项目除主文件夹外可以挂多个目录,提示词、
package/README.md CHANGED
@@ -54,6 +54,24 @@
54
54
  而且走 dsh-threads 已经打开的 domain 句柄、带备份与回滚。任何一个卸载,另一个照常工作;
55
55
  dsh-threads 换存储格式时本插件静默降级为「不注入」,不会报错。
56
56
 
57
+ ## 比 Claude Projects 多出的东西
58
+
59
+ 同一件事(项目 / 讨论串 / 任务),Claude Projects 有一套原设计;在 DSH 里,这套东西的形状不太一样。
60
+ 下表只列**代码里确实做到、并且和原设计有差别**的几处,每行一句,细节在下面各节。
61
+
62
+ | 能力 | Claude Projects | 本插件 |
63
+ |---|---|---|
64
+ | 项目总览 | 项目列表,进项目才看得到会话 | 侧栏一屏铺开所有项目:当前项目置顶卡(左侧强调条),其余按最近活动倒序,每行带讨论串数 / 任务数 / 最近活动时间 |
65
+ | 多目录挂载 | 一个项目一个工作目录 | 项目可再挂多个辅助文件夹:每个会话登记为沙箱可写根(宿主提供沙箱策略时),新会话的提示里直接给绝对路径,`kb_add` 只在主文件夹与已挂载目录里取文件 |
66
+ | 文件夹入口 | 项目设置一处 | 三个入口共用同一个弹窗、同一条写入路径:看板卡「更换…」、设置页逐项目一行、讨论串设置里的「⚙ 更多文件夹⋯」 |
67
+ | 看板设置 | 没有看板设置 | 看板右上 ⚙:语言、显示已解决/已归档、回报汇总、「其他项目」卡片默认折叠/展开、排序、文件夹管理——改完立即生效,存在本插件自己的 `settings.json` 里,不改配置、不重启 |
68
+ | 中英切换 | 界面语言跟随应用 | 97 条文案中英各一份,可在 ⚙ 里锁定中文或 English,切换当下重渲染,不用改 `cordis.yml` |
69
+ | 回报变任务 | 没有跨会话任务看板 | 讨论串每轮回报按 `threadId` 幂等汇总成任务(done / doing / pending / blocked),已解决的讨论串不再生成新任务 |
70
+ | 选文件夹 | 建项目或换目录时选一次 | 切换主文件夹、每次加辅助文件夹都能弹系统原生选择框(Desktop 走 Electron 对话框,其余环境走宿主 picker);拿不到选择器就不渲染按钮,手输路径照旧 |
71
+
72
+ 这不是「替代 Claude Projects」——两个是不同产品(本插件运行在 DeepSeek Harness 上,需要 dsh-threads),
73
+ 表里只说明同类需求在这里怎么解;没有代码支撑的对比不写。
74
+
57
75
  ## 功能
58
76
 
59
77
  ### 知识库
@@ -108,12 +126,30 @@ dsh-threads 换存储格式时本插件静默降级为「不注入」,不会
108
126
 
109
127
  ## 看板面板(侧栏)
110
128
 
111
- 浏览器半会往**右侧栏**加一个「项目看板」页签,和 dsh-threads 的「讨论串」并列(会话头部还有一个「▤ 项目看板」按钮可以一键打开):
112
-
113
- - 按项目分组,列出**进行中的讨论串**(编号、标题、状态、worktree 分支)
114
- - 列出**任务**(编号、标题、状态、负责人),含自动汇总的讨论串任务
115
- - 默认隐藏已解决/已归档的讨论串,只提示「另有 N 个」
116
- - 「刷新」按钮重新拉取;数据来自宿主半的 `POST /project-hub/board`,**只读**
129
+ 浏览器半会往**右侧栏**加一个「项目看板」页签,和 dsh-threads 的「讨论串」并列(会话头部还有一个「▤ 项目看板」按钮可以一键打开)。
130
+ 版式是**两层**的,不再是一堆项目平铺:
131
+
132
+ - **顶部:当前项目**一张独立卡片。左侧 3px 强调色竖条 + 项目名 + monospace 小字路径;
133
+ 右上「切换文件夹⋯」打开共用弹窗,右侧箭头展开/收起讨论串与任务;卡片内还有「辅助文件夹(N)」折叠区。
134
+ 「当前项目」= 打开面板时所在那个对话所属的项目(面板把会话 id 发给宿主,宿主查 dsh-threads 记录解析);
135
+ 解析不出来就不强行置顶,下面直接按活跃度排。
136
+ - **分隔**:一条 2px 粗分隔 + 文字「其他项目 · N」(英文 `Other projects · N`),**滚动时吸顶**。
137
+ - **其他项目**:按最近活动时间(项目记录与它所有讨论串里最新的那个)倒序,每个项目一行**紧凑卡片**
138
+ (名称 + 讨论串/任务数量 + 最近活动时间),点开才展开讨论串与任务行;卡片之间是 1px 细线 + 12px 间距。
139
+ - **讨论串行** = 状态点(6px)+ `#编号` + 标题(单行省略)+ 右侧状态词。
140
+ 状态点颜色:进行中=蓝、待办=灰、受阻/待决策=橙、已完成/已解决=绿、空闲/已停止=浅灰。
141
+ - **任务行** = 状态 pill + 任务号 + 主题 + 右侧「+」(复制任务号,`/hub done <id>` 用)。
142
+ - 空状态只留一行浅色提示,不占大块;「刷新」重新拉取。
143
+ - 数据来自宿主半的 `POST /project-hub/board`,**只读**。
144
+ - 头部「刷新」左边有一个 **⚙ 看板设置**(同一套 portal 的紧凑面板,宽 360):
145
+ 语言(跟随应用 / 中文 / English,手动选择优先于应用语言,括号里显示当前应用语言)、
146
+ 显示已解决 / 已归档的讨论串(默认关)、自动把讨论串回报汇总成任务(默认开)、
147
+ 「其他项目」卡片默认折叠 / 展开、排序(最近活动 / 名称)、以及「项目文件夹管理…」。
148
+ **改完立刻生效并持久化**,不需要重启;存在本插件自己的 `settings.json` 里(不写 dsh-threads 的存储)。
149
+ 其中「隐藏讨论串」和「回报汇总」是宿主侧行为,所以宿主也读同一份设置。
150
+
151
+ 视觉规范(不改主题也深浅两套都能看):8px 网格间距、圆角 10、边框 `rgba(127,127,127,0.18)`、
152
+ hover 背景 `rgba(127,127,127,0.06)`、**不用大阴影**、字号 12/13、路径用 monospace 11。
117
153
 
118
154
  面板只在 Web GUI(`desktop` / `web` profile)出现;`tui` / headless 没有侧栏,
119
155
  退化成 `/hub board` 命令和 `board_list` 工具。
@@ -121,7 +157,7 @@ dsh-threads 换存储格式时本插件静默降级为「不注入」,不会
121
157
  ## 辅助文件夹(多目录挂载)
122
158
 
123
159
  一个项目除了主文件夹,还可以挂载多个**辅助文件夹**(类似 Claude Code 的 additional directories)。
124
- 在右侧「▤ 项目看板」页签里按项目增删,也可以用命令:
160
+ 在「▤ 项目看板」当前项目卡片的「辅助文件夹」折叠区里、或在文件夹弹窗里增删,也可以用命令:
125
161
 
126
162
  ```text
127
163
  /hub folders 列出已挂载的辅助文件夹
@@ -172,6 +208,79 @@ dsh-threads 换存储格式时本插件静默降级为「不注入」,不会
172
208
  上游 PR #61 合并后应改用它提供的官方入口。字段变了会在切换时直接报错并回滚(不会写坏记录)。
173
209
  详见 [`docs/folders-feasibility.md`](docs/folders-feasibility.md)。
174
210
 
211
+ ## 文件夹的三个入口(同一套组件、同一条写入路径)
212
+
213
+ 改文件夹有三处,行为一致:都打开**同一个弹窗**,都走宿主半 `src/mainfolder.js` 那一条写入路径
214
+ (备份 → realpath → 校验 → 串行 → 读回 → 失败回滚),没有第二套实现。
215
+
216
+ | 入口 | 位置 | 作用范围 |
217
+ | --- | --- | --- |
218
+ | **A** | 看板里**当前项目卡片**的「切换文件夹⋯」+「辅助文件夹」折叠区 | 只作用当前项目 |
219
+ | **B** | 设置页新分节「项目文件夹 / Project folders」 | **逐行**改任意一个项目或工作区 |
220
+ | **C** | dsh-threads 自己的「项目设置 → 通用 → 文件夹」卡片里注入的「⚙ 更多文件夹⋯」 | 打开的那个项目 |
221
+
222
+ 三处都写明同一件事:
223
+
224
+ > 改动会写入 dsh-threads 的项目记录与 workspace 记录;dsh-threads 自己的设置面板要重启 DSH 之后才同步显示
225
+ > (它读自己的 client store,不订阅存储变更)。
226
+
227
+ 细节:
228
+
229
+ - **B 刻意没有「批量改全部」**:一次误点就会冲掉十几个项目记录,所以只做逐个修改。
230
+ 项目行会同时改项目记录与工作区记录;工作区行只改工作区记录。
231
+ 已经被项目占用的工作区**不能**单独改——请求会被拒绝并提示去项目那一行改,两处记录必须一起动;
232
+ 没有项目用的工作区才可以单独改(只动 `workspace.json`,同样有备份 / 读回 / 回滚)。
233
+ - **C 的注入约束**:`MutationObserver` 在 dsh-threads 的文件夹卡片里找 `.dsht-setting-path` 锚点,
234
+ 找不到就**静默不注入**;重复触发**幂等**(同一个卡片永远只有一个按钮,文案跟着语言刷新);
235
+ 所有 DOM 读写都包在 `try/catch` 里,dsh-threads 的 DOM 结构变了最多掉按钮,绝不抛到宿主、不会白屏。
236
+ 卡片里显示的是那个项目的文件夹路径,按钮据此在项目记录里认领项目再打开同一个弹窗。
237
+
238
+ ### 文件夹弹窗(0.4.1 起)
239
+
240
+ 三个入口打开的是同一个弹窗,结构固定,只有这几块:
241
+
242
+ ```text
243
+ 项目名(粗体)
244
+ 当前主文件夹
245
+ /Users/me/code/app ✕
246
+ [更换…] 手动输入路径 已保存(2 秒)
247
+ ──────────────────────────────────────────────
248
+ 辅助文件夹 (2)
249
+ ▱ /Users/me/data [移除]
250
+ ▱ /Users/me/notes [移除]
251
+ [/Users/me/another____] [浏览…] [添加]
252
+ 辅助文件夹会登记为每个会话的沙箱可写根;改动写入 dsh-threads 记录,其设置面板重启后同步。
253
+ ```
254
+
255
+ - 弹窗**portal 到 `document.body`**(容器 `#project-hub-dialog-root`,`role="dialog"` / `aria-modal="true"`),
256
+ 所以不会被面板、设置页或 dsh-threads 自己的 Modal 压住——`position: fixed` 的 `z-index` 只在当前层叠上下文里比大小,
257
+ 而宿主的父级只要有一个 `transform` 就能把弹窗困在下面。
258
+ - 打开时锁 `body` 滚动;**Esc** 关闭、**点遮罩**关闭。
259
+ - 成功反馈只有「已保存」,2 秒后自己消失;没有 toast,没有 alert,没有大段说明。
260
+ - 路径单行省略,鼠标悬停显示全路径。
261
+ - **「浏览…」**(0.4.1 起,辅助文件夹那一行):点了弹 DSH 自己用的原生文件夹选择器——Desktop 应用里走
262
+ `window.__DSH_DIRECTORY_PICKER__`(Electron `dialog.showOpenDialog`),其余环境走宿主
263
+ `uiWorkspace.pickDirectory()`。选中只把绝对路径**填进输入框**,仍要按「添加」才写入。
264
+ 宿主没有选择器时按钮**压根不渲染**;中途失败则静默收起,手输路径照旧。
265
+ 两条链路的证据(主进程 / preload / 渲染端消费点)见 [`docs/native-directory-picker.md`](docs/native-directory-picker.md)。
266
+ - 更长的解释(沙箱授权语义、重启边界、两处记录为什么要一起改)都在本文档下面的章节里,弹窗里只剩一行脚注。
267
+
268
+ ## 双语(跟随应用语言)
269
+
270
+ **怎么切成英文**:侧栏底部「设置」→「通用」→「语言」那一行 → 选 `English`(语言项由 DSH 自己的
271
+ `dsh-client-locale` 提供,切换后其它插件与内核文案一起换)。切完**不用刷新**:本插件的面板、弹窗、
272
+ 设置页、注入按钮会立刻重渲染。
273
+
274
+ 面板、弹窗、设置页和注入按钮的**所有**文案都在 `src/client.js` 的 `MESSAGES.zh` / `MESSAGES.en` 两张表里
275
+ (各 97 个 key;测试会校验两侧 key 完全一致、没有空文案、并且没有「表里有但没地方用」的 key):
276
+
277
+ - 语言来自 DSH 的 **locale 服务**(`dsh-client-locale`):`ctx.locale.getLocale()` 读当前语言、
278
+ `ctx.on("locale/change")` 跟随切换、`ctx.locale.register("project-hub", { zh, en })` 登记字典。
279
+ 切换语言后面板 / 弹窗 / 设置页**立刻**换文案,不用刷新。
280
+ - **缺 key 时的回退顺序:当前语言 → 英文 → 中文 → key 本身**。英文是兜底,所以漏翻译只会退回英文,
281
+ 不会露出 `board.section.others` 这种原始 key。
282
+ - 侧栏页签标题这类由宿主渲染的文字用 thunk 提供,宿主下次渲染时跟上新语言。
283
+
175
284
  ## 安装
176
285
 
177
286
  需要 DeepSeek Harness 0.2.1-rc.2 到 0.3.0。
@@ -270,12 +379,13 @@ dsh plugin --profile web add dsh-claude-project-ui
270
379
  | `maxNotes` | `200` | 每个项目保留多少条 `hub_note` 进展笔记 |
271
380
  | `maxDocs` | `200` | 每个项目允许的知识库文档数 |
272
381
  | `maxKnowledgeChars` | `4000000` | 每个项目知识库总字符数上限 |
273
- | `hideResolvedThreads` | `true` | 看板与注入里隐藏已解决 / 已归档讨论串;`board_list all=true` 可看全部 |
274
- | `autoConvergeReports` | `true` | 讨论串回报自动汇总成看板任务(按 `threadId` 幂等) |
382
+ | `hideResolvedThreads` | `true` | **初始**值:⚙ 里「显示已解决 / 已归档的讨论串」;设置文件一旦存在以它为准。`board_list all=true` 单次仍可看全部 |
383
+ | `autoConvergeReports` | `true` | **初始**值:⚙ 里「自动把讨论串回报汇总成任务」(按 `threadId` 幂等) |
275
384
 
276
385
  ## 数据
277
386
 
278
387
  ```
388
+ ~/.dsh/project-hub/settings.json 看板设置(语言/隐藏/汇总/卡片/排序;本插件自己的)
279
389
  ~/.dsh/project-hub/projects/<projectId>/
280
390
  knowledge.json 知识库文档
281
391
  board.json 手动任务
@@ -302,7 +412,10 @@ dsh plugin --profile web add dsh-claude-project-ui
302
412
  - 辅助文件夹的沙箱授权只在 `workspace-write` 生效;`read-only` 下核心工具本来就写不了。
303
413
  授权是运行时状态,重启 / resume 后需要重新登记(刷新循环会自动做,最多延迟 10 秒)。
304
414
  - 轮询刷新:每 10 秒 + agent 状态变化时刷新提示词快照,最坏情况看到的是 10 秒前的看板。
305
- - 看板默认隐藏已解决/已归档的讨论串;想全看用 `board_list all=true` 或 `/hub board --all`。
415
+ - 看板默认隐藏已解决/已归档的讨论串(⚙ 里可以打开);一次性看全部用 `board_list all=true` 或 `/hub board --all`。
416
+ - 配置里的 `hideResolvedThreads` / `autoConvergeReports` 现在是**初始默认值**:⚙ 里一改就以设置文件为准。
417
+ - ⚙ 面板的「项目文件夹管理…」不跳转设置页:DSH 没有公开「打开设置页某个分节」的客户端 API,
418
+ 它在同一个面板里渲染**同一个**管理组件(逐行修改,没有批量)。
306
419
 
307
420
  ## 验收记录(2026-11-18,本机 desktop profile)
308
421
 
@@ -390,6 +503,24 @@ workspace record, through the domain handle dsh-threads already opened, with a b
390
503
  Uninstalling either leaves the other working; if dsh-threads changes its storage format, this plugin
391
504
  silently degrades to "no injection" instead of throwing.
392
505
 
506
+ ## What goes beyond Claude Projects
507
+
508
+ The same job — projects, threads, tasks — but shaped a little differently in DSH. Only the differences the code
509
+ actually implements, one line each; the sections below carry the detail.
510
+
511
+ | Capability | Claude Projects | This plugin |
512
+ |---|---|---|
513
+ | Project overview | A project list; sessions appear after you open one | Every project on one sidebar page: the current project on a top card with an accent rail, the rest ordered by last activity, each row carrying thread count / task count / last active |
514
+ | Extra folders | One working directory per project | A project can mount extra folders: each session gets them as writable sandbox roots (when the host exposes a sandbox policy), new sessions are told the absolute paths, and `kb_add` only reads inside the main folder or a mounted one |
515
+ | Folder entry points | Project settings only | Three entries share one dialog and one write path: "Change…" on the board card, one row per project on the settings page, and "⚙ More folders…" in dsh-threads' own settings card |
516
+ | Board settings | None | ⚙ at the top of the board: language, show resolved/archived, roll reports into tasks, other cards collapsed/expanded by default, sort, folder management — applied immediately and stored in this plugin's own `settings.json`, no config edit, no restart |
517
+ | Bilingual | UI follows the app language | 97 strings in both tables; pin 中文 or English in ⚙ and the panel re-renders at once, no `cordis.yml` edit |
518
+ | Reports become tasks | No cross-session task board | Each thread report becomes a task, deduplicated by `threadId` (done / doing / pending / blocked); resolved threads stop creating new ones |
519
+ | Choosing a folder | Pick once when creating or moving a project | Both the main-folder switch and every "add extra folder" can open the OS folder chooser (Electron dialog on Desktop, the host picker elsewhere); with no chooser the button is not rendered and a typed path still works |
520
+
521
+ Not a claim of replacement: this plugin runs on DeepSeek Harness and needs dsh-threads. The table only says how the
522
+ same needs are solved here; anything without code behind it is left out.
523
+
393
524
  ## Features
394
525
 
395
526
  ### Knowledge base
@@ -445,12 +576,38 @@ and they run in order with a per-line report. A trailing `→ note` is treated a
445
576
 
446
577
  ## Board panel (sidebar)
447
578
 
448
- The browser half registers a "项目看板" tab in the **right-hand sidebar pane**, next to dsh-threads' "讨论串" tab (the session header also gets a "▤ 项目看板" button that opens it):
449
-
450
- - Projects grouped, each listing **live threads** (number, title, state, worktree branch)
451
- - **Tasks** (id, title, status, owner), including the automatically rolled-up thread tasks
452
- - Resolved and archived threads are hidden by default, with a "N more" note
453
- - A "Refresh" button; data comes from the host half's `POST /project-hub/board` and is **read-only**
579
+ The browser half registers a tab in the **right-hand sidebar pane**, next to dsh-threads' thread list (the
580
+ session header also gets a "▤ Project board" button that opens it). The layout has two layers instead of
581
+ one flat list of projects:
582
+
583
+ - **Top: the current project**, one card of its own. A 3px accent rail on the left, the project name, the
584
+ path in 11px monospace; "Change folder…" in the top right opens the shared dialog, the chevron expands
585
+ the thread and task rows, and an "Auxiliary folders (N)" section collapses underneath.
586
+ "Current" means the project of the conversation the panel was opened next to: the panel sends its session
587
+ id, the host resolves it against dsh-threads' records. When nothing resolves, no card is promoted and the
588
+ list is simply ordered by activity.
589
+ - **Divider**: a 2px rule carrying "Other projects · N" that **sticks to the top while scrolling**.
590
+ - **Other projects** sort by newest activity (the newest of the project record and all its threads) and each
591
+ is a compact card — name, thread and task counts, last active — that expands into its rows on click.
592
+ Cards are separated by a 1px hairline plus 12px of space.
593
+ - **Thread row** = 6px status dot + `#n` + title (single line, ellipsised) + state word on the right.
594
+ Dot colours: running = blue, to do = grey, blocked / needs a decision = orange, done / resolved = green,
595
+ idle / stopped = light grey.
596
+ - **Task row** = status pill + task id + subject + a "+" on the right that copies the id for `/hub done <id>`.
597
+ - An empty state is one faint line, not a block; "Refresh" reloads.
598
+ - Data comes from the host half's `POST /project-hub/board` and is **read-only**.
599
+ - Left of "Refresh" there is a **⚙ board settings** popover (the same portal, 360px wide):
600
+ language (follow the app / 中文 / English — a manual choice beats the app language, and the follow
601
+ option shows the current app language in parentheses), show resolved and archived threads (off by
602
+ default), roll thread reports into tasks (on by default), whether "other projects" cards start
603
+ expanded, the sort order (last active / name), and "Manage project folders…".
604
+ **Every change applies immediately and is persisted**, no restart: it lives in this plugin's own
605
+ `settings.json`, never in dsh-threads' storage. Hiding threads and rolling up reports are host-side
606
+ behaviours, so the host reads the same file.
607
+
608
+ Visual rules (both themes, without touching the theme): 8px spacing grid, radius 10, border
609
+ `rgba(127,127,127,0.18)`, hover wash `rgba(127,127,127,0.06)`, **no large shadows**, type at 12/13px,
610
+ paths in 11px monospace.
454
611
 
455
612
  The panel only exists in the Web GUI (`desktop` / `web` profiles). `tui` and headless have no
456
613
  sidebar and fall back to the `/hub board` command and the `board_list` tool.
@@ -458,7 +615,8 @@ sidebar and fall back to the `/hub board` command and the `board_list` tool.
458
615
  ## Mounted folders (additional directories)
459
616
 
460
617
  A project can mount extra **auxiliary folders** on top of its main folder (Claude Code's additional
461
- directories idea). Add or remove them per project in the "▤ 项目看板" tab, or by command:
618
+ directories idea). Add or remove them in the current-project card's "Auxiliary folders" section, in the
619
+ folder dialog, or by command:
462
620
 
463
621
  ```text
464
622
  /hub folders list mounted folders
@@ -521,6 +679,85 @@ system folder chooser; type a path in the same block when no chooser is availabl
521
679
  If a field stops matching, the switch fails and rolls back instead of corrupting a record.
522
680
  See [`docs/folders-feasibility.md`](docs/folders-feasibility.md).
523
681
 
682
+ ## Three entry points for folders (one component set, one write path)
683
+
684
+ There are three places to change a folder and they behave the same way: all of them open the **same dialog**
685
+ and all of them go through the host half's single write path in `src/mainfolder.js` (backup → realpath →
686
+ validate → serialise → read back → roll back). There is no second implementation.
687
+
688
+ | Entry | Where | Scope |
689
+ | --- | --- | --- |
690
+ | **A** | "Change folder…" plus the "Auxiliary folders" section on the board's **current-project card** | the current project only |
691
+ | **B** | a new "Project folders" section on the settings page | **one row at a time**, any project or workspace |
692
+ | **C** | a "⚙ More folders…" button injected into dsh-threads' own "Project settings → General → Folder" card | the project that card belongs to |
693
+
694
+ All three state the same thing:
695
+
696
+ > Changes are written into dsh-threads' project record and the DSH workspace record; dsh-threads' own
697
+ > settings panel shows them only after a DSH restart (it reads its own client store and does not subscribe
698
+ > to storage changes).
699
+
700
+ Details:
701
+
702
+ - **B deliberately has no "change everything"**: one stray click must never rewrite a dozen project records,
703
+ so it only edits one row at a time. A project row moves the project record and the workspace record
704
+ together; a workspace row moves only the workspace record. A workspace a project owns **cannot** be edited
705
+ on its own — the request is refused and points at the project row, because both records must move together.
706
+ A workspace no project uses can be moved alone (workspace.json only, with the same backup / read-back /
707
+ rollback).
708
+ - **C's injection contract**: a `MutationObserver` looks for the `.dsht-setting-path` anchor inside
709
+ dsh-threads' folder card; no anchor means **no injection at all**; repeated triggers are **idempotent**
710
+ (one button per card, its copy refreshed with the language); every DOM read and write is inside
711
+ `try/catch`, so a changed DOM structure costs the button and never throws into the host or blanks the UI.
712
+ The card shows that project's folder path, and the button resolves it back to a project record before
713
+ opening the shared dialog.
714
+
715
+ ### The folder dialog (from 0.4.1)
716
+
717
+ All three entries open the same dialog, and it has exactly these blocks:
718
+
719
+ ```text
720
+ Project name (bold)
721
+ Current main folder
722
+ /Users/me/code/app ✕
723
+ [Change…] Type a path Saved (2s)
724
+ ──────────────────────────────────────────────
725
+ Auxiliary folders (2)
726
+ ▱ /Users/me/data [Remove]
727
+ ▱ /Users/me/notes [Remove]
728
+ [/Users/me/another____] [Add]
729
+ Auxiliary folders become writable sandbox roots for every session; changes are written to dsh-threads
730
+ records, whose settings panel syncs after a restart.
731
+ ```
732
+
733
+ - The dialog **portals into `document.body`** (container `#project-hub-dialog-root`, `role="dialog"`,
734
+ `aria-modal="true"`), so neither the sidebar panel, the settings sheet nor dsh-threads' own modal can sit
735
+ on top of it: a `z-index` on a `position: fixed` node is only ranked inside its own stacking context, and
736
+ one `transform` on an ancestor is enough to trap it.
737
+ - Opening locks `body` scrolling; **Esc** closes and **clicking the scrim** closes.
738
+ - The only success feedback is "Saved", which clears itself after 2 seconds — no toast, no alert, no prose.
739
+ - Paths are single-line with an ellipsis; hover shows the full path.
740
+ - The longer explanations (sandbox grants, the restart boundary, why two records must move together) live in
741
+ the sections below; the dialog keeps one footnote line.
742
+
743
+ ## Bilingual (follows the app language)
744
+
745
+ **How to switch to English**: sidebar footer → Settings → General → the **Language** row → pick
746
+ `English` (the row comes from DSH's own `dsh-client-locale`, so the core and other plugins follow too).
747
+ No reload: this plugin's panel, dialog, settings page and injected button re-render immediately.
748
+
749
+ Every string the panel, the dialog, the settings page and the injected button show lives in the
750
+ `MESSAGES.zh` / `MESSAGES.en` tables in `src/client.js` (97 keys each; a test asserts both sides carry
751
+ exactly the same keys, no empty copy, and no key that nothing shows):
752
+
753
+ - The language comes from DSH's **locale service** (`dsh-client-locale`): `ctx.locale.getLocale()` reads the
754
+ active language, `ctx.on("locale/change")` follows a switch, and `ctx.locale.register("project-hub",
755
+ { zh, en })` registers the dictionaries. Switching the language re-renders the panel, dialog and settings
756
+ page immediately — no reload.
757
+ - **Missing-key fallback order: active language → English → Chinese → the key itself.** English is the
758
+ backstop, so an untranslated key degrades to English instead of showing `board.section.others`.
759
+ - Text rendered by the host (the sidebar tab label) is supplied as a thunk, so it follows the next host render.
760
+
524
761
  ## Install
525
762
 
526
763
  Requires DeepSeek Harness 0.2.1-rc.2 through 0.3.0.
@@ -621,12 +858,13 @@ Override in the profile's `cordis.patch.yml`:
621
858
  | `maxNotes` | `200` | Progress notes kept per project |
622
859
  | `maxDocs` | `200` | Knowledge documents allowed per project |
623
860
  | `maxKnowledgeChars` | `4000000` | Total knowledge characters allowed per project |
624
- | `hideResolvedThreads` | `true` | Hide resolved / archived threads from the board and injection; `board_list all=true` shows everything |
625
- | `autoConvergeReports` | `true` | Mirror thread reports onto the board as tasks (idempotent by `threadId`) |
861
+ | `hideResolvedThreads` | `true` | **Initial** value for the ⚙ "show resolved and archived threads"; once set, `settings.json` wins. `board_list all=true` always shows everything for one call |
862
+ | `autoConvergeReports` | `true` | **Initial** value for the ⚙ "roll thread reports into tasks" toggle (idempotent by `threadId`) |
626
863
 
627
864
  ## Data
628
865
 
629
866
  ```
867
+ ~/.dsh/project-hub/settings.json board settings (language / threads / cards / sort; ours)
630
868
  ~/.dsh/project-hub/projects/<projectId>/
631
869
  knowledge.json knowledge documents
632
870
  board.json manual tasks
@@ -661,8 +899,13 @@ A main-folder switch does not touch this directory: it writes `~/.dsh/storages/d
661
899
  so it can lag up to 10 seconds).
662
900
  - Refreshes are polled: every 10 seconds plus on agent status changes, so a snapshot can be up to
663
901
  10 seconds stale.
664
- - The board hides resolved/archived threads by default; use `board_list all=true` or
665
- `/hub board --all` to see everything.
902
+ - The board hides resolved/archived threads by default (the ⚙ popover can show them);
903
+ `board_list all=true` or `/hub board --all` shows everything for one call.
904
+ - The ⚙ "Manage project folders…" does not jump into the settings page: DSH exposes no client API to open
905
+ a specific settings section, so it renders the same manager component inside the popover instead
906
+ (one row at a time, no bulk action).
907
+ - `hideResolvedThreads` / `autoConvergeReports` in the config are **initial defaults** only: once the panel
908
+ toggle is used, the settings file decides.
666
909
 
667
910
  ## Verification record (2026-11-18, local desktop profile)
668
911
 
@@ -0,0 +1,80 @@
1
+ # GitHub About 候选(3 个,供 lead 选一个)
2
+
3
+ 仓库:`lanechenhku/dsh-claude-project-ui`(0.4.1 已发 GitHub,npm 未发布;工作区版本号为 0.4.2)
4
+ 限制:GitHub About 描述**硬上限 350 字符**。下面三条都是**纯 ASCII**,所以 `wc -c` 数出来就是字符数;
5
+ 每条都用 `wc -c` 实测过(命令见文末),且覆盖关键词 `project board` / `threads` / `bilingual` / `folders`。
6
+ 三条都**不含 emoji**(上限 1 个,这里没用)。
7
+
8
+ ---
9
+
10
+ ## 候选 A(推荐):能力清单式,一句话说完
11
+
12
+ **227 字符**
13
+
14
+ ```text
15
+ Claude-style project UI for DeepSeek Harness, built on dsh-threads: a project board for threads and tasks, extra folders mounted per project, a bilingual (zh/en) panel, and thread reports rolled into tasks, all editable in-app.
16
+ ```
17
+
18
+ 中文对照:给 DeepSeek Harness 的 Claude 风格项目界面(建在 dsh-threads 上)——项目看板统管讨论串与任务、
19
+ 每个项目可挂多个文件夹、面板中英双语、讨论串回报自动变任务,全部在界面里改。
20
+
21
+ 推荐理由:一条句子说完「是什么(Claude-style project UI for DSH)+ 比原来多什么(board / folders /
22
+ bilingual / roll-up)」,关键词密度最高,和 README 新增的对照表口径一致。
23
+
24
+ ---
25
+
26
+ ## 候选 B:差异式,先点出「不止项目列表」
27
+
28
+ **207 字符**
29
+
30
+ ```text
31
+ DeepSeek Harness plugin that goes past a project list: one project board over threads and tasks, extra folders with per-session sandbox grants, bilingual UI, and reports rolled into tasks. Needs dsh-threads.
32
+ ```
33
+
34
+ 中文对照:给 DeepSeek Harness 的插件,比一份项目列表更进一步——一块看板统管讨论串与任务、辅助文件夹按会话
35
+ 授权沙箱、界面中英双语、回报自动汇总成任务;依赖 dsh-threads。
36
+
37
+ 适合:想让 About 直接说「这不是又一个项目列表」的时候。
38
+
39
+ ---
40
+
41
+ ## 候选 C:场景式,先说用起来是什么样
42
+
43
+ **200 字符**
44
+
45
+ ```text
46
+ A project board for DeepSeek Harness: every project, its threads and tasks on one sidebar page, extra folders per project, a bilingual panel, and progress reports turned into tasks. Needs dsh-threads.
47
+ ```
48
+
49
+ 中文对照:DeepSeek Harness 的项目看板——所有项目、它们的讨论串与任务都在侧栏一页里,每个项目可挂额外文件夹,
50
+ 面板中英双语,讨论串的进展自动变成任务;依赖 dsh-threads。
51
+
52
+ 适合:面向还没装 dsh-threads 的人,先说清「你会得到什么」。
53
+
54
+ ---
55
+
56
+ ## 计数与校验
57
+
58
+ ```bash
59
+ # 三条都用这个数(纯 ASCII,字节数 = 字符数)
60
+ wc -c <<'EOF'
61
+ Claude-style project UI for DeepSeek Harness, built on dsh-threads: a project board for threads and tasks, extra folders mounted per project, a bilingual (zh/en) panel, and thread reports rolled into tasks, all editable in-app.
62
+ EOF
63
+ ```
64
+
65
+ 实测:A = 227、B = 207、C = 200,均在 350 以内。
66
+
67
+ ## 交给 lead 执行
68
+
69
+ ```bash
70
+ gh repo edit lanechenhku/dsh-claude-project-ui --description "<选中的那条>"
71
+ ```
72
+
73
+ 建议同时确认 topics(About 旁边的标签)至少包含:
74
+ `deepseek-harness`、`dsh-plugin`、`project-board`、`threads`、`bilingual`、`folders`。
75
+
76
+ ## 不要写进 About 的话
77
+
78
+ - 「完全替代 Claude Projects」——不准确,也不同产品。
79
+ - 「比 Claude 好」这类比较句——About 只描述自己做了什么。
80
+ - 任何 emoji 堆砌;上限 1 个,这里刻意用 0 个。