dsh-sidebar-fold 0.1.15 → 0.1.17
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 +23 -1
- package/LICENSE +21 -21
- package/README.md +6 -0
- package/README.zh.md +5 -0
- package/cordis.patch.yml +17 -17
- package/dsh.plugin.json +2 -2
- package/lib/client.js +345 -17
- package/package.json +4 -4
- package/screenshots.json +6 -6
- package/src/client/constants.ts +17 -1
- package/src/client/fold.ts +213 -6
- package/src/client/index.ts +10 -2
- package/src/client/locales.ts +21 -1
- package/src/client/settings-card.ts +93 -27
- package/src/client/star-row-copy.ts +108 -107
- package/src/index.js +13 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.17 (2026-11-27)
|
|
4
|
+
|
|
5
|
+
**修复:拖动排序只有反馈、顺序不变。**
|
|
6
|
+
|
|
7
|
+
- 根因:0.1.16 的 `applyOrder` 用 `parent.insertBefore(row, next)` 搬 DOM 节点。宿主 0.2.2 起每行按钮各自包在 `div._panelEntry` 里(`SidebarRoot.tsx:78`),`next` 属于另一个父节点 → DOM 抛 `NotFoundError` → 被 `try` 静默吞掉 → 拖动高亮有、松手列顺序没变;顺序落盘了也永远不生效。
|
|
8
|
+
- 改法:改用 CSS `order`,写在每行 **wrapper** 上(`.panelList` 是 `display:flex;flex-direction:column`)。不搬宿主节点、React 重渲染后依然成立、只在值变化时写,`orderLabels` 清空即撤掉,卸载/HMR 一并清理;「更多」header 的 rank 恒为最大值,仍是折叠开关。
|
|
9
|
+
- 拖动绑定从按钮挪到行 wrapper(该行就是 flex item,落在右侧 pin 留白上也能命中),并在`drop` 时清掉 source 再算新序。
|
|
10
|
+
- 设置卡同一处修复:原来 drop 后把新行 append 到卡片末尾(旧行还在 → 列表看着「没变」且重复),现在统一走 `applyConfig({orderLabels})` → `paint()` → `commit({orderLabels})`;卡片行的类从「拖动反馈」换成拖柄类(此前每行常驻 `opacity:.45`,读起来像禁用)。
|
|
11
|
+
- 新增 `tests/order-apply.test.ts`(5 条,锁「只写 rank、不搬节点、幂等、清空可撤」)+ `tests/order.test.ts` 反回归断言(`fold.ts` 运行代码里不得出现 `insertBefore`)。
|
|
12
|
+
|
|
13
|
+
## 0.1.16 (2026-11-27)
|
|
14
|
+
|
|
15
|
+
**侧边栏入口行排序:除「更多」外全部可拖,顺序持久化到 Config。**
|
|
16
|
+
|
|
17
|
+
- `orderLabels`(volatile Config 字段,缺省 `[]` = 宿主 DOM 原序):侧边栏行内 DnD 与设置卡片 DnD 两面共享同一来源与写路径。
|
|
18
|
+
- 新增纯函数 `reorderLabels` / `orderedRows`;`applyFold` 用幂等 `insertBefore` 重排,抗 MutationObserver 自激;「更多」header 恒固定末尾,折叠开关不变。
|
|
19
|
+
- 设置卡入口行加拖柄,drop 后 `commit({orderLabels})`;`index.ts` 把侧栏拖动经 `subscribeOrder` 桥接回同一 scope 落盘。
|
|
20
|
+
- 10 语字典 + locale 元数据同步新增 `settings.rowDrag` / `rowDragHint`;新增 `scripts/check-surface-classes.mjs` 并接进 prepack。
|
|
21
|
+
- **发版事故记录**:本版本的 CI release 运行以 `npm error 409 Cannot publish over previously staged version "0.1.16"` 失败
|
|
22
|
+
(同一版本一旦进入 npm staged 状态,重推同 tag 必失败),最终由本地 `npm publish` 补发、GitHub Release 事后回填。
|
|
23
|
+
0.1.15 同型。→ 结论:修发版失败必须换版本号,不要重推已有 tag(v0.1.17 即由此而来)。
|
|
24
|
+
|
|
3
25
|
## 0.1.15
|
|
4
26
|
|
|
5
27
|
- 设置面新增 star 快车道行(单源 _tools/star-row 生成,10 语;GitHub 单色图标 + 仓库直达链接 + 一句工程话术,整行可点,无弹窗无打断)。
|
|
@@ -21,4 +43,4 @@
|
|
|
21
43
|
|
|
22
44
|
- 折叠标记落在 panelEntry 包装层,避免与宿主行级 class 冲突(issue #2)。
|
|
23
45
|
- 新增第 10 种 runtime 字典 `pt`(巴西葡萄牙语),locale 文件与门禁同步到 10 种。
|
|
24
|
-
- README.pt.md 镜像翻译,`files[]` 收录。
|
|
46
|
+
- README.pt.md 镜像翻译,`files[]` 收录。
|
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 drscrewdriver
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 drscrewdriver
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -29,6 +29,11 @@ folds those add-on rows away so only the “More” line remains; the arrow flip
|
|
|
29
29
|
in the “More” menu, from where the host's own pin control brings it back; the plugin
|
|
30
30
|
reconciles both sides on boot, on a config write and on every sidebar repaint — including
|
|
31
31
|
after a reload, where the host's in-memory pin table comes back empty.
|
|
32
|
+
- **Reorderable entries** — drag any add-on row onto another row in the sidebar, or drag the
|
|
33
|
+
handle inside the settings card, to change the column order. The order is stored in `Config`
|
|
34
|
+
(`orderLabels`) and applied as CSS `order` on the host's row wrappers — no host node is moved,
|
|
35
|
+
so a host repaint cannot undo it; the “More” row stays last and the fold toggle keeps working.
|
|
36
|
+
Both surfaces share one order, and clearing the config restores the host's own DOM order.
|
|
32
37
|
- **Configurable** — default state, the three-state row controls and the row alignment live
|
|
33
38
|
in the plugin's settings card (host `Config`, `.volatile()`, applied without a restart).
|
|
34
39
|
- **Rail-safe** — when the sidebar is collapsed to the 36 px icon rail the toggle is
|
|
@@ -77,6 +82,7 @@ path; a host without that service falls back to selecting the Plugins panel.
|
|
|
77
82
|
|---|---|---|
|
|
78
83
|
| Folded by default | State a window starts in when it has no local record | off |
|
|
79
84
|
| Row alignment | Three-way segmented control (left / centre / right) for the managed rows; the “More” row follows the same setting | left |
|
|
85
|
+
| Entry order | Drag a row onto another row (in the sidebar or in this card) to reorder; stored in the config, kept across reloads and repaints, the “More” row stays last | host DOM order |
|
|
80
86
|
| Entries (one per row) | **Show** = always visible; **Fold** = may be folded (default); **Hide in More** = move it into the host's “More” menu | Fold |
|
|
81
87
|
|
|
82
88
|
The row list is read from the DOM at open time, so a panel installed later shows up
|
package/README.zh.md
CHANGED
|
@@ -21,6 +21,10 @@
|
|
|
21
21
|
「隐藏到更多」= 把该行交给宿主自己的「更多」菜单(等价于点宿主的“取消固定”),
|
|
22
22
|
行从侧边栏消失、出现在「更多」列表里,可在里面一键固定回来;插件负责在启动、改配置与
|
|
23
23
|
侧边栏重绘时**反向校准**两边状态,宿主内存态的固定表丢了也能恢复。
|
|
24
|
+
- **入口行可排序** —— 在侧边栏把任意加项行拖到另一行上(「更多」不参与),或在设置卡里拖动
|
|
25
|
+
行上的拖柄,即可改变列顺序。顺序存进 `Config`(`orderLabels`),以 CSS `order` 写在宿主的
|
|
26
|
+
行 wrapper 上 —— 不搬宿主节点,宿主重绘也抹不掉;「更多」恒在末尾、折叠钮照常可用。
|
|
27
|
+
两侧共享同一份顺序,清空配置即恢复宿主自身的 DOM 原序。
|
|
24
28
|
- **可配置** —— 默认态、每行三档、行对齐都在插件设置卡里改(宿主 `Config` + `.volatile()`,
|
|
25
29
|
保存即生效,不用重启)。
|
|
26
30
|
- **窄栏友好** —— 侧边栏收成 36px 图标栏时自动摘掉按钮并显示全部行:不挤压、不留半隐藏态。
|
|
@@ -65,6 +69,7 @@ key 为包名);或点侧栏 **「更多」菜单最下面的「侧栏折叠
|
|
|
65
69
|
| 默认折叠 | 窗口在没有本地记录时采用的初始状态 | 关 |
|
|
66
70
|
| 文字与图标对齐 | 三档分段控件(左 / 居中 / 右);作用于被折叠管理的入口行,「更多」行跟随同一档 | 左 |
|
|
67
71
|
| 入口行(逐行) | 每行三选一:**显示**=一直显示(不折叠);**折叠**=允许折叠(默认);**隐藏到更多**=移进宿主「更多」菜单 | 折叠 |
|
|
72
|
+
| 入口行排序 | 按住入口行拖到目标位置(侧边栏与设置卡通用);顺序保存到设置,刷新与重绘后保持,「更多」固定末尾 | 宿主 DOM 原序 |
|
|
68
73
|
|
|
69
74
|
行清单在打开卡片时从 DOM 读取,所以之后新装的入口会自动出现在列表里;如果全部都开了「显示」,
|
|
70
75
|
折叠钮会自动置灰并报 `aria-disabled="true"`,不会出现“箭头动了但什么都没变”。
|
package/cordis.patch.yml
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
# dsh-sidebar-fold bundle patch
|
|
2
|
-
#
|
|
3
|
-
# Assembly layer for the DSH profiles whose bundle list includes this package.
|
|
4
|
-
# A pure ADDITION: one insert row carrying an id no shipped entry uses. No
|
|
5
|
-
# shipped row is disabled, renamed, or reconfigured here, so the patch stays
|
|
6
|
-
# safe to compose with any other plugin's patch.
|
|
7
|
-
#
|
|
8
|
-
# The row exists so the loader has a host-side entry point (src/index.js, which
|
|
9
|
-
# installs nothing) and so the bundle's settings namespace is served under this
|
|
10
|
-
# package's name; every behaviour lives in the browser half (lib/client.js).
|
|
11
|
-
#
|
|
12
|
-
# Install (recommended, official CLI):
|
|
13
|
-
# dsh plugin --profile <profile> add dsh-sidebar-fold
|
|
14
|
-
|
|
15
|
-
- insert:
|
|
16
|
-
- id: dsh-sidebar-fold
|
|
17
|
-
name: dsh-sidebar-fold
|
|
1
|
+
# dsh-sidebar-fold bundle patch
|
|
2
|
+
#
|
|
3
|
+
# Assembly layer for the DSH profiles whose bundle list includes this package.
|
|
4
|
+
# A pure ADDITION: one insert row carrying an id no shipped entry uses. No
|
|
5
|
+
# shipped row is disabled, renamed, or reconfigured here, so the patch stays
|
|
6
|
+
# safe to compose with any other plugin's patch.
|
|
7
|
+
#
|
|
8
|
+
# The row exists so the loader has a host-side entry point (src/index.js, which
|
|
9
|
+
# installs nothing) and so the bundle's settings namespace is served under this
|
|
10
|
+
# package's name; every behaviour lives in the browser half (lib/client.js).
|
|
11
|
+
#
|
|
12
|
+
# Install (recommended, official CLI):
|
|
13
|
+
# dsh plugin --profile <profile> add dsh-sidebar-fold
|
|
14
|
+
|
|
15
|
+
- insert:
|
|
16
|
+
- id: dsh-sidebar-fold
|
|
17
|
+
name: dsh-sidebar-fold
|
package/dsh.plugin.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "dsh-external/dsh-sidebar-fold",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.17",
|
|
4
4
|
"main": "./src/index.js",
|
|
5
5
|
"description": "折叠左侧栏加项入口:在宿主「更多」行挂一个 28×28 方形箭头按钮,把自动化任务、agent 团队、插件市场、上下文页等加项面板行收纳成一行;设置卡每行三档:显示(一直显示)/ 折叠(允许折叠)/ 隐藏到更多(移进宿主「更多」菜单,宿主 0.2.2 起)。还可调默认态与行内文字图标对齐(左/居中/右)。",
|
|
6
6
|
"engines": {
|
|
@@ -13,4 +13,4 @@
|
|
|
13
13
|
"client": {
|
|
14
14
|
"main": "./lib/client.js"
|
|
15
15
|
}
|
|
16
|
-
}
|
|
16
|
+
}
|