dsh-sidebar-row-menu 1.4.0 → 1.4.2

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,46 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.4.2 — 2026-11-03
4
+
5
+ ### Added
6
+
7
+ - **Delete workspace and all sessions**: a new workspace row entry removes every
8
+ session transcript under the workspace first, then drops the workspace
9
+ registration. The built-in "Delete workspace" is unchanged and still keeps
10
+ sessions under "Ungrouped". If any session fails to delete, the workspace is kept
11
+ so the user can retry. Backed by a new `POST /dsh-sidebar-row-menu/workspace/delete`
12
+ route.
13
+ - **Also show in the "…" menu**: every plugin right-click entry can now be added
14
+ individually to the row's native "…" menu (Settings → "Row menu" → "Also show in
15
+ the "…" menu"). Session entries mount through the existing session slot;
16
+ workspace entries make the plugin render the "…" menu with the official
17
+ Rename / Delete workspace items plus the enabled entries. All switches are off by
18
+ default, so the native menu is untouched until opted in.
19
+
20
+ ### 中文摘要
21
+
22
+ - 工作区右键新增「删除工作区及所有会话」:先逐个永久删除会话日志,全部成功后再删除
23
+ 工作区登记;任一会话失败则保留工作区便于重试。内置「删除工作区」行为不变(会话归入
24
+ 「未分组」)。新增宿主路由 `POST /dsh-sidebar-row-menu/workspace/delete`。
25
+ - 设置 →「行菜单」新增「同时放进「…」菜单」:可逐项把插件右键条目加进行尾「…」菜单。
26
+ 会话条目走原生 slot;工作区开启任意一项后由插件接管「…」按钮,保留官方「重命名 /
27
+ 删除工作区」。全部默认关闭,未开启时「…」菜单与 DSH 原样一致。
28
+
29
+ ## 1.4.1 — 2026-11-03
30
+
31
+ ### Added
32
+
33
+ - **Allow deleting unarchived sessions** (off by default): a new switch in
34
+ Settings → "Row menu" extends the existing "Delete session permanently" entry to
35
+ unarchived session rows. The confirmation dialog, host route and transcript
36
+ cleanup are unchanged; without the switch the entry stays archived-only.
37
+
38
+ ### 中文摘要
39
+
40
+ - 设置 →「行菜单」新增「允许删除未归档会话」开关(默认关闭)。开启后,未归档会话的
41
+ 右键菜单也会出现「永久删除会话」,确认后按原有宿主路由删除日志;关闭时维持仅已归档
42
+ 会话可见。
43
+
3
44
  ## 1.4.0 — 2026-11-03
4
45
 
5
46
  ### Added
package/README.en.md CHANGED
@@ -39,7 +39,8 @@ or hardcode any built-in action.
39
39
  | Open with | A submenu of external apps (editors, terminals, file managers) sharing the session menu's catalog, pinning and toggles; hover expands it |
40
40
  | Copy workspace path | Copies the directory path |
41
41
  | Open in new tab | Only when `dsh-project-tabs` (exposing `openWorkspaceInTab`) is installed |
42
- | Delete workspace | Opens the official delete confirmation |
42
+ | Delete workspace | Opens the official delete confirmation; removes only the workspace registration and leaves its sessions under "Ungrouped" |
43
+ | Delete workspace and all sessions | Permanently deletes every session and transcript under the workspace first, then the workspace registration. If any session fails, the workspace is kept so the user can retry. The directory itself is not deleted |
43
44
 
44
45
  ### Session row
45
46
 
@@ -49,7 +50,7 @@ Right-click does not build a second menu; it opens the row's own "…" menu:
49
50
  | --- | --- |
50
51
  | DSH built-ins | Rename, Fork session, Pin / Unpin, Archive / Unarchive, Copy Session ID |
51
52
  | Other plugins | Whatever they register into `sidebar.workspaces.session.menu.item` |
52
- | This plugin | Pinned open-with apps (top level), Open with (submenu), Delete session / Delete all archived sessions (archived rows only) |
53
+ | This plugin | Pinned open-with apps (top level), Open with (submenu), Delete session / Delete all archived sessions (archived rows by default; unarchived rows can be opted in) |
53
54
 
54
55
  The entries added by this plugin:
55
56
 
@@ -57,18 +58,26 @@ The entries added by this plugin:
57
58
  | --- | --- |
58
59
  | Open with | A submenu of external apps provided by the host (editors, terminals, file managers) opening the session's `cwd`; falls back to its workspace directory. Hovering the row expands the submenu |
59
60
  | Pinned open-with app | A pinned app shows directly at the top level (e.g. "Open with Visual Studio Code"). Until configured, the first detected editor is pinned automatically, otherwise the first catalog app |
60
- | Delete session | Only on archived sessions; permanently deletes that one session and its transcript after confirmation |
61
+ | Delete session | On archived sessions by default; permanently deletes that one session and its transcript after confirmation. Enable "Allow deleting unarchived sessions" in Settings to show it on unarchived rows too |
61
62
  | Delete all archived sessions | Only on archived sessions; permanently deletes every archived session and its transcript after confirmation |
62
63
 
63
64
  The "Open with" catalog comes from DSH's built-in `open-in-app` routes, so it is the
64
65
  same source DSH itself uses; labels and icons are rendered by this plugin, each app
65
66
  can be hidden in Settings, and frequently used apps can be pinned to the top level.
66
- Both delete entries are served by this plugin's own host route. They never
67
- touch unarchived sessions and do not cascade into forked child sessions.
67
+ Both delete entries are served by this plugin's own host route. They leave
68
+ unarchived sessions alone by default; the opt-in switch extends the single-session
69
+ entry to them. Deletion never cascades into forked child sessions.
68
70
 
69
- These entries are **right-click only**: they do not mount when the "…" button opens
70
- the menu. A short-lived window flag is set before opening; outside that window the
71
- entries render `null`.
71
+ These entries are **right-click only by default**: they do not mount when the "…"
72
+ button opens the menu. A short-lived window flag is set before opening; outside that
73
+ window the entries render `null`.
74
+
75
+ To use them from the row's "…" button, enable them one by one under Settings →
76
+ "Row menu" → "Also show in the "…" menu". Session entries mount into the native
77
+ "…" menu; enabling any workspace entry makes this plugin take over the row's "…"
78
+ button and render the official "Rename / Delete workspace" items alongside the
79
+ enabled plugin entries. With everything off, the "…" button behaves exactly like
80
+ DSH's own.
72
81
 
73
82
  Blank draft sessions have no native "…" menu and are left alone. Rows that are
74
83
  neither a workspace nor a session (e.g. "Show more") are not intercepted.
@@ -81,11 +90,18 @@ Settings → "Row menu" toggles every new entry:
81
90
  | --- | --- |
82
91
  | Open with | Hides "Open with" and every pinned app from workspace and session menus |
83
92
  | Open with → applications | Hides individual applications; the adjacent "Pin" button promotes an app to the top level |
84
- | Delete session | Hides the single-session delete entry on archived rows |
93
+ | Delete session | Hides the single-session delete entry in session menus |
94
+ | Allow deleting unarchived sessions | Off by default; also shows "Delete session permanently" on unarchived rows. Requires the previous switch |
85
95
  | Delete all archived sessions | Hides the bulk-delete entry |
96
+ | Also show in the "…" menu → workspace | Adds workspace right-click entries one by one to the row's "…" menu: New session, Open with, Copy workspace path, Open in new tab, Delete workspace and all sessions. Enabling any of them makes this plugin render the "…" menu |
97
+ | Also show in the "…" menu → session | Adds session right-click entries one by one to the native "…" menu: Open with, Delete session, Delete all archived sessions |
98
+
99
+ The "Also show in the "…" menu" switches are all off by default; until one is
100
+ enabled the "…" menu is exactly DSH's own.
86
101
 
87
102
  Switches live in browser `localStorage` (`dsh.sidebar-row-menu.items.v1`,
88
- `dsh.sidebar-row-menu.open-with.v1` and `dsh.sidebar-row-menu.open-with.pinned.v1`)
103
+ `dsh.sidebar-row-menu.open-with.v1`, `dsh.sidebar-row-menu.open-with.pinned.v1` and
104
+ `dsh.sidebar-row-menu.ellipsis.v1`)
89
105
  and apply immediately. Before the first explicit pin, the plugin derives one: the
90
106
  first detected editor (usually VS Code), or the first catalog app when no editor
91
107
  exists.
@@ -124,13 +140,13 @@ resolve it directly by name:
124
140
  Pin a version by appending it to the name:
125
141
 
126
142
  ```
127
- dsh-sidebar-row-menu@1.4.0
143
+ dsh-sidebar-row-menu@1.4.2
128
144
  ```
129
145
 
130
146
  Equivalent command line:
131
147
 
132
148
  ```powershell
133
- dsh plugin --profile desktop add dsh-sidebar-row-menu@1.4.0
149
+ dsh plugin --profile desktop add dsh-sidebar-row-menu@1.4.2
134
150
  ```
135
151
 
136
152
  ### Install from GitHub
@@ -150,13 +166,13 @@ repository is already runnable, so **no local build is required**.
150
166
  That URL tracks the latest commit on `main`. Pin a tag for a stable version:
151
167
 
152
168
  ```
153
- https://github.com/TLEWA/dsh-sidebar-row-menu#v1.4.0
169
+ https://github.com/TLEWA/dsh-sidebar-row-menu#v1.4.2
154
170
  ```
155
171
 
156
172
  Or install the tarball built by Actions directly, without Git:
157
173
 
158
174
  ```
159
- https://github.com/TLEWA/dsh-sidebar-row-menu/releases/download/v1.4.0/dsh-sidebar-row-menu-1.4.0.tgz
175
+ https://github.com/TLEWA/dsh-sidebar-row-menu/releases/download/v1.4.2/dsh-sidebar-row-menu-1.4.2.tgz
160
176
  ```
161
177
 
162
178
  Equivalent command line:
@@ -288,8 +304,9 @@ lib/index.js host entry: name / inject / apply plus re-exported helpers
288
304
  lib/host/security.js loopback request fence
289
305
  lib/host/paths.js path validation, vscode://file encoding
290
306
  lib/host/launch.js VS Code / Explorer launching
291
- lib/host/route.js /open and /session/delete routes, HTTP status codes
307
+ lib/host/route.js /open, /session/delete and /workspace/delete routes, HTTP status codes
292
308
  lib/host/session-delete.js transcript verification and deletion (detach / rm / re-check)
309
+ lib/host/workspace-delete.js workspace + all sessions deletion, workspace kept on failure
293
310
  lib/client.js browser half: fiber lookup, slot registration, menu mount
294
311
  cordis.patch.yml bundle patch inserting the plugin into the profile tree
295
312
  scripts/install.ps1 pnpm-free install / uninstall
@@ -385,6 +402,16 @@ the row's existing menu.
385
402
  - partial failures return `200` + `{ ok:false, deleted, failed, error }`; the dialog
386
403
  stays open and reports the counts.
387
404
 
405
+ `POST /dsh-sidebar-row-menu/workspace/delete`, body `{ workspaceId: string }`.
406
+
407
+ - same loopback / POST / 64 KB body checks; `workspaceId` must be a non-empty string;
408
+ - reads `workspaceRegistry.get(workspaceId).sessionIds` and permanently deletes each
409
+ session with the flow above;
410
+ - only when every session was deleted (including sessions that were already gone)
411
+ does it call `workspaceRegistry.delete()`; any failure returns `200` + `ok:false`
412
+ and keeps the workspace, so no orphaned "Ungrouped" sessions are left behind;
413
+ - an unknown workspace returns `ok:true, missing:true` and is not an error.
414
+
388
415
  "Open with" does not touch this plugin's host: it calls DSH's built-in
389
416
  `open-in-app/apps`, `open-in-app/open` and `open-in-app/icon/<id>` directly.
390
417
 
@@ -403,9 +430,10 @@ Built against DSH client `0.2.1-rc.5` (`ProjectRowItem`, `SessionNodeItem`,
403
430
  - Session right-click depends on the row's `Menu` staying in the fiber subtree. If
404
431
  it is not found, the plugin clicks the row-actions ellipsis button; failing that
405
432
  it gives up — it never builds a competing menu and never triggers row open.
406
- - Permanent deletion is offered for **archived** sessions only; unarchived sessions
407
- still use the built-in archive/unarchive. Deletion does not cascade into forked
408
- child sessions — delete those separately when needed.
433
+ - Permanent deletion is offered for **archived** sessions by default; enable
434
+ "Allow deleting unarchived sessions" to delete unarchived sessions from their
435
+ right-click menu as well. Deletion does not cascade into forked child sessions —
436
+ delete those separately when needed.
409
437
  - Deletion works directly on the transcript directory; the host has no trash bin.
410
438
  The confirmation dialog states that it cannot be undone.
411
439
  - The open-with directory for a session comes from `sessions.list`'s `cwd`,
package/README.md CHANGED
@@ -33,7 +33,8 @@
33
33
  | 打开方式 | 二级菜单列出宿主提供的外部应用(编辑器、终端、文件管理器);与会话菜单共用同一套应用列表、置顶与开关设置,鼠标悬浮自动展开 |
34
34
  | 复制工作区路径 | 复制目录路径到剪贴板 |
35
35
  | 在新标签中打开 | 仅在装有 `dsh-project-tabs`(暴露 `openWorkspaceInTab`)时出现 |
36
- | 删除工作区 | 打开官方删除确认对话框 |
36
+ | 删除工作区 | 打开官方删除确认对话框;只删除工作区登记,会话保留并归入「未分组」 |
37
+ | 删除工作区及所有会话 | 先永久删除该工作区下的每个会话及其日志,全部成功后再删除工作区登记;任一会话删除失败则保留工作区,便于重试。工作区目录本身不删除 |
37
38
 
38
39
  ### 会话行右键
39
40
 
@@ -43,7 +44,7 @@
43
44
  | --- | --- |
44
45
  | DSH 内置 | 重命名、分叉会话、置顶 / 取消置顶、归档 / 取消归档、复制 Session ID |
45
46
  | 其他插件 | 它们注册进 `sidebar.workspaces.session.menu.item` 的条目 |
46
- | 本插件 | 置顶的打开方式(一级)、打开方式(二级菜单)、永久删除会话 / 删除所有已归档会话(仅已归档会话显示) |
47
+ | 本插件 | 置顶的打开方式(一级)、打开方式(二级菜单)、永久删除会话 / 删除所有已归档会话(默认仅已归档会话显示;可在设置里允许删除未归档会话) |
47
48
 
48
49
  本插件追加的条目:
49
50
 
@@ -51,17 +52,21 @@
51
52
  | --- | --- |
52
53
  | 打开方式 | 二级菜单列出宿主提供的外部应用(编辑器、终端、文件管理器),用会话自己的 `cwd` 打开;取不到时退回所属工作区目录 |
53
54
  | 置顶的打开方式 | 被置顶的应用直接显示在一级菜单(例如「用 Visual Studio Code 打开」);未配置时自动置顶检测到的第一个编辑器,没有编辑器则置顶第一个应用。鼠标悬浮到「打开方式」会自动展开二级菜单 |
54
- | 永久删除会话 | 只在已归档会话的右键菜单里出现;确认后永久删除这一个会话及其日志,不可恢复 |
55
+ | 永久删除会话 | 默认只在已归档会话的右键菜单里出现;确认后永久删除这一个会话及其日志,不可恢复。在设置里开启「允许删除未归档会话」后,未归档会话也会出现这一项 |
55
56
  | 删除所有已归档会话 | 只在已归档会话的右键菜单里出现;确认后永久删除全部已归档会话及其日志,不可恢复 |
56
57
 
57
58
  「打开方式」的应用列表来自 DSH 内置的 `open-in-app` 路由,与 DSH 自己的「打开方式」
58
59
  能力同源;应用名和图标都由本插件展示,可在设置里逐个隐藏,也可以把常用应用置顶到
59
- 一级菜单。两个删除入口由本插件自己的宿主路由完成,不会删除未归档会话,
60
- 也不级联删除 fork 子会话。
60
+ 一级菜单。两个删除入口由本插件自己的宿主路由完成,默认不会删除未归档会话;
61
+ 开启「允许删除未归档会话」后才会对普通会话开放。删除不会级联删除 fork 子会话。
61
62
 
62
- 这些条目都是**右键专属**:点行尾「…」按钮时它们不挂载。实现上使用一个只在右键展开瞬间
63
+ 这些条目默认是**右键专属**:点行尾「…」按钮时它们不挂载。实现上使用一个只在右键展开瞬间
63
64
  有效的窗口标记,窗口外的渲染直接返回 `null`。
64
65
 
66
+ 如果想直接使用行尾「…」菜单,可以在设置 →「行菜单」→「同时放进「…」菜单」里逐个开启:
67
+ 会话条目会挂进原生「…」菜单;工作区行开启任意一项后,本插件会接管行尾「…」按钮,用同一套
68
+ 菜单展示官方「重命名 / 删除工作区」加上已开启的插件条目。全部关闭时「…」按钮保持 DSH 原样。
69
+
65
70
  草稿会话(还没有任何消息的空白会话)没有内置「…」菜单,本插件同样不接管。
66
71
  非工作区 / 非会话的侧边栏行(如“显示更多”)也不会被拦截。
67
72
 
@@ -73,11 +78,17 @@
73
78
  | --- | --- |
74
79
  | 打开方式 | 关闭后工作区 / 会话菜单里不再出现「打开方式」和置顶应用 |
75
80
  | 打开方式 → 应用 | 逐个隐藏应用;旁边的「置顶」按钮把应用移到一级菜单 |
76
- | 永久删除会话 | 关闭后已归档会话菜单里不再出现单条删除入口 |
81
+ | 永久删除会话 | 关闭后会话菜单里不再出现单条删除入口 |
82
+ | 允许删除未归档会话 | 默认关闭;开启后未归档会话的右键菜单也会出现「永久删除会话」,需先开启上一项 |
77
83
  | 删除所有已归档会话 | 关闭后不再出现批量删除入口 |
84
+ | 同时放进「…」菜单 → 工作区 | 逐项把工作区行右键条目加进行尾「…」菜单:新会话、打开方式、复制工作区路径、在新标签中打开、删除工作区及所有会话。开启任意一项后「…」按钮改由本插件渲染 |
85
+ | 同时放进「…」菜单 → 会话 | 逐项把会话行右键条目加进原生「…」菜单:打开方式、永久删除会话、删除所有已归档会话 |
86
+
87
+ 「同时放进「…」菜单」下的开关默认全部关闭,`…` 菜单在未开启时与 DSH 完全一致。
78
88
 
79
89
  开关存在浏览器 `localStorage`(`dsh.sidebar-row-menu.items.v1`、
80
- `dsh.sidebar-row-menu.open-with.v1` 与 `dsh.sidebar-row-menu.open-with.pinned.v1`),
90
+ `dsh.sidebar-row-menu.open-with.v1`、`dsh.sidebar-row-menu.open-with.pinned.v1` 与
91
+ `dsh.sidebar-row-menu.ellipsis.v1`),
81
92
  改完立即生效,不需要重启。置顶项在第一次配置前是自动推导的:优先置顶检测到的第一个
82
93
  编辑器(通常是 VS Code),没有编辑器时置顶应用列表里的第一个。
83
94
 
@@ -112,13 +123,13 @@
112
123
  要固定版本,在包名后加版本号:
113
124
 
114
125
  ```
115
- dsh-sidebar-row-menu@1.4.0
126
+ dsh-sidebar-row-menu@1.4.2
116
127
  ```
117
128
 
118
129
  命令行等价写法:
119
130
 
120
131
  ```powershell
121
- dsh plugin --profile desktop add dsh-sidebar-row-menu@1.4.0
132
+ dsh plugin --profile desktop add dsh-sidebar-row-menu@1.4.2
122
133
  ```
123
134
 
124
135
  ### 从 GitHub 安装
@@ -138,13 +149,13 @@ DSH 桌面端通过 pnpm 安装 Git 依赖;本仓库的 `lib/` 已是可直接
138
149
  该地址跟随 `main` 的最新提交。要固定版本,在地址后加标签:
139
150
 
140
151
  ```
141
- https://github.com/TLEWA/dsh-sidebar-row-menu#v1.4.0
152
+ https://github.com/TLEWA/dsh-sidebar-row-menu#v1.4.2
142
153
  ```
143
154
 
144
155
  也可以直接安装 Actions 打出的压缩包(不经过 Git):
145
156
 
146
157
  ```
147
- https://github.com/TLEWA/dsh-sidebar-row-menu/releases/download/v1.4.0/dsh-sidebar-row-menu-1.4.0.tgz
158
+ https://github.com/TLEWA/dsh-sidebar-row-menu/releases/download/v1.4.2/dsh-sidebar-row-menu-1.4.2.tgz
148
159
  ```
149
160
 
150
161
  命令行等价写法:
@@ -259,8 +270,9 @@ lib/index.js 宿主入口:name / inject / apply,再导出可测试
259
270
  lib/host/security.js loopback 请求围栏
260
271
  lib/host/paths.js 路径校验、vscode://file 编码
261
272
  lib/host/launch.js VS Code / 资源管理器启动
262
- lib/host/route.js /open 与 /session/delete 路由、HTTP 状态码
273
+ lib/host/route.js /open、/session/delete 与 /workspace/delete 路由、HTTP 状态码
263
274
  lib/host/session-delete.js 会话日志目录的校验与删除(detach / rm / 复查)
275
+ lib/host/workspace-delete.js 删除工作区及其所有会话;会话失败时保留工作区
264
276
  lib/client.js 客户端半边:fiber 解析、slot 注册、菜单挂载
265
277
  cordis.patch.yml bundle patch:把插件插进 profile 插件树
266
278
  scripts/install.ps1 无 pnpm 的安装 / 卸载脚本
@@ -340,6 +352,14 @@ test/*.test.mjs node:test
340
352
  `api-session/removed`;
341
353
  - 部分失败返回 `200` + `{ ok:false, deleted, failed, error }`,前端保留对话框并显示计数。
342
354
 
355
+ `POST /dsh-sidebar-row-menu/workspace/delete`,body `{ workspaceId: string }`。
356
+
357
+ - 同样的 loopback / POST / 64 KB body 校验;`workspaceId` 必须是非空字符串;
358
+ - 先读取 `workspaceRegistry.get(workspaceId).sessionIds`,用上面的会话删除流程逐个永久删除;
359
+ - 只有全部会话删除成功(包括本来就不存在的会话)才调用 `workspaceRegistry.delete()`;
360
+ 任一会话失败返回 `200` + `ok:false` 并保留工作区,避免留下无人管理的「未分组」会话;
361
+ - 未知工作区返回 `ok:true, missing:true`,不视为错误。
362
+
343
363
  「打开方式」不经过本插件宿主:直接调用 DSH 内置的 `open-in-app/apps`、
344
364
  `open-in-app/open`、`open-in-app/icon/<id>`。
345
365
 
@@ -356,8 +376,8 @@ DSH 升级若改动行组件或菜单定位实现:
356
376
  - 依赖 DSH 内置行组件的 props 形状。DSH 升级若改了这两个组件,右键会静默不弹。
357
377
  - 会话右键依赖行内 `Menu` 组件仍在 fiber 子树里。找不到时退回点击行内操作区的
358
378
  省略号按钮,再找不到就放弃 —— 不会自建菜单,也不会误触行的打开动作。
359
- - 永久删除只对**已归档**会话开放;未归档会话仍只能用内置的归档 / 取消归档。删除不会
360
- 级联删除 fork 出来的子会话,需要时请分别删除。
379
+ - 永久删除默认只对**已归档**会话开放;在设置里开启「允许删除未归档会话」后,未归档
380
+ 会话也能从右键菜单直接删除。删除不会级联删除 fork 出来的子会话,需要时请分别删除。
361
381
  - 删除操作直接作用于会话日志目录,宿主没有回收站;确认框里已明确提示不可恢复。
362
382
  - 会话行「打开方式」的目录来自 `sessions.list` 的 `cwd`,取不到时退回
363
383
  所属工作区目录;未分组会话可能没有目录,此时会提示“没有可用的目录路径”。