@nimoxie/dsh-ui-tweaks 0.1.1 → 0.1.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/DEVELOPING.md CHANGED
@@ -1,88 +1,90 @@
1
- # 开发笔记
2
-
3
- 面向改这个插件的人。用户文档在 [README.md](./README.md)。
4
-
5
- ## 骨架(与 dsh-model-organizer 同构)
6
-
7
- - `lib/index.js`:host 半区,空 `apply()`,只为让插件出现在 cordis loader / bundle 列表。
8
- - `lib/client.js`:浏览器半区,`module.exports = { name, apply, inject }`;`apply(ctx)` 由客户端 cordis 上下文调用。
9
- - `cordis.patch.yml`:`- insert: [{id: ui-tweaks, name: '@nimoxie/dsh-ui-tweaks'}]`。**profile 必须声明 `dsh.bundle.patch`,否则 dsh 启动即报 declares no dsh.bundle**;**insert.name 必须写全 scope**(loader 按它在 node_modules 解析包)。
10
- - `package.json`:`exports["./client"]` 指向 client bundle;`dsh.client.platform: "web"`;inject 只需 `@deepseek-ai/dsh-api-remotes`(`remote.*` 服务由它提供)。`react` / `react-dom` 等是 shell 内置(PLATFORM_MODULES),不用声明。
11
- - loader `id` 与 `exports.name` 只是内部标识,可以不跟包名走(换名也不用改);真正要同步四处的是 package.json、cordis.patch.yml、两个 profile 的依赖键 + `dsh.profile.bundles`、(桌面 profile 还有 lockfile 与 node_modules 软链路径)。
12
-
13
- ## 本地开发
14
-
15
- - **`file:` 是打包快照,`link:` 才是符号链接**:写 `file:` 时 pnpm 把目录复制进 store,改仓库不生效。
16
- - 安装/重装:
17
- ```sh
18
- dsh plugin --profile web remove @nimoxie/dsh-ui-tweaks
19
- dsh plugin --profile web add "link:<本仓库绝对路径>"
20
- ```
21
- - 改完 client.js 后页面要 **Ctrl+Shift+R**(bundle 以 `Cache-Control: immutable` 下发且 URL 不随代码变化,普通刷新一直吃缓存)。加载/卸载插件需要**重启 dsh web**。
22
- - **桌面 profile 由 Electron 独占管理**:npm 版 CLI 装/卸会被拒(对它的报错是 `managed exclusively by the Electron application`)。两条路:① 客户端插件管理页安装,spec 填 `link:<路径>`;② 应用完全退出后手动改四件套(package.json 依赖 + `dsh.profile.bundles`、pnpm-lock importers、node_modules 软链)。客户端会监听 package.json 变化、自动用自带 pnpm 建好软链。
23
-
24
- ## 已知坑
25
-
26
- - **`ctx.inject([...])` 只要有一个服务名不存在,回调永远不执行且不报错**。升级 dsh 后功能静默消失,第一件事去新版 `dsh-client-ui-*` 包里 grep 注入的每个服务名。本插件在 8 秒拿不到服务时会给出明确的错误行,不会无限等。
27
- - 每个模块的注册各套 `guard()`:失败记 `console.warn`,不拖垮同文件其它模块。
28
- - 官方 CSS-module 类名是「哈希_原名」结构,锚定一律用**属性前缀**(`[class*="tableScroll"]`、`[class*="widthHandle"]`、`[class*="composerSeat"]`),绝不硬编码 hash——官方 hash 版本间会变。
29
- - **0.2.0-rc.1 已把 0.1.x 的 `data-dsh-part` 标记全部移除**(滚动条/调宽条/输入框的选择器都因此改过一轮);`[data-slot="..."]` 是渲染器统一输出的,锚插槽容器用它。
30
- - 浮层挂在 Shadow DOM 里时 `position: fixed` 会被困在深层的堆叠上下文,z-index 再高也没用——面板浮层挂在 body 的 shadow root 上规避。
31
-
32
- ## 更新检查(模块 3)
33
-
34
- ### 关键经验:注解必须回读,而且 pnpm 的 minimumReleaseAge 是主要的静止源
35
-
36
- - **更新用 `name@latest` 的教训**:pnpm 11 的 `minimumReleaseAge`(profile 的 `pnpm-workspace.yaml`,本机 1440min=24h)会**静默**跳过发布不足 24h 的新版本——区级安装请求会成功、但它解析到「最新合法版本」而**不是**时候刚发布的版本,装上后版本没变,面板才改判「暂缓」。这不是失败,是 pnpm 的窗口保护,不报错。
37
- - **绕法(已实测)**:把 spec 写成 **`name@精确版本号`**(`dsh-context@0.61.0` 而不是 `dsh-context@latest`),pnpm 会把该版本自动写入 workspace 的 `minimumReleaseAgeExclude`(实测输出 `Added 1 entry to minimumReleaseAgeExclude in pnpm-workspace.yaml`)并照常安装。所以本插件的 `startOne` 现在用面板解析出的 `latest` 拼 spec(`name + "@" + row.latest`),而不是 `name + "@latest"`。
38
- - `finishOne` 的「版本没变 → 暂缓更新」判据仍然保留作为兜底(防 registry 解析与 pnpm 最终解析不一致),只是正常情况下它不会再被触发。
39
- - 参考实现:社区分叉版 `@linxin666/dsh-client-ui-plugin-manager` 的 update handler 也是先 `fetchManifest` 拿 registry 的 `version`,再 `installBundle(name@version)`——即它「能更新」不是因为绕过了 pnpm,而是因为用的是精确版本。
40
-
41
- ### 本地包识别 = host 路由为主,404 签名兜底
42
-
43
- - `listBundles()` 不透传安装来源(`installed` 不是 spec 字符串),而发布到 npm 的本地包(如 `@nimoxie/dsh-model-organizer`)连 registry 404 签名都不命中 —— 所以 host 半区挂了 `GET /api/ui-tweaks/local-plugins`(读 profile `package.json` 的 dependencies,按 source 分两类回给面板:**local** = `link:`/`file:` 本地路径,标「本地链接」;**remote** = `git:`/`github:`/`http` 直装,标「Git 直装」;仅回环放行)。两者都**不参与 registry 比对**——即使 npm 上有同名包(如 `dsh-ego-browser` 有 `github:` 声明、registry 也存在 0.8.6),装的也是仓库源码、与 npm 版不是一回事。client 每轮检查先取这份名单,取不到(host 半区未重启)再退回 404 签名(404 时也按 `installed` 来源区分 local/remote)。**改 host 半区必须重启 dsh/客户端才生效**(client bundle 刷新即可)。
44
- profile 目录定位:先从 `import.meta.url` 向上找带 `dsh.profile.bundles` 且包含自身的 package.json(npm 直装必命中);软链安装时模块被解析到 profile 外的真实目录,退回 `DSH_HOME/profiles/*` 扫描,多 profile 命中时按 `ELECTRON_RUN_AS_NODE` 区分 desktop/web。
45
-
46
- ### 其它要点
47
-
48
- - **更新主路径全部走官方 remote API**(host 半区只挂一条本地包识别路由):`pluginManager.listBundles()`(清单+版本)、`installBundle("<名>@版本", { enabled: true, requestId })`(更新)、`waitForInstall(requestId)`(进度)、`cancelInstall(requestId)`(取消)。`installBundle` 的第二参官方还传了 `registry`(来自 `pluginManager.registries()`),本插件省略——若某天报 registry 缺失,先补它。
49
- - **registry 比对在浏览器直连**:`registry.npmjs.org` 带 CORS *(实测),逐包**串行** fetch `/latest`,不打并发。
50
- - **装完必须回读实际版本**:回读**只用 `pluginManager.listBundles()`**——`pluginInventory` 只有 `list()` 没有 `listBundles`,先取它掉进「回读版本失败」假阳性(踩过);装完瞬间清单可能短暂不可用,重试 3 次(1.5s 间隔)再下结论。重试后仍读不到就直接 mark「已发起·未确认」(可点重查)。
51
- - **更新严格串行**:pnpm 对 profile 的 package.json 有文件锁,并发发起不会真并行、只会排队。队列顶项标「等待更新」,正在装的标「更新中 …」,两者都可点取消。
52
- - `waitForInstall` 的返回形态官方页面之外没有文档,本插件对 `phase/state/status/ok` 多形状都认、240 秒兜底超时;真实跑通后按实际返回收紧。
53
-
54
- ## 动画修复(模块 4)
55
-
56
- - **原理**:Windows「动画效果」关闭 → Chromium 报 `prefers-reduced-motion: reduce`,dsh 的 40 处(17 包)`@media (prefers-reduced-motion: reduce)` 规则关掉动画。页面内**删不掉媒体查询的求值**,但删得掉规则本身:dsh 的 CSS 全部经 `<style>` 标签注入(实测 0 处 adoptedStyleSheets),同源 sheet 的 `cssRules` 可遍历可 `deleteRule`——把 reduce 的整条递归删除,基础动画声明(非媒体内)立即生效。效果与 dsh-web-shell 的 CDP `Emulation.setEmulatedMedia` 等价,但**不需要调试端口,桌面端也能用**。
57
- - **JS 门控**:chat 包 3 处 `matchMedia("(prefers-reduced-motion: reduce)")`(滚动平滑 vs 跳转)用 `window.matchMedia` 包装覆盖——在返回的 MediaQueryList 上 `defineProperty("matches")` 影子化,按 no-preference 应答。包装必须在应用渲染前(apply 在合成期,早于 mount)。
58
- - **晚到样式**:分包懒加载/换肤重写会在加载后重建样式,靠 `MutationObserver(head)` 防抖重扫 + 2s 轮询兜底(纯 CSSOM 枚举,无布局开销)。
59
- - **取舍**:与 dsh-web-shell 的 `forceAnimations` 相同——覆盖系统无障碍设置。窗口级覆盖(启动器)换成会话级覆盖(插件),想恢复系统行为就得停用本插件;将来要做成可开关就着 dsh-model-organizer 的设置卡方案。
60
- - web 窗口里本模块与 dsh-web-shell 的 CDP 覆盖并存是**无害冗余**(都指向 no-preference)。
61
-
62
- ## 从 dsh-web-shell 迁移的功能
63
-
64
- 对话区左侧滚动条与宽表格修复原是 dsh-web-shell 的 CDP 注入脚本,已整体迁入本插件(client bundle 自由 JS),dsh-web-shell 自身删除了对应代码与 `leftScrollbar` / `tableWidthFix` 配置。此处不重复实现细节(`lib/client.js` 各模块注释里保留:宿主挂 body 的理由、composerSeat 裁剪 −4px、拖动三层防御、零位移 wheel 事件解阅读锚点、出血布局三件套),只记两条迁移后才知道的知识:
65
-
66
- - **「检查更新」按安装来源分流**:dsh-web-shell 时代来源由 PowerShell 读 profile 依赖判定;迁入插件后走 host 路由(见「更新检查」)。
67
- - **判断 dsh 是否已修宽表格**(决定何时删掉模块 1):打开含 ≥4 列表格的会话,控制台执行 `getComputedStyle(document.querySelector('[class*="tableScroll"]')).maxWidth`——若不再是 `100%`(或包裹层不再越界)说明官方已修,删除 `installTableWidthFix` 的 guard 行即完全回滚。
68
-
69
- ## 待办 / 路线
70
-
71
- - [ ] 入口按钮支持 `sidebar.footer.action` 常驻入口(社区同款用此座位),当前只在插件管理页顶栏。
72
- - [ ] 有更新时按钮加角标(现在要点开面板才看得到)。
73
- - [ ] i18n(`ctx.locale.register(NS, {zh, en})`,照 dsh-model-organizer 写法)。
74
- - [ ] 会话内重启 dsh 的入口(需要 host 配合或官方重启 API,未调研)。
75
- - [ ] `waitForInstall` 终态按实测收紧;`installBundle` 的 `registry` 参数补齐。
76
- - [ ] 插件被禁用/卸载时的运行时清理(目前 DOM 残留到页面刷新为止)。
77
-
78
- ## 发布
79
-
80
- - npm 不允许覆盖已发布的版本号:**先升版本,再提交,最后发布**。
81
- - 版本号同时在 `package.json` 和 `lib/client.js` 的 `BUILD` 常量里(改两处)。发版命令:
82
- ```sh
83
- npm version patch # 或手改 package.json 的 version;记得同步 BUILD
84
- git add -A && git commit -m "..." && git push
85
- npm publish
86
- ```
87
- - **Token**:npm 2025-11 起只支持 granular token,发布需要有 **Bypass 2FA** 的权限:npmjs.com → 头像 → Access Tokens → Generate New Token → Packages 选 **All Packages + Read and Write (publish and stage)**、Organizations 选 **No access**、勾 **Bypass two-factor authentication**;然后 `npm config set //registry.npmjs.org/:_authToken=npm_xxx`(写进用户级 `.npmrc`,不要放进仓库——`.gitignore` 已排除 `.npmrc` 与 `*.tgz`)。
88
- - 包是 scoped(`@nimoxie/dsh-ui-tweaks`),`publishConfig.access: "public"` 已写在 package.json,`npm publish` 不需要额外参数。
1
+ # 开发笔记
2
+
3
+ 面向改这个插件的人。用户文档在 [README.md](./README.md)。
4
+
5
+ ## 骨架(与 dsh-model-organizer 同构)
6
+
7
+ - `lib/index.js`:host 半区,空 `apply()`,只为让插件出现在 cordis loader / bundle 列表。
8
+ - `lib/client.js`:浏览器半区,`module.exports = { name, apply, inject }`;`apply(ctx)` 由客户端 cordis 上下文调用。
9
+ - `cordis.patch.yml`:`- insert: [{id: ui-tweaks, name: '@nimoxie/dsh-ui-tweaks'}]`。**profile 必须声明 `dsh.bundle.patch`,否则 dsh 启动即报 declares no dsh.bundle**;**insert.name 必须写全 scope**(loader 按它在 node_modules 解析包)。
10
+ - `package.json`:`exports["./client"]` 指向 client bundle;`dsh.client.platform: "web"`;inject 只需 `@deepseek-ai/dsh-api-remotes`(`remote.*` 服务由它提供)。`react` / `react-dom` 等是 shell 内置(PLATFORM_MODULES),不用声明。
11
+ - loader `id` 与 `exports.name` 只是内部标识,可以不跟包名走(换名也不用改);真正要同步四处的是 package.json、cordis.patch.yml、两个 profile 的依赖键 + `dsh.profile.bundles`、(桌面 profile 还有 lockfile 与 node_modules 软链路径)。
12
+
13
+ ## 本地开发
14
+
15
+ - **`file:` 是打包快照,`link:` 才是符号链接**:写 `file:` 时 pnpm 把目录复制进 store,改仓库不生效。
16
+ - 安装/重装:
17
+ ```sh
18
+ dsh plugin --profile web remove @nimoxie/dsh-ui-tweaks
19
+ dsh plugin --profile web add "link:<本仓库绝对路径>"
20
+ ```
21
+ - 改完 client.js 后页面要 **Ctrl+Shift+R**(bundle 以 `Cache-Control: immutable` 下发且 URL 不随代码变化,普通刷新一直吃缓存)。加载/卸载插件需要**重启 dsh web**。
22
+ - **桌面 profile 由 Electron 独占管理**:npm 版 CLI 装/卸会被拒(对它的报错是 `managed exclusively by the Electron application`)。两条路:① 客户端插件管理页安装,spec 填 `link:<路径>`;② 应用完全退出后手动改四件套(package.json 依赖 + `dsh.profile.bundles`、pnpm-lock importers、node_modules 软链)。客户端会监听 package.json 变化、自动用自带 pnpm 建好软链。
23
+
24
+ ## 已知坑
25
+
26
+ - **`ctx.inject([...])` 只要有一个服务名不存在,回调永远不执行且不报错**。升级 dsh 后功能静默消失,第一件事去新版 `dsh-client-ui-*` 包里 grep 注入的每个服务名。本插件在 8 秒拿不到服务时会给出明确的错误行,不会无限等。
27
+ - 每个模块的注册各套 `guard()`:失败记 `console.warn`,不拖垮同文件其它模块。
28
+ - 官方 CSS-module 类名是「哈希_原名」结构,锚定一律用**属性前缀**(`[class*="tableScroll"]`、`[class*="widthHandle"]`、`[class*="composerSeat"]`),绝不硬编码 hash——官方 hash 版本间会变。
29
+ - **0.2.0-rc.1 已把 0.1.x 的 `data-dsh-part` 标记全部移除**(滚动条/调宽条/输入框的选择器都因此改过一轮);`[data-slot="..."]` 是渲染器统一输出的,锚插槽容器用它。
30
+ - 浮层挂在 Shadow DOM 里时 `position: fixed` 会被困在深层的堆叠上下文,z-index 再高也没用——面板浮层挂在 body 的 shadow root 上规避。
31
+
32
+ ## 更新检查(模块 3)
33
+
34
+ ### 关键经验:注解必须回读,而且 pnpm 的 minimumReleaseAge 是主要的静止源
35
+
36
+ - **更新用 `name@latest` 的教训**:pnpm 11 的 `minimumReleaseAge`(profile 的 `pnpm-workspace.yaml`,本机 1440min=24h)会**静默**跳过发布不足 24h 的新版本——区级安装请求会成功、但它解析到「最新合法版本」而**不是**时候刚发布的版本,装上后版本没变,面板才改判「暂缓」。这不是失败,是 pnpm 的窗口保护,不报错。
37
+ - **绕法(已实测)**:把 spec 写成 **`name@精确版本号`**(`dsh-context@0.61.0` 而不是 `dsh-context@latest`),pnpm 会把该版本自动写入 workspace 的 `minimumReleaseAgeExclude`(实测输出 `Added 1 entry to minimumReleaseAgeExclude in pnpm-workspace.yaml`)并照常安装。所以本插件的 `startOne` 现在用面板解析出的 `latest` 拼 spec(`name + "@" + row.latest`),而不是 `name + "@latest"`。
38
+ - `finishOne` 的「版本没变 → 暂缓更新」判据仍然保留作为兜底(防 registry 解析与 pnpm 最终解析不一致),只是正常情况下它不会再被触发。
39
+ - 参考实现:社区分叉版 `@linxin666/dsh-client-ui-plugin-manager` 的 update handler 也是先 `fetchManifest` 拿 registry 的 `version`,再 `installBundle(name@version)`——即它「能更新」不是因为绕过了 pnpm,而是因为用的是精确版本。
40
+
41
+ ### 本地包识别 = host 路由为主,404 签名兜底
42
+
43
+ - `listBundles()` 不透传安装来源(`installed` 不是 spec 字符串),而发布到 npm 的本地包(如 `@nimoxie/dsh-model-organizer`)连 registry 404 签名都不命中 —— 所以 host 半区挂了 `GET /api/ui-tweaks/local-plugins`(读 profile `package.json` 的 dependencies,按 source 分两类回给面板:**local** = `link:`/`file:` 本地路径,标「本地链接」;**remote** = `git:`/`github:`/`http` 直装,标「Git 直装」;仅回环放行)。两者都**不参与 registry 比对**——即使 npm 上有同名包(如 `dsh-ego-browser` 有 `github:` 声明、registry 也存在 0.8.6),装的也是仓库源码、与 npm 版不是一回事。client 每轮检查先取这份名单,取不到(host 半区未重启)再退回 404 签名(404 时也按 `installed` 来源区分 local/remote)。**改 host 半区必须重启 dsh/客户端才生效**(client bundle 刷新即可)。
44
+ profile 目录定位:先从 `import.meta.url` 向上找带 `dsh.profile.bundles` 且包含自身的 package.json(npm 直装必命中);软链安装时模块被解析到 profile 外的真实目录,退回 `DSH_HOME/profiles/*` 扫描,多 profile 命中时按 `ELECTRON_RUN_AS_NODE` 区分 desktop/web。
45
+
46
+ ### 其它要点
47
+
48
+ - **更新主路径全部走官方 remote API**(host 半区只挂一条本地包识别路由):`pluginManager.listBundles()`(清单+版本)、`installBundle("<名>@版本", { enabled: true, requestId })`(更新)、`waitForInstall(requestId)`(进度)、`cancelInstall(requestId)`(取消)。`installBundle` 的第二参官方还传了 `registry`(来自 `pluginManager.registries()`),本插件省略——若某天报 registry 缺失,先补它。
49
+ - **registry 比对在浏览器直连**:`registry.npmjs.org` 带 CORS *(实测),逐包**串行** fetch `/latest`,不打并发。
50
+ - **装完必须回读实际版本**:回读**只用 `pluginManager.listBundles()`**——`pluginInventory` 只有 `list()` 没有 `listBundles`,先取它掉进「回读版本失败」假阳性(踩过);装完瞬间清单可能短暂不可用,重试 3 次(1.5s 间隔)再下结论。重试后仍读不到就直接 mark「已发起·未确认」(可点重查)。
51
+ - **更新严格串行**:pnpm 对 profile 的 package.json 有文件锁,并发发起不会真并行、只会排队。队列顶项标「等待更新」,正在装的标「更新中 …」,两者都可点取消。
52
+ - **总看门狗(0.1.3)**:`startOne` 入口起 240s 定时器,`finish` 里 `clearTimeout`——覆盖 fetchLatest(现场查 registry,fetch 本身无超时)与 specPromise(原先无 catch)这两段不设防的异步;超时先 `finish(false, "更新超时…")` 再 `cancelInstall(busyReq)`。
53
+ - **`waitForInstall` 的返回形态已实测收紧(0.1.3,从 app.asar 的 zod schema 解出)**:终态读 `application`(`applied` / `restart-required` / `failed` / `cancelled` / `overridden`),进行中读 `stage`(`remove` / `install` / `enable`,行内 why 显示「阶段:…」),失败定位读 `failedAt`(`registry` / `spec-host`)。原先按 `phase/state/status/ok` 猜的形状全都不存在——那正是更新中无限挂起的原因:终态永远匹配不上,且更早的 fetchLatest/specPromise 两段异步在 240s 兜底之前就不设防。
54
+
55
+ ## 动画修复(模块 4)
56
+
57
+ - **原理**:Windows「动画效果」关闭 → Chromium 报 `prefers-reduced-motion: reduce`,dsh 的 40 处(17 包)`@media (prefers-reduced-motion: reduce)` 规则关掉动画。页面内**删不掉媒体查询的求值**,但删得掉规则本身:dsh 的 CSS 全部经 `<style>` 标签注入(实测 0 处 adoptedStyleSheets),同源 sheet 的 `cssRules` 可遍历可 `deleteRule`——把 reduce 的整条递归删除,基础动画声明(非媒体内)立即生效。效果与 dsh-web-shell 的 CDP `Emulation.setEmulatedMedia` 等价,但**不需要调试端口,桌面端也能用**。
58
+ - **JS 门控**:chat 包 3 处 `matchMedia("(prefers-reduced-motion: reduce)")`(滚动平滑 vs 跳转)用 `window.matchMedia` 包装覆盖——在返回的 MediaQueryList 上 `defineProperty("matches")` 影子化,按 no-preference 应答。包装必须在应用渲染前(apply 在合成期,早于 mount)。
59
+ - **晚到样式**:分包懒加载/换肤重写会在加载后重建样式,靠 `MutationObserver(head)` 防抖重扫 + 2s 轮询兜底(纯 CSSOM 枚举,无布局开销)。
60
+ - **取舍**:与 dsh-web-shell 的 `forceAnimations` 相同——覆盖系统无障碍设置。窗口级覆盖(启动器)换成会话级覆盖(插件),想恢复系统行为就得停用本插件;将来要做成可开关就着 dsh-model-organizer 的设置卡方案。
61
+ - web 窗口里本模块与 dsh-web-shell 的 CDP 覆盖并存是**无害冗余**(都指向 no-preference)。
62
+
63
+ ## 从 dsh-web-shell 迁移的功能
64
+
65
+ 对话区左侧滚动条与宽表格修复原是 dsh-web-shell 的 CDP 注入脚本,已整体迁入本插件(client bundle 自由 JS),dsh-web-shell 自身删除了对应代码与 `leftScrollbar` / `tableWidthFix` 配置。此处不重复实现细节(`lib/client.js` 各模块注释里保留:宿主挂 body 的理由、composerSeat 裁剪 −4px、拖动三层防御、零位移 wheel 事件解阅读锚点、出血布局三件套),只记两条迁移后才知道的知识:
66
+
67
+ - **「检查更新」按安装来源分流**:dsh-web-shell 时代来源由 PowerShell 读 profile 依赖判定;迁入插件后走 host 路由(见「更新检查」)。
68
+ - **判断 dsh 是否已修宽表格**(决定何时删掉模块 1):打开含 ≥4 列表格的会话,控制台执行 `getComputedStyle(document.querySelector('[class*="tableScroll"]')).maxWidth`——若不再是 `100%`(或包裹层不再越界)说明官方已修,删除 `installTableWidthFix` 的 guard 行即完全回滚。
69
+
70
+ ## 待办 / 路线
71
+
72
+ - [ ] 入口按钮支持 `sidebar.footer.action` 常驻入口(社区同款用此座位),当前只在插件管理页顶栏。
73
+ - [ ] 有更新时按钮加角标(现在要点开面板才看得到)。
74
+ - [ ] i18n(`ctx.locale.register(NS, {zh, en})`,照 dsh-model-organizer 写法)。
75
+ - [ ] 会话内重启 dsh 的入口(需要 host 配合或官方重启 API,未调研)。
76
+ - [x] 0.1.3:`waitForInstall` 终态已按实测收紧(application/stage/failedAt)+ 全程总看门狗。
77
+ - [ ] `installBundle` 的 `registry` 参数补齐(官方传了,本插件省略)。
78
+ - [ ] 插件被禁用/卸载时的运行时清理(目前 DOM 残留到页面刷新为止)。
79
+
80
+ ## 发布
81
+
82
+ - npm 不允许覆盖已发布的版本号:**先升版本,再提交,最后发布**。
83
+ - 版本号同时在 `package.json` 和 `lib/client.js` 的 `BUILD` 常量里(改两处)。发版命令:
84
+ ```sh
85
+ npm version patch # 或手改 package.json 的 version;记得同步 BUILD
86
+ git add -A && git commit -m "..." && git push
87
+ npm publish
88
+ ```
89
+ - **Token**:npm 2025-11 起只支持 granular token,发布需要有 **Bypass 2FA** 的权限:npmjs.com → 头像 → Access Tokens → Generate New Token → Packages 选 **All Packages + Read and Write (publish and stage)**、Organizations 选 **No access**、勾 **Bypass two-factor authentication**;然后 `npm config set //registry.npmjs.org/:_authToken=npm_xxx`(写进用户级 `.npmrc`,不要放进仓库——`.gitignore` 已排除 `.npmrc` 与 `*.tgz`)。
90
+ - 包是 scoped(`@nimoxie/dsh-ui-tweaks`),`publishConfig.access: "public"` 已写在 package.json,`npm publish` 不需要额外参数。
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 NimoXie
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 NimoXie
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,68 +1,68 @@
1
- # dsh-ui-tweaks
2
-
3
- 给 DSH(DeepSeek Harness)的 Web UI 的一批界面微调:装上即生效,无需配置。
4
-
5
- ## 它解决什么问题
6
-
7
- 官方界面上有几处用得难受的地方:宽表格会撑出对话区右沿、滚动条贴在屏幕最右端要横跨半屏去够、Windows 关闭「动画效果」时前端动画被系统设置一并关掉、插件版本更新只能去插件管理页挨个看。这个插件把它们一次性修掉。
8
-
9
- ## 功能
10
-
11
- **宽表格越界修复**
12
- - 宽表格(≥4 列)不再撑出对话区,收敛回正文列并支持横向滚动,观察沿裁掉的问题消失
13
-
14
- **对话区左侧滚动条**
15
- - 在右侧宽度调整条的左边放一条自绘滚动条:拖拽、点轨道翻页、滚轮转动手感与原生一致,主题跟随明暗
16
- - **只在会话页出现**,切到插件页等非会话页自动移除
17
-
18
- **动画修复**
19
- - Windows 关闭「动画效果」时 Chromium 会向网页报告 `prefers-reduced-motion: reduce`,本插件清除前端几十处因此失效的动画规则,让动画恢复
20
- - web 与桌面客户端都生效
21
-
22
- **插件更新检查**
23
- - 插件管理页顶部多一枚「检查更新」按钮(刷新按钮左侧,样式与「添加插件」按钮一致):比对已装插件(官方 `@deepseek-ai` 插件除外)与 npm registry 的版本,有新版本可点上就地更新,支持全部更新与中途取消
24
- - 不检查 dsh 本体,也不检查 `@deepseek-ai` 官方插件——两者的更新都由 dsh 本体的更新流程负责(桌面端自带更新器;web 端本体升级走 `npm install -g @deepseek-ai/dsh@next`)
25
-
26
- ## 安装
27
-
28
- dsh 目前有浏览器版与桌面客户端两种形态,命令里的 `<profile>` 就是安装目标环境:浏览器用 `web`,桌面客户端用 `desktop`。
29
-
30
- ```sh
31
- dsh plugin --profile <profile> add @nimoxie/dsh-ui-tweaks
32
- ```
33
-
34
- - 浏览器版(`web`):装完重启服务(关掉再 `dsh web`)。
35
- - 桌面客户端(`desktop`):桌面 profile 由客户端独占管理,请在客户端的「插件管理」页添加本包(包名 `@nimoxie/dsh-ui-tweaks`)。
36
-
37
- 卸载(CLI 可管理的环境):
38
-
39
- ```sh
40
- dsh plugin --profile <profile> remove @nimoxie/dsh-ui-tweaks
41
- ```
42
-
43
- 别人也可以从 GitHub 或本地目录装(开发用):
44
-
45
- ```sh
46
- dsh plugin --profile <profile> add github:NimoXie15/dsh-ui-tweaks
47
- dsh plugin --profile <profile> add link:/absolute/path/to/dsh-ui-tweaks
48
- ```
49
-
50
- > **要求**:dsh `>= 0.2.0-rc.1`(需要 `remote.pluginManager` / `remote.pluginInventory` 接口)。
51
- >
52
- > 升级插件后如果界面没变化,按 **Ctrl+Shift+R** 强刷一次(浏览器可能还在用缓存的旧版本)。
53
-
54
- ## 已知限制
55
-
56
- - 非 npm 来源的插件没有可比的 registry 版本,直接跳过比对:`link:` / `file:` 本地路径标「本地链接」;`git:` / `github:` / `http` 直装标「Git 直装」(例如 `github:Fisfzy/dsh-ego-browser` 会显示为 Git 直装,即使 npm 上有同名包,装的也是仓库源码、与 npm 版本不是一回事)
57
- - `@deepseek-ai` 官方插件直接从检查列表里剔除:它们的更新由 dsh 本体流程负责
58
- - 更新走 profile 内的插件安装接口,与官方插件管理页同源;安装按 registry 解析出的**精确版本号**发起(而非 `@latest`),不受 pnpm 发布时长策略(minimumReleaseAge)拦挡,刚发布的版本也能装
59
- - 个别插件(如社区插件管理页扩展)自带单独的「检查更新」入口,与本插件的检查互不关联,结果可能不同
60
- - 与启动器 dsh-web-shell 的分工:对话区滚动条、宽表格修复等界面增强已由本插件接管,dsh-web-shell 自身不再注入;其「检查更新」按钮仍负责 **dsh 本体**的比对与升级提示
61
-
62
- ## 许可
63
-
64
- MIT
65
-
66
- ---
67
-
1
+ # dsh-ui-tweaks
2
+
3
+ 给 DSH(DeepSeek Harness)的 Web UI 的一批界面微调:装上即生效,无需配置。
4
+
5
+ ## 它解决什么问题
6
+
7
+ 官方界面上有几处用得难受的地方:宽表格会撑出对话区右沿、滚动条贴在屏幕最右端要横跨半屏去够、Windows 关闭「动画效果」时前端动画被系统设置一并关掉、插件版本更新只能去插件管理页挨个看。这个插件把它们一次性修掉。
8
+
9
+ ## 功能
10
+
11
+ **宽表格越界修复**
12
+ - 宽表格(≥4 列)不再撑出对话区,收敛回正文列并支持横向滚动,观察沿裁掉的问题消失
13
+
14
+ **对话区左侧滚动条**
15
+ - 在右侧宽度调整条的左边放一条自绘滚动条:拖拽、点轨道翻页、滚轮转动手感与原生一致,主题跟随明暗
16
+ - **只在会话页出现**,切到插件页等非会话页自动移除
17
+
18
+ **动画修复**
19
+ - Windows 关闭「动画效果」时 Chromium 会向网页报告 `prefers-reduced-motion: reduce`,本插件清除前端几十处因此失效的动画规则,让动画恢复
20
+ - web 与桌面客户端都生效
21
+
22
+ **插件更新检查**
23
+ - 插件管理页顶部多一枚「检查更新」按钮(刷新按钮左侧,样式与「添加插件」按钮一致):比对已装插件(官方 `@deepseek-ai` 插件除外)与 npm registry 的版本,有新版本可点上就地更新,支持全部更新与中途取消
24
+ - 不检查 dsh 本体,也不检查 `@deepseek-ai` 官方插件——两者的更新都由 dsh 本体的更新流程负责(桌面端自带更新器;web 端本体升级走 `npm install -g @deepseek-ai/dsh@next`)
25
+
26
+ ## 安装
27
+
28
+ dsh 目前有浏览器版与桌面客户端两种形态,命令里的 `<profile>` 就是安装目标环境:浏览器用 `web`,桌面客户端用 `desktop`。
29
+
30
+ ```sh
31
+ dsh plugin --profile <profile> add @nimoxie/dsh-ui-tweaks
32
+ ```
33
+
34
+ - 浏览器版(`web`):装完重启服务(关掉再 `dsh web`)。
35
+ - 桌面客户端(`desktop`):桌面 profile 由客户端独占管理,请在客户端的「插件管理」页添加本包(包名 `@nimoxie/dsh-ui-tweaks`)。
36
+
37
+ 卸载(CLI 可管理的环境):
38
+
39
+ ```sh
40
+ dsh plugin --profile <profile> remove @nimoxie/dsh-ui-tweaks
41
+ ```
42
+
43
+ 别人也可以从 GitHub 或本地目录装(开发用):
44
+
45
+ ```sh
46
+ dsh plugin --profile <profile> add github:NimoXie15/dsh-ui-tweaks
47
+ dsh plugin --profile <profile> add link:/absolute/path/to/dsh-ui-tweaks
48
+ ```
49
+
50
+ > **要求**:dsh `>= 0.2.0-rc.1`(需要 `remote.pluginManager` / `remote.pluginInventory` 接口)。
51
+ >
52
+ > 升级插件后如果界面没变化,按 **Ctrl+Shift+R** 强刷一次(浏览器可能还在用缓存的旧版本)。
53
+
54
+ ## 已知限制
55
+
56
+ - 非 npm 来源的插件没有可比的 registry 版本,直接跳过比对:`link:` / `file:` 本地路径标「本地链接」;`git:` / `github:` / `http` 直装标「Git 直装」(例如 `github:Fisfzy/dsh-ego-browser` 会显示为 Git 直装,即使 npm 上有同名包,装的也是仓库源码、与 npm 版本不是一回事)
57
+ - `@deepseek-ai` 官方插件直接从检查列表里剔除:它们的更新由 dsh 本体流程负责
58
+ - 更新走 profile 内的插件安装接口,与官方插件管理页同源;安装按 registry 解析出的**精确版本号**发起(而非 `@latest`),不受 pnpm 发布时长策略(minimumReleaseAge)拦挡,刚发布的版本也能装
59
+ - 个别插件(如社区插件管理页扩展)自带单独的「检查更新」入口,与本插件的检查互不关联,结果可能不同
60
+ - 与启动器 dsh-web-shell 的分工:对话区滚动条、宽表格修复等界面增强已由本插件接管,dsh-web-shell 自身不再注入;其「检查更新」按钮仍负责 **dsh 本体**的比对与升级提示
61
+
62
+ ## 许可
63
+
64
+ MIT
65
+
66
+ ---
67
+
68
68
  想自己改这个插件、或者想了解它在内部怎么实现的,见 [DEVELOPING.md](./DEVELOPING.md)。
package/cordis.patch.yml CHANGED
@@ -1,7 +1,7 @@
1
- # dsh-ui-tweaks bundle patch: one host row over the web profile.
2
- # The row name resolves from the profile's own node_modules where
3
- # `dsh plugin --profile web add <path>` installed this package.
4
- # Scoped 包名的 name 必须写全(同 @linxin666 系插件),loader 按它解析 node_modules。
5
- - insert:
6
- - id: ui-tweaks
7
- name: '@nimoxie/dsh-ui-tweaks'
1
+ # dsh-ui-tweaks bundle patch: one host row over the web profile.
2
+ # The row name resolves from the profile's own node_modules where
3
+ # `dsh plugin --profile web add <path>` installed this package.
4
+ # Scoped 包名的 name 必须写全(同 @linxin666 系插件),loader 按它解析 node_modules。
5
+ - insert:
6
+ - id: ui-tweaks
7
+ name: '@nimoxie/dsh-ui-tweaks'