dsh-sidebar-suite 0.2.7 → 0.2.9
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 +28 -1
- package/DETAIL.md +9 -5
- package/README.md +29 -7
- package/lib/client.js +310 -27
- package/lib/temp-session-host.mjs +918 -842
- package/locale/en.json +1 -1
- package/locale/zh.json +1 -1
- package/package.json +3 -3
- package/temp-session-config.txt +3 -3
- package//344/275/277/347/224/250/350/257/264/346/230/216.md +52 -26
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,39 @@
|
|
|
1
1
|
# 更新日志 / Changelog
|
|
2
2
|
|
|
3
|
-
> 版本号以 npm registry **实际发布记录**为准(当前:`0.0.0-stage`、`0.1.3`、`0.2.4`、`0.2.5`、`0.2.6`、`0.2.7`)。
|
|
3
|
+
> 版本号以 npm registry **实际发布记录**为准(当前:`0.0.0-stage`、`0.1.3`、`0.2.4`、`0.2.5`、`0.2.6`、`0.2.7`、`0.2.8`、`0.2.9`)。
|
|
4
4
|
> `0.2.0`、`0.2.1`、`0.2.2`、`0.2.3` 是开发过程中的本地迭代号,**从未单独发布**;它们的功能一次性随 `0.2.4` 上线,所以在下面合并记录。
|
|
5
5
|
>
|
|
6
6
|
> Versions mirror the npm registry. `0.2.0`–`0.2.3` were local iteration numbers that were never published on their own; all of their features shipped together in `0.2.4`.
|
|
7
7
|
|
|
8
8
|
---
|
|
9
9
|
|
|
10
|
+
## 0.2.9 — 布局栏重做 + 视觉精修 / Toolbar rebuilt as a segmented control(2026-11-11)
|
|
11
|
+
|
|
12
|
+
**这次改了运行时代码**(`lib/client.js`),所以**升级后要托盘退出 DSH 再重开一次**。This release touches `lib/client.js`; quit DSH from the tray and reopen once after upgrading.
|
|
13
|
+
|
|
14
|
+
- **布局栏改成图标分段控件** — 三个互斥布局(折叠 / 标签页 / 浮层)装进同一枚圆角胶囊,选中的那个白底 + 1px 投影;当前布局专用的动作按钮隔一道竖线排在右侧。原来是一排文字按钮,宽窄都不好看。The three mutually exclusive layouts now share one rounded pill (active = light fill + 1 px shadow), with the layout-specific action buttons on the far side of a divider.
|
|
15
|
+
- **图标是矢量,不是拼出来的色块** — 8 个图标(布局 ×3、折叠、全部折叠、换标签页、浮出、换布局)全部改成 CSS `mask-image` 内联 SVG,用 `currentColor` 上色,所以深浅主题自动跟随,放大也不糊。原先用两个伪元素拼边框,22×8 的盒子里根本画不完整。All eight glyphs are inline-SVG masks painted in `currentColor`, so they follow the host theme and stay sharp; the old pseudo-element shapes could not fit the 22×8 box they were given.
|
|
16
|
+
- **修掉 0.2.8 的塌陷** — 上一版 `line-height:0` + `padding:4px 5px` 把按钮压成 **22×8**,图标被裁成几根线,右侧按钮还被挤出可视区。现在按钮固定 **28×26**、图标 16px、`padding:0`,实测在 280px 侧栏里间距正确。The 0.2.8 bar collapsed to 22×8 with clipped glyphs; buttons are now 28×26 with 16 px icons and zero padding.
|
|
17
|
+
- **两个折叠按钮不再长得一样** — 布局 A 下「展开扩展」和「展开工作区」并排,原来共用同一个下箭头图标,只能靠悬停提示区分。现在前者单箭头、后者双箭头。In layout A the two fold buttons sat side by side with an identical glyph; they now use a single vs. double chevron.
|
|
18
|
+
- **「换布局」按钮终于有图标** — 该按钮此前没有任何 glyph,开了 `showQuickSwitch` 会显示一个空白按钮。The cycle button had no glyph at all and rendered blank when enabled.
|
|
19
|
+
- **窄 / 宽自适应** — 窄侧栏(< 300px)只留图标、悬停显示文字;拖宽后动作按钮把文字长回来(`min-width:max-content` —— 这里不能靠 `flex:none`,宿主的按钮样式会把它压回 48px)。Icon-only below 300 px with tooltips; action buttons regain their labels when the column widens.
|
|
20
|
+
- **会话行** — 选中行加一条 2px 内嵌强调色竖条(取宿主 `--dsw-alias-state-business-primary`,跟着工作区主题色走),并给行加 `tabular-nums` 让时间列数字等宽。只在选中态、且不在折叠图标条里生效。The active row gets a 2 px inset accent rail in the workspace's own theme colour, and rows use tabular numerals so the time column stops jittering.
|
|
21
|
+
- **测试** — 新增 `tests/test_029.mjs`(源码契约:分段结构、8 个图标定义与按钮属性、尺寸、窄宽规则、强调条、版本与文档),`npm test` 链扩为 7 套。
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## 0.2.8 — 设置全图形化 + 配置热重载 / Graphical settings & hot reload(2026-11-11)
|
|
26
|
+
|
|
27
|
+
**这次改了运行时代码**(`lib/client.js`、`lib/temp-session-host.mjs`),所以**升级后要托盘退出 DSH 再重开一次**;但从此以后改任何设置都不用再重启。
|
|
28
|
+
|
|
29
|
+
- **8 项设置全部有开关** — 详情页新增「侧栏与临时会话」卡:`SHOW_TEMP_BUTTON`、`TEMP_IN_CHAT_MODE`、`TEMP_BUTTON_STYLE`、`EXPAND_ALL_SESSIONS`、`MAX_KEPT` 做成开关 / 选项按钮 / 数字框;原有的 `DELETE_ON_EXIT`、`SCHEDULE_DELETE`、`SCHEDULE_TIME` 保持。另加「立即清理临时会话」按钮,直连已有的 `purge` 路由。Every config key now has a control; a manual purge button was added.
|
|
30
|
+
- **改文件免重启** — Host 半在 `status` / `config` / `probe` 请求时用 `mtime + size` 感知 `temp-session-config.txt` 的外部改动,重解析、重排定时清理计划、递增 `configRevision`;Client 半每 2.5–3 秒轮询,版本变化才原地重应用(按钮显隐、摆法、CHAT 兼容、会话全展开)。约 3 秒生效。No `fs.watch`: editors save by rename and a watcher would keep the host alive.
|
|
31
|
+
- **不再覆盖手改** — `saveConfig()` 写盘前先重新读文件,UI 改一项不会把用户刚在记事本里改的其它项冲掉(新增回归断言)。
|
|
32
|
+
- **文档口径统一** — 配置文件头、`README.md`、`DETAIL.md`、`使用说明.md`、locale 简介里所有「改文件必须彻底退出重开」的旧说明全部改为「约 3 秒自动生效,不用重启」;只有**升级插件包本身**和改 `cordis.patch.yml` 仍需重启。配置文件头仍保持 3 行,所以文档里的行号全部继续有效。
|
|
33
|
+
- **测试** — 新增 `tests/test_028.mjs`(真实 Host 半的热重载 / 防覆盖 / 路由 / 源码契约),`tests/test_023.mjs` 追加 0.2.8 详情页渲染与点击断言;`npm test` 链扩为 6 套。
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
10
37
|
## 0.2.7 — 下载数据可见 / Download counts made visible(2026-11-10)
|
|
11
38
|
|
|
12
39
|
**纯文档改动**:`lib/` 三份脚本、`locale/` 与 0.2.6 逐字一致,没有运行时变化。Docs only, no runtime changes.
|
package/DETAIL.md
CHANGED
|
@@ -36,7 +36,7 @@ Each card draws a small diagram of its layout, and the selected one is marked as
|
|
|
36
36
|
### 美观性 / Looks native
|
|
37
37
|
|
|
38
38
|
- **不另起一套皮肤 / No custom skin** — 颜色、边框、文字层级全部取宿主的设计变量(`--dsw-alias-*`),深色 / 浅色主题自动跟随,侧栏里不会出现一块「外来的」色块。Colours, borders and text levels come from the host's own design tokens, so light and dark themes both look native.
|
|
39
|
-
- **视觉重量对齐 / Same visual weight** —
|
|
39
|
+
- **视觉重量对齐 / Same visual weight** — 0.2.9 起控制栏换成 **28×26 的图标按钮 + 16px 矢量图标**:三个布局装进一枚圆角胶囊(选中项白底 + 1px 投影),动作按钮用 1px 竖线分隔。图标是 CSS mask(`currentColor` 上色),所以跟着宿主主题走;窄侧栏只留图标,宽于 300px 时动作按钮把文字长回来。Since 0.2.9 the bar is 28×26 icon buttons with 16 px vector glyphs: the three layouts share a rounded pill (active = light fill + 1 px shadow), and a 1 px divider separates the action buttons. The glyphs are CSS masks painted in `currentColor`, so they follow the host theme; icon-only when narrow, labelled again past 300 px.
|
|
40
40
|
- **看得懂的示意图 / Diagrams, not words** — 三张布局卡各画一个 36×24 的迷你侧栏示意,选中的那张标「当前默认」,不用读说明也能分辨。Each layout card draws a 36×24 mini sidebar and marks the current default.
|
|
41
41
|
- **不遮挡、不闪烁 / No jumps** — 隐藏分组用 `display:none` + `aria-hidden` + `inert`,切换是纯 CSS 显隐,不卸载重建节点;浮层用 10px 圆角和柔和阴影盖在工作区上方,不把内容挤走。Pure-CSS show/hide, no unmounting; the overlay uses a 10 px radius and a soft shadow.
|
|
42
42
|
- **标记不破坏行高 / Unobtrusive badges** — 「临时」标签由 CSS `::after` 画在会话行上,不插入新节点,行高、缩进、悬停态跟原生会话完全一致。The TEMP badge is a CSS pseudo-element, so rows keep their native height, indent and hover state.
|
|
@@ -76,8 +76,10 @@ The report always carries: plugin version (read from `package.json`, so it canno
|
|
|
76
76
|
|
|
77
77
|
## 控制栏在哪 / Where the controls are
|
|
78
78
|
|
|
79
|
-
|
|
80
|
-
|
|
79
|
+
侧栏顶部是一条分段控件:`[折叠 | 标签页 | 浮层] │ 动作按钮`。前三个互斥,装在同一枚胶囊里,选中的那个白底高亮;竖线右边是当前布局专用的动作按钮(展开/折叠扩展、显示工作区、换标签页、浮出面板)。
|
|
80
|
+
The toolbar is one segmented control: `[fold | tabs | overlay] │ actions`. The first three are mutually exclusive inside a single pill with the active one highlighted; right of the divider sit the buttons that act on the chosen layout.
|
|
81
|
+
|
|
82
|
+
`换布局 / Cycle` 默认不出现(`showQuickSwitch`),打开后和其它动作按钮共用同一套图标。`Cycle` is off by default and shares the icon set when enabled.
|
|
81
83
|
|
|
82
84
|
## 安装与生效 / Install & apply
|
|
83
85
|
|
|
@@ -88,7 +90,7 @@ dsh plugin --profile desktop add dsh-sidebar-suite
|
|
|
88
90
|
本地开发可把包名换成本目录路径或 `.tgz` 安装包。已在 **DSH 0.2.2-rc.1(desktop profile)** 验证。
|
|
89
91
|
For local development, point the same command at this folder or a packed `.tgz`. Tested on **DSH 0.2.2-rc.1 (desktop profile)**.
|
|
90
92
|
|
|
91
|
-
|
|
93
|
+
**升级插件包后仍需重启 / Upgrading the plugin package still needs a restart** — 安装新版或改 `lib/` 下的代码后,请完全退出并重新打开 DSH(客户端代码不热重载)。**但改配置不用重启**:0.2.8 起 `temp-session-config.txt` 的改动、以及详情页的任何开关,都在约 3 秒内原地生效。 / Config edits are the exception: from 0.2.8 they hot-reload in place within seconds.
|
|
92
94
|
|
|
93
95
|
> 组合包自带的 `cordis.patch.yml` 会自动挂载,不要再往 profile 的 `cordis.patch.yml` 里加同名行,否则会加载两次。
|
|
94
96
|
> The bundle patch mounts the plugin automatically; do not add a manual mount line or it loads twice.
|
|
@@ -116,10 +118,12 @@ For local development, point the same command at this folder or a packed `.tgz`.
|
|
|
116
118
|
|
|
117
119
|
**为什么删除是安全的**:`dsh-session-query-sqlite` 的 `_reconcile()` 会拿「磁盘上实际存在的会话」和索引行对比,多出来的行直接 `persistentDeletes`,因此删目录之后搜索索引会自愈,不会留下点不开的幽灵会话。
|
|
118
120
|
|
|
119
|
-
配置:`SHOW_TEMP_BUTTON` / `TEMP_IN_CHAT_MODE` / `TEMP_BUTTON_STYLE` / `DELETE_ON_EXIT` / `SCHEDULE_DELETE` / `SCHEDULE_TIME` / `MAX_KEPT
|
|
121
|
+
配置:`SHOW_TEMP_BUTTON` / `TEMP_IN_CHAT_MODE` / `TEMP_BUTTON_STYLE` / `EXPAND_ALL_SESSIONS` / `DELETE_ON_EXIT` / `SCHEDULE_DELETE` / `SCHEDULE_TIME` / `MAX_KEPT` —— **全部 8 项都能在详情页设**,用记事本改等号右边也行,保存后约 3 秒自动生效,不用重启。
|
|
120
122
|
|
|
121
123
|
**详情页设置(0.2.2)**:插件详情页顶部卡片新增「临时会话自动删除」区块 —— 「退出 DSH 时删除」和「每天定时清理 + 时间」两个独立开关。它不走 `configForms`,而是 `GET/POST /api/dsh-temp-session.config` 交给 Host 半执行,因为**只有一个数据源**:`temp-session-config.txt`。Host 半按行替换(`KEY=value` 只换 `= ` 右边),注释、空行、键顺序原样保留,用户手写的内容不会丢;缺失的键追加到末尾。保存后立即 `restartScheduler()`,无需重启。
|
|
122
124
|
|
|
125
|
+
**全部设置图形化 + 热重载(0.2.8)**:详情页新增「侧栏与临时会话」卡,把剩下的 5 个键也做成开关 / 选项按钮 / 数字框,并加了一个「立即清理临时会话」按钮。至此 `temp-session-config.txt` 里**没有任何一项**需要用户手改文本。Host 半在每次 `status` / `config` / `probe` 请求时比对文件的 `mtime + size`,变化就重解析、重排定时清理计划、递增 `configRevision`;Client 半每 2.5–3 秒轮询一次,只在版本变化时原地重应用(按钮显隐、按钮摆法、CHAT 兼容策略、会话全展开)。`saveConfig()` 写盘前也会先重新读文件,避免 UI 的一次保存覆盖掉用户刚刚手改的其它行。不用 `fs.watch`,因为编辑器保存通常是「写临时文件再改名」,且监听器会拖住宿主进程。 / Every remaining key now has a control; a stamp-based reload makes both the switches and Notepad edits live within seconds, with no restart and no lost hand edits.
|
|
126
|
+
|
|
123
127
|
**定时清理(0.2.2)的实现要点**:
|
|
124
128
|
|
|
125
129
|
- 调度器是 `setInterval(30s)` + `computeNextRun(HH:MM)`,`timer.unref()` 保证它不会把宿主进程吊住;每次 apply/保存都先 `stopScheduler()` 再重建,避免重载后出现两个定时器。
|
package/README.md
CHANGED
|
@@ -98,9 +98,11 @@ Scan with WeChat Pay — **purely voluntary, no rewards promised**. The author a
|
|
|
98
98
|
|
|
99
99
|
## 控制栏 / Where the controls are
|
|
100
100
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
101
|
+
侧栏顶部是一条**分段控件**:三个互斥布局(折叠 / 标签页 / 浮层)装在同一枚灰色胶囊里,选中的那个是白底高亮;右侧隔一道竖线是当前布局专用的动作按钮(展开/折叠扩展、显示工作区、换标签页、浮出面板)。0.2.9 起全部换成矢量图标,窄侧栏只留图标(悬停有文字提示),侧栏宽于 300px 时动作按钮把文字长回来。
|
|
102
|
+
The toolbar is one segmented control: the three mutually exclusive layouts share a single pill with the active one highlighted, and the buttons that act on the chosen layout sit on the far side of a divider. Since 0.2.9 the icons are real vectors — icon-only in a narrow column (with tooltips), and the action buttons grow their labels back once the column passes 300 px.
|
|
103
|
+
|
|
104
|
+
`换布局 / Cycle` 默认不出现,可用 `showQuickSwitch: true` 打开;它和其余动作按钮一起走同一套图标。
|
|
105
|
+
`Cycle` stays hidden unless `showQuickSwitch: true`; it uses the same icon set as the other action buttons.
|
|
104
106
|
|
|
105
107
|
## 实现要点 / How it works
|
|
106
108
|
|
|
@@ -131,7 +133,7 @@ This bundle deliberately omits `engines.dsh`: DSH is currently a prerelease, and
|
|
|
131
133
|
组合包 patch 会自动挂载,**不要**再往 profile 的 `cordis.patch.yml` 加同名行,否则加载两次。
|
|
132
134
|
The bundle patch mounts the plugin; do not also add a manual mount line.
|
|
133
135
|
|
|
134
|
-
|
|
136
|
+
升级插件包后请完全退出并重新打开 DSH(客户端代码不热重载);但 0.2.8 起**改配置文件或在详情页改设置都不用重启**,约 3 秒自动生效。
|
|
135
137
|
The client half is not hot-reloaded — fully quit and reopen DSH after installing or editing files.
|
|
136
138
|
|
|
137
139
|
## 已知限制 / Known limits
|
|
@@ -146,11 +148,11 @@ DSH 自己的会话列表每个工作区只先显示 5 条,剩下的折叠成
|
|
|
146
148
|
|
|
147
149
|
- 每次侧栏刷新都把每个工作区的会话**全部展开**:按宿主自己的按钮走,不改宿主 DOM。
|
|
148
150
|
- 「展开其余 N 个会话」/「收起」按钮**整块隐藏**。
|
|
149
|
-
- 想恢复 DSH
|
|
151
|
+
- 想恢复 DSH 原来的折叠:在详情页关掉「会话默认全展开」开关即可;或把 `temp-session-config.txt` 的 **`EXPAND_ALL_SESSIONS=on` 改成 `off`**,保存后约 3 秒生效(已展开的列表要切换一次工作区才会收回去)。
|
|
150
152
|
|
|
151
153
|
依据(在 `app.asar` 里逐字核对过 `@deepseek-ai/dsh-client-ui-workspace/lib/client.js`):文案 `sessions.expand` = `展开其余 {n} 个会话`,按钮是 `<button data-row-key="overflow:<group>">`,点一次把该组水位线抬高 5 条,全部显示后 `aria-expanded` 变为 `true` 且文案变成「收起」。
|
|
152
154
|
|
|
153
|
-
> The host folds session lists after five rows. This plugin presses the host's own overflow button until nothing is hidden, then hides that control entirely.
|
|
155
|
+
> The host folds session lists after five rows. This plugin presses the host's own overflow button until nothing is hidden, then hides that control entirely. Use the detail-page switch (or set `EXPAND_ALL_SESSIONS=off` in `temp-session-config.txt`) to restore DSH's folding. Both hot-reload in seconds, no restart.
|
|
154
156
|
|
|
155
157
|
## 临时会话 / Temporary session(0.2.0)
|
|
156
158
|
|
|
@@ -182,9 +184,29 @@ DSH **没有公开的「删除会话」接口**(我核对过 `app.asar`:`ses
|
|
|
182
184
|
|
|
183
185
|
**正在使用的会话不会被误删**:定时清理会跳过最近 3 分钟内有写入的会话(打开着的会话一直在写转写文件),5 分钟后再试一次。退出时的删除不受这个保护影响 —— 退出本来就是你要求清理。
|
|
184
186
|
|
|
187
|
+
### 全部设置图形化 + 配置热重载(0.2.8)
|
|
188
|
+
|
|
189
|
+
详情页最上面那张卡现在能改**全部 8 项**配置,不用再碰文本:
|
|
190
|
+
|
|
191
|
+
| 设置 | 对应键 |
|
|
192
|
+
| --- | --- |
|
|
193
|
+
| 显示「临时」按钮 | `SHOW_TEMP_BUTTON` |
|
|
194
|
+
| CHAT 官网模式:隐藏 / 显示 | `TEMP_IN_CHAT_MODE` |
|
|
195
|
+
| 按钮摆法:并排 / 独占一行 | `TEMP_BUTTON_STYLE` |
|
|
196
|
+
| 会话默认全展开 | `EXPAND_ALL_SESSIONS` |
|
|
197
|
+
| 退出 DSH 时删除 | `DELETE_ON_EXIT` |
|
|
198
|
+
| 每天定时清理 + 时间 | `SCHEDULE_DELETE` / `SCHEDULE_TIME` |
|
|
199
|
+
| 最多保留几个 | `MAX_KEPT` |
|
|
200
|
+
| 立即清理临时会话 | 手动触发 `purge` |
|
|
201
|
+
|
|
202
|
+
两条路写的是同一个文件:详情页开关按行替换(注释、空行、顺序原样保留),Host 半用 `mtime + size` 感知外部改动并递增 `configRevision`;客户端每 2.5–3 秒轮询一次,看到新版本就原地重应用。所以**记事本改完保存,约 3 秒自动生效,不用重启 DSH**;反过来 UI 保存前也会先重新读文件,不会把刚手改的其它行覆盖掉。卡片底部会显示当前的「设置版本」号,方便确认有没有生效。
|
|
203
|
+
|
|
204
|
+
> 仍然需要重启的只有一件事:**升级插件包本身**(`lib/` 里的客户端代码不会热重载)。
|
|
205
|
+
> The only thing that still needs a restart is upgrading the plugin package itself.
|
|
206
|
+
|
|
185
207
|
### 配置(记事本可改)
|
|
186
208
|
|
|
187
|
-
`temp-session-config.txt
|
|
209
|
+
`temp-session-config.txt`,只改等号右边,保存后**约 3 秒自动生效,不用重启**;详情页的开关写的是同一个文件。
|
|
188
210
|
|
|
189
211
|
| 键 | 默认 | 作用 |
|
|
190
212
|
| --- | --- | --- |
|