dsh-codinput 0.3.8 → 0.3.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 CHANGED
@@ -2,6 +2,25 @@
2
2
 
3
3
  本项目遵循 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/) 与 [语义化版本](https://semver.org/lang/zh-CN/)。
4
4
 
5
+ ## [0.3.9] — 2026-11-06
6
+
7
+ 修复 dsh `0.2.2-rc.1` 上模型 / 权限 / 设置下拉的整体错位、布局变化不跟随与开合失效:菜单改为 portal 到 `document.body`,锚点改按元素实时读取。
8
+
9
+ ### 修复
10
+
11
+ - **菜单包含块被劫持,整体错位**(`MenuSurface`):`.dci-menu` 虽为 `position: fixed`,但祖先链上的 `transform` / `filter` / `backdrop-filter` / `contain` 会把包含块从视口换成该祖先,`left/top` 按错误坐标系解释(实测可偏出 400px+)。现改为 `createPortal(document.body)`,与官方 ModelSelect 菜单、数据行详情面板同路数。
12
+ - **锚点是矩形快照,布局变化不跟随**(`MenuSurface`):原实现保存 `getBoundingClientRect()` 快照,`scroll` / `resize` 重算读同一份快照、结果恒等被丢弃。现改为按元素实时读取;打开期间逐帧比对锚点位置(1px 阈值)兜住不产生 scroll/resize 的布局重排;锚点未布局或菜单零尺寸时不落位。
13
+ - **点触发器开合失效**(`MenuSurface` / `ModelMenu`):全局 `pointerdown` 捕获监听把落在触发器上的点击也当作外部点击先关闭,触发器 `onClick` 随后读到 `open=false` 又开回来(点一次收不起来)。现外部点击判定跳过锚点、开合交给触发器 toggle;`ModelMenu` 移除自管点外关闭。模型 / 权限 / 设置三处调用方同步改为传元素 + 打开瞬间矩形。
14
+
15
+ ### 说明
16
+
17
+ - 发布材料:`npm run typecheck` 通过;两次发布构建字节一致(`lib/client.js` sha256 `4ef5a5917614b811b7345adbc5166e649014718dbb63929ee3654e8b2656460c`,与入库产物一致)。
18
+ - 兼容验证:隔离 web 宿主 `@deepseek-ai/dsh@0.2.2-rc.1`(临时 prefix + 独立 `DSH_HOME` + 无头 Edge 自动化探针,`link:` 安装本仓库构建产物)33/33 断言通过——菜单为 `body` 直接子节点 / `position: fixed`;模型菜单 top = 触发器 top − 8 − 菜单高(逐像素 0 误差、右对齐);祖先 `transform: translateY(150px)` 下仍 0 误差;布局位移 120px 后 2 帧内回贴;连点两次 开→收;点外部关闭、点菜单内不关;设置下拉 top = 触发器 bottom + 4(0 误差)且不被设置容器裁剪;窗口 1440×900→1100×760 后重算跟随。全程 console error / pageerror 为 0、`__dshCodinputErrs` 为空。
19
+ - 未覆盖:模型子页长列表滚动(隔离宿主无凭据、目录为空)、视口 12px 夹取分支、真实模型/权限切换提交。
20
+ - 0.3.8 既有功能与行为不变;本版仅调整菜单定位与开合实现(`lib/client.js` 同步重建)。PR #5(@LittleFishStars)。
21
+
22
+ [0.3.9]: https://github.com/Witherwithwinter/DSH-Codinput/compare/v0.3.8...v0.3.9
23
+
5
24
  ## [0.3.8] — 2026-10-30
6
25
 
7
26
  数据行三枚详情面板改为官方同构的 portal + fixed 锚定定位(滚动/尺寸变化跟随、Escape 与点外关闭、三面板单一展开);设置页开关样式与面板背景/圆角 token 对齐官方;修复 patchReload live 热更新后新增样式类不注入;修复 0.3.7 带图用户消息渲染崩溃(P0)并收紧用户消息 Markdown 的安全基线(P1)。
package/NOTICE CHANGED
@@ -47,6 +47,6 @@ alongside this repository's LICENSE file.
47
47
  crelt 1.0.7
48
48
  Copyright (C) 2020 by Marijn Haverbeke <marijn@haverbeke.berlin>
49
49
 
50
- 以上版本为本仓库 v0.3.8 的 package-lock.json 锁定值。react / react-dom 为宿主平台
50
+ 以上版本为本仓库 v0.3.9 的 package-lock.json 锁定值。react / react-dom 为宿主平台
51
51
  模块(bundle external,未随本包分发),esbuild / typescript 仅为构建期开发依赖,
52
52
  均不在内置清单内。
package/README.en.md CHANGED
@@ -91,7 +91,7 @@ To pin a version or maintain the profile by hand, the manual equivalent of **Met
91
91
  ```jsonc
92
92
  {
93
93
  "dependencies": {
94
- "dsh-codinput": "^0.3.8" // for local development: "link:/abs/path/to/DSH-Codinput"
94
+ "dsh-codinput": "^0.3.9" // for local development: "link:/abs/path/to/DSH-Codinput"
95
95
  },
96
96
  "dsh": {
97
97
  "profile": {
@@ -110,18 +110,19 @@ After editing the profile by hand, run `pnpm install` inside the profile directo
110
110
 
111
111
  ## Compatibility
112
112
 
113
- The host publishes **rc** builds on npm: `latest` is the current stable rc, `next` the following rc, `alpha` further ahead (as of 2026-10-30, `latest` / `next` both point at `0.2.1-rc.5`, `alpha` is `0.2.2-alpha.2`), so a plain install gives you an rc.
113
+ The host publishes **rc** builds on npm: `latest` is the current stable rc, `next` the following rc, `alpha` further ahead (as of 2026-11-06, `latest` / `next` both point at `0.2.2-rc.1`, `alpha` is `0.2.2-alpha.3`), so a plain install gives you an rc.
114
114
 
115
115
  | Host version | Status |
116
116
  | --- | --- |
117
117
  | Desktop app (Electron, `0.2.1-rc.3`) | ✅ Static alignment (0.3.8 extracts this build's official CSS Modules and theme tokens from `app.asar` and checks them value by value: Switch rules, the stats / ContextMeter panels' portal+fixed placement, background and radius, and `--dsh-frame-top-clearance` all match; the macOS vibrancy/opacity difference was not eyeballed on a real desktop). The `0.2.1-rc.2` real-instance run recorded in 0.3.2 still holds (official voice-input button synced — mic permission → recording → transcription verified end to end; the button hides itself when the voice plugin is absent or off) |
118
118
  | web `0.2.0-rc.2` | ✅ Verified on a real instance (this machine's current web host; the slot mirrors, model-seat delegation, user-message Markdown and three-panel exclusivity from 0.3.5–0.3.7 were verified on this build with Chromium automation probes; the 0.3.8 portal-panel placement/Escape/outside-close and Markdown hardening were additionally re-checked in an isolated host with headless Edge — see CHANGELOG) |
119
+ | web `0.2.2-rc.1` | ✅ Verified on a real instance (0.3.9 menu-fix pass: isolated host + headless Edge automation, 33/33 assertions — menus portaled to body, pixel-exact model / permission / settings-dropdown geometry, ancestor-transform immunity, layout-shift follow within 2 frames, trigger toggling works; see CHANGELOG) |
119
120
  | `0.1.7-rc.2` | ✅ Verified on a real instance (the acrylic candidate menu, the relocated context meter and the dock row layout are aligned to this build) |
120
121
  | `0.1.5-rc.2` | ✅ Verified on a real instance |
121
122
  | `0.1.6-alpha.2` | ✅ Current development baseline; every feature verified end to end |
122
- | others (incl. current `latest` / `next` = `0.2.1-rc.5`) | untested; older hosts lack the rc.2 tokens, so the fallback chain keeps each host's official look |
123
+ | others (incl. current `latest` / `next` = `0.2.2-rc.1`) | untested; older hosts lack the rc.2 tokens, so the fallback chain keeps each host's official look |
123
124
 
124
- For `0.1.7-rc.2` / web `0.2.0-rc.2`, on top of the real-instance run, the official CSS for the candidate menu, the context meter, the stats dock and the user-message bubble were extracted value by value from the corresponding version's client packages (`dsh-client-ui-theme` / `dsh-client-ui-input-trigger` / `dsh-client-ui-conversation` / `dsh-client-ui-chat`) and checked against the replicas. The contracts this plugin relies on were verified per version: the slots it uses (`conversation.composer.bar`, `sidebar.right.pane.tab`, `settings.section`, plus `conversation.chat.node` and the `conversation.input.*` sub-seats), the `sidebarRight` / `sidebarRightTabs` / `locale` services and `openTabIn`, the sidebar expansion planner (dockkit `planSetExpanded`), the file-picker and tab-close contracts (`shell.bindFilePicker` / `tab.actions.close`), and the official primitives the replicas are copied from (`fileSizeText` / `fileExtension` and the attachment glyph paths, byte for byte); the desktop `0.2.1-rc.3` build was additionally checked statically against the official CSS Modules and theme tokens extracted from its `app.asar`. For how to re-run this on another channel, see the “Verifying on another channel” section of [TESTING.md](./TESTING.md).
125
+ For `0.1.7-rc.2` / web `0.2.0-rc.2`, on top of the real-instance run, the official CSS for the candidate menu, the context meter, the stats dock and the user-message bubble were extracted value by value from the corresponding version's client packages (`dsh-client-ui-theme` / `dsh-client-ui-input-trigger` / `dsh-client-ui-conversation` / `dsh-client-ui-chat`) and checked against the replicas. The contracts this plugin relies on were verified per version: the slots it uses (`conversation.composer.bar`, `sidebar.right.pane.tab`, `settings.section`, plus `conversation.chat.node` and the `conversation.input.*` sub-seats), the `sidebarRight` / `sidebarRightTabs` / `locale` services and `openTabIn`, the sidebar expansion planner (dockkit `planSetExpanded`), the file-picker and tab-close contracts (`shell.bindFilePicker` / `tab.actions.close`), and the official primitives the replicas are copied from (`fileSizeText` / `fileExtension` and the attachment glyph paths, byte for byte); the 0.3.9 menu fix was additionally verified on an isolated web `0.2.2-rc.1` host with headless Edge automation (33/33 assertions); the desktop `0.2.1-rc.3` build was additionally checked statically against the official CSS Modules and theme tokens extracted from its `app.asar`. For how to re-run this on another channel, see the “Verifying on another channel” section of [TESTING.md](./TESTING.md).
125
126
 
126
127
  The plugin leans on host internals (slot shadowing, `useTabInfo`, `sidebarRight`, `--dsw-*` tokens). Every call site guards with `typeof` checks and degrades gracefully, but a major host upgrade can still break it. **After upgrading the host, walk through [TESTING.md](./TESTING.md).**
127
128
 
package/README.md CHANGED
@@ -91,7 +91,7 @@ dsh plugin --profile web add link:/abs/path/to/DSH-Codinput
91
91
  ```jsonc
92
92
  {
93
93
  "dependencies": {
94
- "dsh-codinput": "^0.3.8" // 本地开发用 "link:/abs/path/to/DSH-Codinput"
94
+ "dsh-codinput": "^0.3.9" // 本地开发用 "link:/abs/path/to/DSH-Codinput"
95
95
  },
96
96
  "dsh": {
97
97
  "profile": {
@@ -110,18 +110,19 @@ dsh plugin --profile web add link:/abs/path/to/DSH-Codinput
110
110
 
111
111
  ## 兼容性
112
112
 
113
- 宿主通过 npm 发的是 **rc** 版本:`latest` 是当前稳定 rc、`next` 是下个 rc、`alpha` 更超前(2026-10-30 实测 `latest` / `next` 同指 `0.2.1-rc.5`,`alpha` 为 `0.2.2-alpha.2`),所以普通用户装到的就是 rc。
113
+ 宿主通过 npm 发的是 **rc** 版本:`latest` 是当前稳定 rc、`next` 是下个 rc、`alpha` 更超前(2026-11-06 实测 `latest` / `next` 同指 `0.2.2-rc.1`,`alpha` 为 `0.2.2-alpha.3`),所以普通用户装到的就是 rc。
114
114
 
115
115
  | 宿主版本 | 状态 |
116
116
  | --- | --- |
117
117
  | 桌面版(Electron,`0.2.1-rc.3`) | ✅ 静态对齐(0.3.8 从该版 `app.asar` 取出官方 CSS Modules 与主题 token 逐值核对:Switch 规则、stats 面板 / ContextMeter 面板的 portal+fixed 与背景/圆角、`--dsh-frame-top-clearance` 均一致;macOS 的毛玻璃/不透明度差异未实机目检)。0.3.2 记录的 `0.2.1-rc.2` 实机实测仍有效(官方语音输入按钮同步——授权 → 录音 → 转写端到端验证;语音插件缺席或关闭时按钮自动隐藏) |
118
118
  | web `0.2.0-rc.2` | ✅ 实机实测通过(本机当前 web 宿主;0.3.5–0.3.7 的座位镜像、模型座让位、用户消息 Markdown 与三面板互斥均在此版本以 Chromium 自动化探针实测;0.3.8 的 portal 面板定位/Escape/点外关闭与 Markdown 安全硬化另在隔离宿主以无头 Edge 探针复核,见 CHANGELOG) |
119
+ | web `0.2.2-rc.1` | ✅ 实机实测通过(0.3.9 菜单修复专项:隔离宿主 + 无头 Edge 自动化探针,33/33 断言通过——菜单 portal 到 body、模型 / 权限 / 设置下拉几何逐像素吻合、祖先 transform 免疫、布局位移 2 帧内跟随、连点开合正常;见 CHANGELOG) |
119
120
  | `0.1.7-rc.2` | ✅ 实机实测通过(候选菜单亚克力、上下文小圈挪位、dock 行布局即为此版对齐) |
120
121
  | `0.1.5-rc.2` | ✅ 实机实测通过 |
121
122
  | `0.1.6-alpha.2` | ✅ 开发基线,全部功能端到端实测通过 |
122
- | 其它(含现网 `latest` / `next` = `0.2.1-rc.5`) | 未实测;旧宿主无 rc.2 新 token,回退链自动保持各版官方原形态 |
123
+ | 其它(含现网 `latest` / `next` = `0.2.2-rc.1`) | 未实测;旧宿主无 rc.2 新 token,回退链自动保持各版官方原形态 |
123
124
 
124
- 对 `0.1.7-rc.2` / web `0.2.0-rc.2`,除实机验证外,还从对应版本的客户端包(`dsh-client-ui-theme` / `dsh-client-ui-input-trigger` / `dsh-client-ui-conversation` / `dsh-client-ui-chat`)逐值提取了候选菜单、上下文小圈、stats dock 与用户消息气泡的官方 CSS 核对;桌面 `0.2.1-rc.3` 另从该版 `app.asar` 取出官方 CSS Modules 与主题 token 做静态逐值核对。插件依赖的契约按版本核对过:用到的槽位(`conversation.composer.bar`、`sidebar.right.pane.tab`、`settings.section`,以及 `conversation.chat.node` 与 `conversation.input.*` 子座)、`sidebarRight` / `sidebarRightTabs` / `locale` 服务与 `openTabIn`、侧栏展开规划(dockkit `planSetExpanded`)、文件拾取与 tab 关闭契约(`shell.bindFilePicker` / `tab.actions.close`)、以及复刻所依据的官方原语(`fileSizeText` / `fileExtension` 与附件 glyph 路径,逐字一致)。插件对宿主内部结构的依赖较多(槽位遮蔽、`useTabInfo`、`sidebarRight`、`--dsw-*` 令牌),代码里处处用 `typeof` 守卫 + `try/catch` 降级,但宿主大版本升级仍可能失效。**升级宿主后请按 [TESTING.md](./TESTING.md) 走一遍冒烟清单。**
125
+ 对 `0.1.7-rc.2` / web `0.2.0-rc.2`,除实机验证外,还从对应版本的客户端包(`dsh-client-ui-theme` / `dsh-client-ui-input-trigger` / `dsh-client-ui-conversation` / `dsh-client-ui-chat`)逐值提取了候选菜单、上下文小圈、stats dock 与用户消息气泡的官方 CSS 核对;桌面 `0.2.1-rc.3` 另从该版 `app.asar` 取出官方 CSS Modules 与主题 token 做静态逐值核对。插件依赖的契约按版本核对过:用到的槽位(`conversation.composer.bar`、`sidebar.right.pane.tab`、`settings.section`,以及 `conversation.chat.node` 与 `conversation.input.*` 子座)、`sidebarRight` / `sidebarRightTabs` / `locale` 服务与 `openTabIn`、侧栏展开规划(dockkit `planSetExpanded`)、文件拾取与 tab 关闭契约(`shell.bindFilePicker` / `tab.actions.close`)、以及复刻所依据的官方原语(`fileSizeText` / `fileExtension` 与附件 glyph 路径,逐字一致);0.3.9 的菜单修复另在隔离 web `0.2.2-rc.1` 上以无头 Edge 自动化探针验收(33/33 断言通过)。插件对宿主内部结构的依赖较多(槽位遮蔽、`useTabInfo`、`sidebarRight`、`--dsw-*` 令牌),代码里处处用 `typeof` 守卫 + `try/catch` 降级,但宿主大版本升级仍可能失效。**升级宿主后请按 [TESTING.md](./TESTING.md) 走一遍冒烟清单。**
125
126
 
126
127
  ### 主题 / 皮肤插件兼容(皮肤作者必读)
127
128
 
package/TESTING.md CHANGED
@@ -85,19 +85,19 @@
85
85
  宿主在 npm 上有三个通道,**普通用户拿到的不是 alpha**:
86
86
 
87
87
  ```bash
88
- npm view @deepseek-ai/dsh dist-tags # latest / next = 当前 rc(2026-10-30 同指 0.2.1-rc.5);alpha = 更超前
88
+ npm view @deepseek-ai/dsh dist-tags # latest / next = 当前 rc(2026-11-06 同指 0.2.2-rc.1);alpha = 更超前(0.2.2-alpha.3)
89
89
  dsh --version # 你本机实际跑的那个
90
90
  ```
91
91
 
92
- `latest` 通道发的是 rc(当前 `latest` / `next` 同指 `0.2.1-rc.5`),所以「装了 dsh 插件却跑不起来」的报障大概率发生在 rc 上。开发机可以待在 alpha,但**对外声称的兼容范围应当以 rc 为准**,至少在 rc 上跑一遍第 1、3 节。
92
+ `latest` 通道发的是 rc(当前 `latest` / `next` 同指 `0.2.2-rc.1`),所以「装了 dsh 插件却跑不起来」的报障大概率发生在 rc 上。开发机可以待在 alpha,但**对外声称的兼容范围应当以 rc 为准**,至少在 rc 上跑一遍第 1、3 节。
93
93
 
94
- > **已验记录**:web 宿主 `0.2.0-rc.2` 为当前实机验证基线(0.3.5–0.3.7 均在本机 link 安装下以 Chromium 自动化探针实测,见 CHANGELOG);桌面版 `0.2.1-rc.2` 的语音同步于 0.3.2 实测通过;现网 `latest` / `next` = `0.2.1-rc.5`(2026-10-30 实测)。换宿主版本后请重新走一遍下面这节。
94
+ > **已验记录**:web 宿主 `0.2.0-rc.2` 为当前实机验证基线(0.3.5–0.3.7 均在本机 link 安装下以 Chromium 自动化探针实测,见 CHANGELOG);桌面版 `0.2.1-rc.2` 的语音同步于 0.3.2 实测通过;现网 `latest` / `next` = `0.2.2-rc.1`(2026-11-06 实测);web 宿主 `0.2.2-rc.1` 的菜单专项(0.3.9 / PR #5)已在隔离宿主以无头 Edge 自动化探针验收(33/33 断言通过:portal / 几何 / 跟随 / 开合 / resize)。换宿主版本后请重新走一遍下面这节。
95
95
 
96
96
  不动现有安装的验证方式(独立 prefix + 独立 `DSH_HOME`,不碰你在用的 profile 与会话):
97
97
 
98
98
  ```bash
99
99
  # 1) 把另一个通道装到临时 prefix,不覆盖全局安装
100
- npm i --prefix /tmp/dsh-rc @deepseek-ai/dsh@0.2.1-rc.5
100
+ npm i --prefix /tmp/dsh-rc @deepseek-ai/dsh@0.2.2-rc.1
101
101
 
102
102
  # 2) 复制一份独立 home(含带 codinput 的 profile)
103
103
  cp -r ~/.dsh /tmp/dsh-rc-home
@@ -108,7 +108,14 @@ DSH_HOME=/tmp/dsh-rc-home /tmp/dsh-rc/node_modules/.bin/dsh web --port 3081 --no
108
108
 
109
109
  重点复验:第 1 节**三态与侧栏承载**(`conversation.composer.bar` 遮蔽、`sidebar.right.pane.tab` 承载判定、收起后的唤回小球)与第 3 节**触发管线与菜单**——宿主契约变化最先断在这两处,其余功能是自绘的,跨通道风险低。
110
110
 
111
- ## 8. 0.3.7 / 0.3.8 新功能与回归
111
+ ## 8. 0.3.8 / 0.3.9 新功能与回归
112
+
113
+ **0.3.9 菜单定位与开合(PR #5)**
114
+
115
+ - [ ] **菜单 portal 到 body**:模型 / 权限 / 设置下拉打开后 `.dci-menu` 的父节点为 `body`、`position: fixed`;祖先带 `transform` / `filter` 的布局下(可用 DevTools 给卡片加 `transform: translateY(150px)`)仍与触发器对齐,不再整体偏移。
116
+ - [ ] **锚点实时跟随**:菜单打开时滚动页面 / 让布局发生位移(≥2px)→ 菜单在 2 帧内跟随触发器,上方弹出间距恒 8px、设置下拉间距恒 4px;窗口缩放后重算并夹在视口内(margin 12),不被输入卡片或设置容器裁剪。
117
+ - [ ] **开合(0.3.9 回归点)**:连点触发器两次 = 开→收(不再「点一次收不起来」);点外部关闭、点菜单内部不关闭;模型菜单钻入子页 / 返回正常;权限菜单与设置页下拉同样开合正常。
118
+ - [ ] **0.2.2-rc.1 换通道**:按 §7 独立 prefix + `DSH_HOME` 起 `dsh@0.2.2-rc.1` → 上述菜单项与第 1、3 节冒烟全过,`__dshCodinputErrs` 为空。
112
119
 
113
120
  - [ ] **用户消息 Markdown**:发送一条含 `**加粗**`、行内代码、围栏代码块、列表的消息 → 落库后右侧气泡按 Markdown 渲染,ARIA 语义(paragraph/strong/code/list)正确;@文件 / @会话 / //技能 引用 chip 显示并可点开;复制钮与时间戳、引用摘要行、悬停显形正常;`__dshCodinputErrs` 为空。设置开关即时切换(见第 5 节)。切换宿主语言后复制钮/引用摘要文案即时更新(不刷新);连续复制后卸载/切形态无残留定时器报错。
114
121
  - [ ] **带图用户消息(0.3.7 P0 回归点)**:发一条带图片附件的消息(或打开历史带图消息)→ 图片经官方 `renderMessageImages` 正常显示、无 `data-slot-error` 崩溃面;此后继续发送的用户/插队消息仍是 Markdown 形态(条目未被废黜);`__dshCodinputErrs` 为空。