@moonsand/dsh-ui-optimize 0.0.0-stage → 0.9.26

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 MoonSand
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
@@ -1,3 +1,62 @@
1
- # Temporary Holding Version
1
+ # dsh-ui-optimize
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ English | [中文](README.zh.md)
4
+
5
+ Three independent features for the DeepSeek Harness web interface, each with its own switch: a **theme gallery** of eight minimalist themes (each defining one palette for light and one for dark), the **desktop Reload/Restart buttons** at the sidebar foot, and **sidebar panel folding** — the panel rows collapse into a single **Panels** entry that opens a two-column launcher.
6
+
7
+ Colours travel only through `ctx.theme.overrideTokens`, as a single layer of theme variables. No structural CSS is injected and no other plugin's DOM is read, so an upstream redesign can at worst make the colours inert — it cannot break the layout.
8
+
9
+ ## Install
10
+
11
+ Install `@moonsand/dsh-ui-optimize` from the GUI plugin manager. Requires `engines.dsh >= 0.2.1-rc.3`.
12
+
13
+ ## Use
14
+
15
+ Open **Settings → UI Optimize**.
16
+
17
+ ### Themes
18
+
19
+ Celadon, Linen, Cream, Graphite, Indigo, Slate, Sage, Rose. Picking a card recolours the whole interface; **Default** restores the stock look. Every theme defines one palette for light and one for dark — switching Appearance between them carries the theme along, so there is no separate version to pick.
20
+
21
+ ### Desktop actions
22
+
23
+ Two switches control the sidebar-foot buttons:
24
+
25
+ - **Reload UI** — reloads the page and client plugins only; the Host and running tasks keep going
26
+ - **Restart app** — restarts the whole app including its Host; interrupts the current conversation. **Desktop app only** — in a browser it degrades to reloading the page
27
+
28
+ ### Sidebar
29
+
30
+ A switch folds the panel rows in the left rail into a single **Panels** entry. Clicking it opens a two-column launcher with the panel icons, a title and count, a search box once there are more than seven panels, and keyboard control (↑ ↓ to move, Enter to open, Esc to close). Panels that register later — including ones added by other plugins — are picked up on the next open, so nothing silently disappears from the list.
31
+
32
+ The entry calls the shell's own panel-selection API instead of synthesising clicks. A watchdog measures the folded row after mount and on every resize: if it cannot be measured, the switch turns itself off and the native sidebar comes back rather than leaving an empty rail.
33
+
34
+ The **More** row keeps its own line. Folding it in was tried and dropped: the shell's overflow menu only opens from a trusted click, which a plugin cannot produce, and the synthetic pointer events that came close also closed the launcher through the shell's click-outside handler.
35
+
36
+ ## Relationship to dsh-desktop-restart
37
+
38
+ The desktop actions are ported from [`@moonsand/dsh-desktop-restart`](https://github.com/MoonSand/dsh-desktop-restart) and use their own route prefix, `/ui-optimize/desktop`.
39
+
40
+ Both plugins can be installed at the same time without crashing, but you would get two sets of buttons. When the old plugin is detected, a notice appears at the top of the settings page suggesting you uninstall it.
41
+
42
+ ## Known limitations
43
+
44
+ - The theme choice lives in browser `localStorage`; it is lost with the browser profile or site data
45
+ - Restart works only in the desktop app; a browser session can only reload
46
+ - Restart logs still go to `%TEMP%\dsh-desktop-restart.log`, inherited from the ported source
47
+ - The restart action is a process-level operation that cannot be verified automatically
48
+ - The **More** row is not folded; it stays in the native rail
49
+ - The launcher keeps the shell's own panel order — it does not sort, pin or reorder
50
+ - Sidebar folding and `dsh-sidebar-shelf` rewrite the same rail; enable one of them, not both
51
+
52
+ ## Development
53
+
54
+ ```
55
+ node scripts/smoke.mjs
56
+ ```
57
+
58
+ The smoke test covers the assembly contract only: the three runtime files parse, the theme table is complete (8 themes × 10 tokens × 2 schemes), and the published identity plus `engines.dsh` are intact. It does **not** check whether the palettes look right or whether restart actually restarts.
59
+
60
+ ## License
61
+
62
+ MIT
package/README.zh.md ADDED
@@ -0,0 +1,81 @@
1
+ # dsh-ui-optimize
2
+
3
+ [English](README.md) | 中文
4
+
5
+ 给 DeepSeek Harness 界面换主题、把「刷新界面 / 重启应用」收进同一个插件,并把侧栏的面板列表收成一个入口——三个功能各自独立开关。
6
+
7
+ - **主题画廊**:8 套极简主题,浅色与深色各定义一组配色,点一张卡片整套配色生效
8
+ - **桌面操作**:侧栏底部的刷新与重启按钮,可分别关掉
9
+ - **侧栏收纳**:面板行收成一个「面板」入口,点开是两列启动面板
10
+
11
+ 配色只通过 `ctx.theme.overrideTokens` 以**单层**覆盖主题变量,不注入任何结构性 CSS、不读写其他插件的 DOM,所以宿主改版最多让颜色不生效,不会把界面layout弄坏。
12
+
13
+ ## 安装
14
+
15
+ ```
16
+ dsh plugin 或 GUI 插件管理:安装 @moonsand/dsh-ui-optimize
17
+ ```
18
+
19
+ 要求 `engines.dsh >= 0.2.1-rc.3`。
20
+
21
+ ## 使用
22
+
23
+ 打开 **设置 → 界面优化**。
24
+
25
+ ### 主题
26
+
27
+ | 主题 | 风格 |
28
+ |---|---|
29
+ | 青瓷 | 冷调青绿,克制安静 |
30
+ | 亚麻 | 暖调棕褐,像未漂白的布 |
31
+ | 奶油 | 淡黄暖白,柔和护眼 |
32
+ | 石墨 | 近单色中性,冷静克制 |
33
+ | 靛蓝 | 近白画布配冷靛强调 |
34
+ | 雾蓝 | 蓝灰中性,现代后台的默认脸 |
35
+ | 苔绿 | 低饱和绿,比青瓷更松弛 |
36
+ | 玫瑰 | 灰调玫瑰,暖而不吵 |
37
+
38
+ 选「默认」恢复原生外观。每套主题为浅色与深色各定义一组配色,切换「外观」里的浅色/深色时自动跟随,不需要为两种模式各选一次。
39
+
40
+ ### 桌面操作
41
+
42
+ 两个开关分别控制侧栏底部的「刷新界面」和「重启应用」按钮:
43
+
44
+ - **刷新界面**:只重新加载页面与客户端插件,Host 与正在跑的任务不受影响
45
+ - **重启应用**:重启整个应用(含 Host),会中断当前对话;**仅桌面端可用**,网页端会降级为刷新页面
46
+
47
+ ### 侧栏
48
+
49
+ 一个开关把左侧竖栏里的面板行收成一个「面板」入口。点开是两列启动面板:图标、标题与数量、面板多于 7 个时出现搜索框,并支持键盘操作(↑ ↓ 移动、回车打开、Esc 关闭)。之后才注册的面板——包括其他插件加进来的——在下次打开时自动出现,不会漏。
50
+
51
+ 入口走宿主自己的面板选中接口,不伪造点击。挂载后与每次缩放时都有一个看门狗在量尺寸:量不到就把开关自动关掉、还原原生侧栏,而不是留一根空栏。
52
+
53
+ 「更多」保持独立一行。把它也收进去试过并放弃了:宿主的溢出菜单只认真实点击,插件造不出来;而伪造的指针事件又会被宿主的「点外部即关闭」吃掉,刚打开的弹层立刻被关掉。
54
+
55
+ ## 与 dsh-desktop-restart 的关系
56
+
57
+ 本插件的桌面操作移植自 [`@moonsand/dsh-desktop-restart`](https://github.com/MoonSand/dsh-desktop-restart),并已改用独立的路由前缀 `/ui-optimize/desktop`。
58
+
59
+ 两个插件**可以同时安装而不会崩溃**,但会出现两套刷新/重启按钮。检测到旧插件仍在运行时,设置页顶部会给出提示,建议卸载它。
60
+
61
+ ## 已知限制
62
+
63
+ - 主题选择保存在浏览器 `localStorage`,换机器或清站点数据会丢失
64
+ - 重启只适用于桌面端;网页端只能刷新
65
+ - 重启日志仍写在 `%TEMP%\dsh-desktop-restart.log`(沿用移植来源的路径)
66
+ - 重启动作为进程级操作,无法在自动化测试中验证,只能人工点一次确认
67
+ - 「更多」没有收进弹层,仍在原生竖栏里
68
+ - 弹层沿用宿主自己的面板顺序,不排序、不置顶、不重排
69
+ - 侧栏收纳与 `dsh-sidebar-shelf` 改的是同一根竖栏,两个只能开一个
70
+
71
+ ## 开发
72
+
73
+ ```
74
+ node scripts/smoke.mjs
75
+ ```
76
+
77
+ 冒烟只验证装配契约:三个运行时文件可解析、主题表结构完整(8 套 × 10 个变量 × 浅/深两组)、包身份与 `engines.dsh` 完好。**它不验证配色观感,也不验证重启是否真的重启。**
78
+
79
+ ## 许可
80
+
81
+ MIT