dsh-lan-guard 0.6.0 → 0.7.1

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,116 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.7.1] — 2026-10-07(文档版:README 与发布说明改成人话)
4
+
5
+ 功能与 `0.7.0` 完全相同,代码零改动。
6
+
7
+ **为什么发这一版**:npm 页面展示的是已发布包里的 README,改仓库文档不会影响 npm 页面,只有发一个新版本才能把新文档送上去。
8
+
9
+ **改了什么**:
10
+
11
+ - README 的兼容性表整列重写:`0.7.0` 那格从 815 字节(塞满 `focus()`、`position:fixed`、实测数值、测试条数)压到 67 字,同病的 `0.5.0`~`0.3.3` 一并收成一两句;补上此前漏记的 `0.6.0` 一行。
12
+ - 历次发布说明(`v0.1.0`~`v0.6.0`)全部重写:从 1373~6839 字降到 646~1141 字,每版 2–4 条要点,只讲用户能感知的变化;兼容版本号逐个对照各 tag 的 `package.json` 声明。
13
+ - 工程细节(根因、标识符、实测数据、测试条数)依旧只留在本文件里。
14
+
15
+ ## [0.7.0] — 2026-10-07(手机端轮次浮轨:修掉 iPhone Chrome 错位,并做出 PC 同款「按住后滑动连续预览」)
16
+
17
+ 三件事,都只围绕 `mobileTurnRail`(默认关),不动官方逻辑:
18
+
19
+ ### 一、修掉 iPhone Chrome 上卡片错位到左上角
20
+
21
+ **用户真机反馈**(iPhone 16 Pro Max / Chrome):卡片刷新后会错位到左上角、文字看不清。这条不是本机 Chromium 能复现的——它属于 WebKit 的 coordinate space 行为。
22
+
23
+ **两条真凶,逐条排除**:
24
+
25
+ | 根因 | 修法 |
26
+ | --- | --- |
27
+ | 为取官方预览文本调用了 `mark.focus({preventScroll:true})`;Chromium 遵守 `preventScroll`,但 iOS Chrome 是 WebKit,可能仍把右边缘的已聚焦按钮滚进可视区,视觉视口右移后左边看起来出屏 | 官方 `onPointerMove` 本来就能生成同一份预览,改为**派发 bubbling `pointermove`**,彻底去掉 `focus()` 路径 |
28
+ | 卡片是挂在 `document.body` 上的 `position:fixed` 浮层,WebKit 可能对它选错 visual/layout viewport 坐标系 | 卡片改为**直接挂进官方轨道 `nav`**,`position:absolute; right:calc(100% + 8px)` 从轨道左侧展开;宽度按「轨道左缘到屏幕左侧」的真实空间限制,长英文按钮 `min-width:0` + 省略号,不再撑宽卡片 |
29
+
30
+ 同时把刻度筛选收紧为 `button[data-index]`——卡片自己的 ◀▶/跳转按钮不再混进官方逐轮计算。
31
+
32
+ ### 二、新增「按住后上下滑动 = 连续预览」(对齐 PC hover)
33
+
34
+ 旧实现只能长按定格一格、再用 ◀▶ 微调;用户要求的是 PC 那种「鼠标划过每一轮就看到那一轮的简介」。现在手势约定完整为:
35
+
36
+ | 手势 | 行为 |
37
+ | --- | --- |
38
+ | 轻点刻度 | 跳转(与官方一致,未改) |
39
+ | **0.3 秒内快速拖动** | 普通滚动轨道(scrub 需要独占 `touch-action`,这条改为自己实现,行为等价) |
40
+ | **长按 0.3 秒后上下滑动** | 手指滑到哪个刻度,卡片**立即换成那一轮的提问 + 回复摘要**,不触发跳转 |
41
+ | 停在轨道上/下边缘 30px 内 | 按 16ms 步进**自动卷动**虚拟轨道,可一直扫下去 |
42
+ | 松手 | 卡片保留供阅读,并吞掉长按补发的那次 click |
43
+
44
+ 实现上:`touch-action:none` 由这一层独占(否则 WebKit 会中途把手势交还页面滚动)、`setPointerCapture` 绑定本次手势、`pointerup/cancel` 统一清理;预览文本仍取自官方 tooltip,没有重复实现导航。
45
+
46
+ **手指下那一格要看得见**:官方对 hover 中的刻度只给 0.9 倍、灰色、半透明的细线(`.markPreview`),手指压着根本看不出来——用户真机反馈「能看到提示层是第几轮,但右侧的滑块不跟着动」。因此卡片打开期间(`nav[data-lg-turn-card]`)把该刻度提升为**满长品牌蓝条**(`scaleX(1)` + `--dsw-alias-state-business-primary`),而官方那根表示「会话当前在哪一轮」的黑条保持不变——一个是"手指选中的轮次",一个是"会话当前轮次",两者可区分。实测稳定帧:预览刻度 `scaleX(1)` / `rgb(65,118,230)`,当前轮次 `rgb(15,17,21)`。
47
+
48
+ ### 三、修掉「重启后手机白屏」
49
+
50
+ **用户真机反馈**:重启 dsh web 后手机打开是白屏。
51
+
52
+ **根因(实测复现)**:DSH 的首页响应**没有任何缓存头**(无 `cache-control` / `etag` / `last-modified`),浏览器可以复用重启前渲染的文档;而那份文档里的 bundle 地址带 `?rev=<哈希>`,重启后哈希变了,DSH 对过期 rev 一律 404。于是一次 `dsh web` 重启就可能让手机停留在白屏,直到清掉站点数据。
53
+
54
+ 复现实验:把服务端首页里所有 `rev=` 改成一个死值 → `/plugins/` 出现 3 次 404,App 完全挂载不起来(Chromium 显示 "Failed to load plugins";移动端 Safari 表现为白屏)。
55
+
56
+ **改法**:代理在转发时给 **HTML 文档**补 `cache-control: no-store`(`withDocumentNoStore`)——仅在响应是 HTML 且上游没有给缓存策略时生效,bundle 等非文档响应一律不动,因此不会伤害静态资源缓存。
57
+
58
+ ### 四、修掉「拖动触发上传文件」
59
+
60
+ **用户真机反馈**:手机上拖动会触发上传文件的功能。
61
+
62
+ **机制**:DSH 的附件视图在 document 上监听拖拽,只要拖拽数据里带 `Files` 就激活(`ui-attachment/src/client/drop-events.ts`)——也就是说,**只要轨道上能起一次原生拖拽**,松手时就可能变成一次文件投放。而 iOS 在起原生手势(选择 / 系统拖拽)时会用 `pointercancel` 收走指针流,我们原先只在 `pointerup` 分支吞掉后续 click,**被 cancel 的这次手势不会吞**,那次 click 就落到手指下面(例如输入区的附件按钮)——看起来就是"拖动触发了上传"。
63
+
64
+ **改法(三处一起,缺一不可)**:
65
+ 1. 轨道及其子元素 CSS 加 `-webkit-user-drag:none; user-select:none; -webkit-user-select:none`,并且原来就有 `touch-action:none`、`-webkit-touch-callout:none`;
66
+ 2. 新增捕获阶段 `dragstart` / `selectstart` 拦截:**只有**起点在轨道内的才 `preventDefault` + `stopPropagation`,正文里的正常选择与拖拽不受影响;
67
+ 3. `pointercancel` 现在与 `pointerup` 一样吞掉这次手势的尾随 click(普通轻点没有拖拽状态,因此绝不被吞)。
68
+
69
+ ### 五、修掉「只能滑两下,再滑整个页面跟着拖动 / 触发刷新」
70
+
71
+ **用户真机反馈**:上传问题没了,但**只能滑动两下**,继续滑就整页跟着拖,甚至刷新整个页面。
72
+
73
+ **根因**:`touch-action:none` 原先只写在 `nav`(轨道)上,而手指实际落在 `nav` 的**子元素**(刻度按钮,`touch-action:auto`)上;官方 CSS 在轨道内部**没有任何 `touch-action`**(只有 `overscroll-behavior: contain`)。WebKit 便从那个子元素解析手势,手指滑过约 20px(正好 ≈ 两格)后把垂直拖拽判给页面 → 页面被拖动 → 到顶再下拉就是**下拉刷新**(整页重载)。这也解释了"只能滑两下"的滑程。
74
+
75
+ **改法(三层,逐层收口)**:
76
+ 1. `touch-action:none!important` 从 `nav` 覆盖到**整棵子树** `nav[…] *`,任何后代都不能再把垂直手势让给页面;轨道自身同时 `overscroll-behavior: contain!important`;
77
+ 2. 手势期间改用**非被动 `touchmove`** 监听(`{capture:true,passive:false}`),只要本次手势是从轨道上起(`armed / scrubbing / dragScrolling` 且触点在轨道内)就 `preventDefault()`;**多指触摸放行**(不影响缩放),轨道之外的触摸一律不碰;
78
+ 3. 移动端 `html,body{overscroll-behavior-y:none}`——即使还有过冲,也不再触发下拉刷新整页重载。
79
+
80
+ 实测(服务端原样页面):把注入脚本打进真实页面后逐个元素读计算样式,刻度按钮 / 内层 span / 滚动层全部 `touch-action: none` + `overscroll-behavior: contain`,`html`/`body` 为 `overscroll-behavior-y: none`。
81
+
82
+ ### 六、修掉「蓝色跳转按钮变了,浮窗标题/内容却不变」
83
+
84
+ **用户真机反馈**:按住拖动时,蓝色「加载并跳转到第 N 轮」按钮会变,说明命中的刻度已经切换;但浮窗标题与回复摘要仍停在上一轮。
85
+
86
+ **根因**:蓝色按钮直接读当前刻度的 `aria-label`,因此可同步更新;标题/摘要则读官方 React tooltip 的 DOM。连续拖动时,iPhone WebKit 上 React 对 tooltip 的提交可能晚于原先假定的双 `requestAnimationFrame`,脚本重复读到仍挂在 DOM 上的**上一轮 tooltip**,所以按钮与内容脱节。
87
+
88
+ **改法**:不再赌固定两帧:
89
+ 1. 切换新刻度时只更新操作按钮的 `aria-label`,浮窗标题显示「正在读取本轮摘要…」、旧摘要隐藏,绝不把按钮文案或旧轮次内容伪装成简介;
90
+ 2. 监听官方 tooltip 的文本/子节点更新(`MutationObserver`),React 一提交即重读标题和摘要;
91
+ 3. 同时保留最多约 3.6 秒的有界轮询,覆盖 WebKit 批量提交或替换整个 tooltip 节点的情况;关闭卡片时统一断开 observer / timer;
92
+ 4. 本次卡片打开期间按刻度 `data-index` 缓存已确认的标题/摘要,快速回滑到已读过的轮次直接显示;松手后再向最终刻度发送一次稳定预览信号,避免连续手势的最后一次 React 提交被中间刻度覆盖。
93
+
94
+ 浏览器实测未加载的第 60→61 轮:0ms 为等待态,100ms 官方 tooltip 提交后变为「按照建议执行」+ 对应摘要,持续到 3 秒不回退;快速离开再回到第 61 轮立即命中缓存。新增延迟提交与回滑缓存用例;移除 watcher 后延迟提交用例立即变红。
95
+
96
+ ### 七、验证
97
+
98
+ **服务端原样**(DSH 0.2.1-alpha.1 / iPhone Chrome UA / 440×956 / 经代理 3081,45 格长会话)实测:
99
+
100
+ | 步骤 | 结果 |
101
+ | --- | --- |
102
+ | 按住刻度 | 卡片出现(`Load and jump to turn 16`) |
103
+ | 按住后滑到中间刻度 | 卡片实时 **第 16 轮 → 第 38 轮**,`transcript scrollTop 14359 → 14359`(**未跳转**) |
104
+ | 手指停在轨道上边缘 | `scrollTop 182 → 0`,卡片一路连扫到**第 1 轮** |
105
+ | 松手 | 卡片保留、仍未跳转 |
106
+ | 0.3 秒内快速向上拖 | 轨道 `scrollTop 0 → 50`(普通滚动),卡片内容不变 |
107
+ | 轻点刻度 | `transcript 14359 → 21`(照旧跳转) |
108
+ | 视口 | `visualViewport 0…440`、`scrollX 0`、文档宽 440、0 报错 |
109
+
110
+ **先红后绿 + 反证**:新增 4 条用例(长按后连续换摘要、快速拖动滚动轨道、边缘自动卷动、卡片锚定在 nav)在实现前各自失败;随后逐条回退实现确认再次变红,还原后全绿。全套 **376** 项通过。
111
+
112
+ > 测试踩过的坑(已写入记忆,避免复测误判):官方轨道的滚动层是 `nav > div[class*="_scroller"]`(`max = scrollHeight - clientHeight`),而会话默认停在最新一轮,**轨道往往已经在最底部**——此时「继续往下滚/向下拖」读数不变,看起来像功能失效。要验证请往**上**滑/往上拖。
113
+
3
114
  ## [0.6.0] — 2026-10-06(手机端轮次导航补上可读提示:按住出卡片)
4
115
 
5
116
  **用户真机反馈**(iPhone 16 Pro Max / iOS Safari,`0.5.0`):浮轨能看到了,但「太靠右」且「看不到它提示的内容」——点得到历史、看不到内容。
package/README.md CHANGED
@@ -148,22 +148,25 @@ The plugin reads its config from its Cordis entry. **Every key has a usable defa
148
148
 
149
149
  ## Compatibility
150
150
 
151
- Current version: plugin **`0.5.0`**; compatible with DeepSeek Harness **`0.2.1-alpha.1`** (the adaptation itself is declaration-only and touches no code; this release also adds one off-by-default switch, `mobileTurnRail`).
151
+ Current version: plugin **`0.7.1`**, compatible with DeepSeek Harness **`0.2.1-alpha.1`**. Each row below is one plugin release: the DSH versions it was verified against, and what that release did.
152
152
 
153
153
  | Plugin | Verified DeepSeek Harness | What this version is |
154
154
  | --- | --- | --- |
155
- | **`0.5.0`** | **`0.2.1-alpha.1`**, **`0.2.0-rc.2`**, `0.2.0-rc.1`, `0.1.7-rc.2` | (1) **Adaptation, zero code**: across the 266 commits from `rc.2` to `0.2.1-alpha.1`, of the six surfaces this plugin depends on only `ui-layout` (new `shell.bottom` slot, frame grid rows → `minmax(0,1fr) auto`) and `ui-renderer` (drops the unreferenced `invariant.ts`) changed source, and neither concerns this plugin (nothing renders `shell.bottom` — measured at 0 height). devDependencies raised to `dsh-host-webserver`/`dsh-client-connection` `0.2.1-alpha.1`, **and — because the new host packages peer-require the vendor prereleases — `@deepseek-ai/cordis` to `4.0.5-alpha.1` and `@deepseek-ai/schemastery` to `3.18.5-alpha.1`** (a `^4.0.4` range excludes prereleases); type check + 368 tests green. (2) **New `mobileTurnRail` (off by default)**: un-hides DSH's own turn rail, which the official narrow-screen container query hides. (3) Narrow-screen regression re-run: right sidebar 100% visible, 0 clipped layers, healthy scroll range, zero compensation engagement — identical on 3080 and 3081 |
156
- | **`0.4.6`** | **`0.2.0-rc.2`**, **`0.2.0-rc.1`**, `0.1.7-rc.2` | Verification release for `0.2.0-rc.2`: zero code changes, compatibility metadata only (`dsh.compatibility.dshReleases` gains `0.2.0-rc.2`), plus both host devDependencies raised to `0.2.0-rc.2` and the type check and full suite re-run. Upstream changed only version numbers between `rc.1` and `rc.2` (the sole source edit is a hooks-ordering fix in `ui-renderer`, unrelated to this plugin), so the plugin runs on `rc.2` unchanged; measurements also confirm the mobile clip compensation now has nothing to act on (clipped layers 1 → **0**, scroll range 336px → **92343px**; every polling round reverts wholesale and writes no inline style) |
157
- | **`0.4.5`** | **`0.2.0-rc.1`**, `0.1.7-rc.2` | Long transcripts hydrate after the official scroller has already picked up a small scroll range; the mobile clip compensation treated that intermediate state as healthy and stopped, so a late `overflow:hidden` layer was never released (measured on device: 336px of scroll range with 1 clipped layer inside the scroller). It now keeps looking inside the existing polling window and releases the late layer — 336px → 6889px, 1 clipped layer → 0, official "back to bottom" still on screen |
158
- | **`0.4.4`** | **`0.2.0-rc.1`**, `0.1.7-rc.2` | iOS session scrolling on DSH `0.2.0-rc.1`: an inner `overflow:hidden` layer with a locked height clipped the conversation (measured on device: 21083px of content behind a 336px scroll range), so a session did not open at the newest message and barely dragged. `mobileScrollFix` now grows that inner layer and drops its scroll-container role, restoring 20675px — verified on device with the composer still pinned and the official "back to bottom" button back in place |
159
- | **`0.4.3`** | **`0.2.0-rc.1`**, `0.1.7-rc.2`, `0.1.7-rc.1` | Direction change: fix the mobile **height chain** instead of patching `overflow` — a definite height for `html/body/#root`, `100dvh` on the shell and `min-height:0` along the clipping chain, self-checked and reverted wholesale when the official scroll layer still does not scroll; removes the self-made "back to bottom" button and every `overflow-y`/`-webkit-overflow-scrolling` patch; declares DSH `0.2.0-rc.1` and widens the `dsh`/peer ranges to `<0.3.0` |
160
- | **`0.4.2`** | `0.1.7-rc.2` | The official "back to bottom" button restored: the narrow-screen correction left the conversation's own scroll layer without a growing height, so the official button never believed it was away from the end — the plugin supplies one while hidden and yields as soon as the official one works; also reverts its `overflow-y` patch whenever a full-screen mask or dialog opens (the drawer-scrim regression) |
161
- | **`0.4.1`** | `0.1.7-rc.2` | First cut of `mobileScrollFix` for "the chat area cannot be dragged on a phone": applies touch-scrollable treatment only when narrow viewport + mobile UA + the page cannot scroll + a clipped overflowing layer is found, and never touches an already-scrolling page; adds the `?lgdiag=1` layout report; measured on device, 86.4s of connection survival with heartbeat answering |
162
- | **`0.4.0`** | **`0.1.7-rc.2`**, `0.1.7-rc.1` | Mobile long-connection self-healing: the proxy answers DSH's WebSocket heartbeat (measured: 6 s reap without it, 20 s+ survival with it); page patches adding a socket watchdog and mobile compatibility shims; a connection health check and relay counters on the "connection" tab |
163
- | **`0.3.6`** | **`0.1.7-rc.2`**, `0.1.7-rc.1` | Adding a workspace from a remote device: the browser half shadows the official directory flow (the local browser keeps the OS dialog, a remote device gets an in-page browser and can unlock inside it); fixes the proxy dropping the plugin's admin cookie in both directions, which made `password_unlock` meaningless remotely; adds the missing "remote management rights" control; moves the "saved" confirmation to a top-right notification; reworks status-surface colours against measured contrast; fixes the picker's crushed breadcrumb/shortcut rows |
164
- | **`0.3.5`** | **`0.1.7-rc.2`**, `0.1.7-rc.1` | Connection-level visibility: an `http://` request to the TLS port goes from "blank page + no log" to a 301 onto `https` with a log line; a deleted device record no longer locks that browser out (revoked/blocked still refuse); the removal-page copy follows |
165
- | **`0.3.4`** | **`0.1.7-rc.2`**, `0.1.7-rc.1` | Official settings page on the LAN: a new `settingsUnlock` switch (on by default) that injects the host-surface marker into the index; applies on page refresh; a UI unlock, not a new privilege |
166
- | **`0.3.3`** | **`0.1.7-rc.2`**, `0.1.7-rc.1` | Gate UX fixes: the two first-visit steps are announced up front; an inert-link page can be logged into again; the blocking note now matches real behaviour (no host-facing change) |
155
+ | **`0.7.1`** | **`0.2.1-alpha.1`**, `0.2.0-rc.2`, `0.2.0-rc.1`, `0.1.7-rc.2` | Documentation release: the README and past release notes were rewritten in plain language. Behaviour is identical to 0.7.0. |
156
+ | **`0.7.0`** | **`0.2.1-alpha.1`**, `0.2.0-rc.2`, `0.2.0-rc.1`, `0.1.7-rc.2` | The phone turn rail finally works: no more drifting card, and previews follow your finger while you hold and slide (off by default). Blank pages after a restart are fixed too. |
157
+ | **`0.6.0`** | **`0.2.1-alpha.1`**, **`0.2.0-rc.2`**, `0.2.0-rc.1`, `0.1.7-rc.2` | Fixed "you can see the rail but not its content" on a phone: holding a tick for ~0.3s now opens a card with that turn's prompt and reply. |
158
+ | **`0.5.0`** | **`0.2.1-alpha.1`**, **`0.2.0-rc.2`**, `0.2.0-rc.1`, `0.1.7-rc.2` | Keeps up with the new DSH release (declaration only) and adds the phone turn rail, off by default. |
159
+ | **`0.4.6`** | **`0.2.0-rc.2`**, **`0.2.0-rc.1`**, `0.1.7-rc.2` | Keeps up with DSH 0.2.0-rc.2: declaration only, plus confirmation that the old mobile scroll compensation is no longer needed. |
160
+ | **`0.4.5`** | **`0.2.0-rc.1`**, `0.1.7-rc.2` | Fixes long sessions that still would not scroll when the transcript hydrated a beat late and the fix stopped early. |
161
+ | **`0.4.4`** | **`0.2.0-rc.1`**, `0.1.7-rc.2` | Fixes iOS sessions opening away from the newest message and barely dragging. |
162
+ | **`0.4.3`** | **`0.2.0-rc.1`**, `0.1.7-rc.2`, `0.1.7-rc.1` | A different approach: repair the mobile height chain instead of patching the content layer, and drop the self-made back-to-bottom button. |
163
+ | **`0.4.2`** | `0.1.7-rc.2` | Brings back DSH's own back-to-bottom button and fixes the grey sidebar it fought with. |
164
+ | **`0.4.1`** | `0.1.7-rc.2` | The first mobile scroll fix: it only acts on pages that really cannot scroll, and adds the ?lgdiag=1 report. |
165
+ | **`0.4.0`** | **`0.1.7-rc.2`**, `0.1.7-rc.1` | The phone connection stops dropping (the proxy answers DSH's heartbeats), plus a disconnect watchdog and a connection check-up. |
166
+ | **`0.3.6`** | **`0.1.7-rc.2`**, `0.1.7-rc.1` | Add a workspace over LAN, and fix remote device management and a few UI problems. |
167
+ | **`0.3.5`** | **`0.1.7-rc.2`**, `0.1.7-rc.1` | http on the TLS port now redirects to https and logs it, and deleting a device no longer locks the browser out. |
168
+ | **`0.3.4`** | **`0.1.7-rc.2`**, `0.1.7-rc.1` | LAN devices can use DSH's own settings pages (on by default; it unlocks the UI and grants no new permissions). |
169
+ | **`0.3.3`** | **`0.1.7-rc.2`**, `0.1.7-rc.1` | Both first-visit steps are explained up front, expired links can sign in again, and the block-list wording matches the code. |
167
170
  | **`0.3.2`** | **`0.1.7-rc.2`**, `0.1.7-rc.1` | Install and go: LAN-facing default + derived `dataDir`; Liquid Glass settings page at official sizes; single-line scrolling access URL |
168
171
  | **`0.3.1`** | **`0.1.7-rc.2`**, `0.1.7-rc.1` | Verification release for `0.1.7-rc.2`: no code change, only compatibility metadata |
169
172
  | `0.3.0` | `0.1.7-rc.1` | Device approval and permanent blocking; fixed the blank page when opening a shared `?auth=` link |
@@ -236,12 +239,14 @@ The official UI is reused with zero modifications and adapts on a phone viewport
236
239
  | Gesture | What happens |
237
240
  | --- | --- |
238
241
  | Tap a mark | Unchanged: jump to that turn (paging history in first when needed) |
239
- | **Hold a mark for ~0.3s** | A readable **turn card** opens: that turn's prompt plus an excerpt of the reply — the very text the official component renders for a hover, read out by focusing the mark |
242
+ | **Hold a mark for ~0.3s** | A readable **turn card** opens: that turn's prompt plus an excerpt of the reply — the very text the official component renders for a hover, read out by dispatching `pointermove` (no `focus()` call) |
243
+ | **Slide up/down after the hold** | **Sweeps every turn**: the card immediately switches to whatever tick the finger is over, exactly like desktop hover |
244
+ | Rest at either rail edge | Auto-scrolls the virtual rail on a 16ms step, so you can keep sweeping |
240
245
  | ◀ / ▶ on the card | Step turn by turn while reading, so a 10px tick is never the target |
241
246
  | “Jump to turn N” on the card | Runs the official click and dismisses the card |
242
- | Drag (>16px) while holding | Cancels the hold so the rail still scrolls, and the card never pops |
247
+ | Quick drag within 0.3s | Scrolls the rail normally (no card) |
243
248
 
244
- The card exists only on a coarse pointer and a narrow screen, and closes on ✕, on a tap outside, or after a jump.
249
+ The card exists only on a coarse pointer and a narrow screen, and closes on ✕, on a tap outside, or after a jump. It is anchored **inside the official rail**, not a body-level fixed layer — that is what stopped the top-left misplacement on iPhone Chrome.
245
250
 
246
251
  **Known limit (hence off by default)**: each mark is 28×10px and the pitch is fixed at 10px inside DSH's own JavaScript, so CSS-growing them to 44px would make neighbours overlap and mis-tap. Precision comes from the card and its steppers, not from bigger marks. The rail also cannot move further inwards: its left edge sits exactly on the message column (measured on a 440px viewport: rail `[401,411,28,52]`, column right edge 401), and anything further left would cover text.
247
252
 
package/README.zh.md CHANGED
@@ -100,7 +100,7 @@ dsh plugin --profile web add "link:$(pwd)"
100
100
  | 断线看门狗 | **开** | 页面补丁:卡在「连接中」超过 8 秒的 WebSocket 会被关掉;从后台回来 10 秒后仍一条都没连上时自动重载一次(每标签最多连续 3 次,冷却 20 秒起)。只对真的连不上的页面生效。刷新页面生效。 |
101
101
  | 移动端兼容垫片 | **开** | 页面补丁:补 `AbortSignal.any`/`AbortSignal.timeout`/`Promise.withResolvers`/`Iterator` 与移动端 meta。缺这些 API 时 DSH 客户端在会话流里抛错,界面只会一直显示「载入历史…」且没有报错。现代浏览器上这些分支不生效。刷新页面生效。 |
102
102
  | 手机滚动矫正(窄屏) | **开** | 手机端 DSH 外壳在窄屏下把对话列裁在 `overflow:hidden` 的层里(实测 844/1688),整页也不可滚 → 内容可见但**滑不动**。开启后只在「窄屏 + 移动端 + 整页不可滚 + 找到被裁剪溢出的层」四条同时成立时,把那几层改成可触摸滚动;正常页面不碰。页面加 `?lgdiag=1` 可看布局诊断。刷新页面生效。 |
103
- | 手机端轮次导航 | 关 | 把 PC 右侧那根**轮次浮轨**搬到手机:DSH 在手机上其实照样渲染它(可跳转到某一轮、未加载的会先翻历史再跳、当前轮次跟随),只是被它自己的窄屏容器查询藏了起来(`@container (max-width: 900px)`)。开启后用一段只在 ≤1023px 生效的样式把它放出来(`right:4px`、宽 28px,正好占满对话区右侧留白、不压正文),并给手机补一套手势:**轻点 = 跳转**、**按住 ≈0.3 秒 = 弹出可读的轮次卡片**(含该轮提问与回复摘要 + ◀▶ 逐轮微调 + 一键跳转)、**按住后拖动 = 滚动刻度**。**已知短板**:每格 28×10px、格间距在官方 JS 里锁死 10px,所以"点得准"靠卡片与 ◀▶ 而不是放大刻度。上游若改了隐藏规则,脚本会在 3 秒内自检失败并**整体摘掉样式**(页面回到官方原样)。刷新页面生效;`?lgdiag=1` 底部会多一屏轮次导航诊断。 |
103
+ | 手机端轮次导航 | 关 | 把 PC 右侧那根**轮次浮轨**搬到手机:DSH 在手机上其实照样渲染它(可跳转到某一轮、未加载的会先翻历史再跳、当前轮次跟随),只是被它自己的窄屏容器查询藏了起来(`@container (max-width: 900px)`)。开启后用一段只在 ≤1023px 生效的样式把它放出来(`right:4px`、宽 28px,正好占满对话区右侧留白、不压正文),并给手机补一套手势:**轻点 = 跳转**、**按住 ≈0.3 秒 = 弹出可读的轮次卡片**(含该轮提问与回复摘要 + ◀▶ 逐轮微调 + 一键跳转)、**按住成功后上下滑动 = 连续预览**(手指滑到哪一格就换成那一轮的摘要,停在轨道上下边缘会自动继续卷动)、**0.3 秒内快速拖动 = 普通滚动轨道**。**已知短板**:每格 28×10px、格间距在官方 JS 里锁死 10px,所以"点得准"靠卡片与 ◀▶ 而不是放大刻度。上游若改了隐藏规则,脚本会在 3 秒内自检失败并**整体摘掉样式**(页面回到官方原样)。刷新页面生效;`?lgdiag=1` 底部会多一屏轮次导航诊断。 |
104
104
  | 新设备需要命名确认 | **开** | 新设备首次通过门禁时要自己命名一次,之后才出现在设备列表里。 |
105
105
  | 新设备需要管理员批准 | 关 | 开启后,命名完还要你在设备列表点「批准」才能进入。 |
106
106
  | TLS | **自签 HTTPS** | 关闭会明文传输门禁密码;非回环 + 关闭 TLS 必须显式设置 `tls.allowInsecureLan: true`,否则**拒绝启动**。 |
@@ -149,22 +149,25 @@ dsh plugin --profile web add "link:$(pwd)"
149
149
 
150
150
  ## 兼容性
151
151
 
152
- 当前版本:插件 **`0.5.0`**;兼容 DeepSeek Harness **`0.2.1-alpha.1`**(适配仅声明、零代码;本版另加一个默认关闭的 `mobileTurnRail`)。
152
+ 当前版本:插件 **`0.7.1`**,兼容 DeepSeek Harness **`0.2.1-alpha.1`**。下表每行是一个插件版本:它验证过哪些 DSH 版本,以及那一版做了什么。
153
153
 
154
154
  | 插件 | 已验证的 DeepSeek Harness | 这个版本是什么 |
155
155
  | --- | --- | --- |
156
- | **`0.5.0`** | **`0.2.1-alpha.1`**、**`0.2.0-rc.2`**、`0.2.0-rc.1`、`0.1.7-rc.2` | ①**适配(零代码)**:`rc.2 → 0.2.1-alpha.1` 的 266 个提交里,本插件依赖的 6 个面中只有 `ui-layout`(新增 `shell.bottom` 槽、frame 网格行改 `minmax(0,1fr) auto`)与 `ui-renderer`(删掉未被引用的 `invariant.ts`)有源码改动,两者都与本插件无关(`shell.bottom` 无人渲染,实测占位 0 高)。devDependency 升到 `dsh-host-webserver`/`dsh-client-connection` `0.2.1-alpha.1`,**并按新宿主包的 peer 要求连带把 `@deepseek-ai/cordis` 升到 `4.0.5-alpha.1`、`@deepseek-ai/schemastery` 升到 `3.18.5-alpha.1`**(`^4.0.4` 不含预发布版);类型检查 + 368 个用例全绿。②**新增 `mobileTurnRail`(默认关)**:把被官方窄屏容器查询藏起来的轮次浮轨放出来。③窄屏四判据复测:右侧栏可见 100%、被裁层 0、可滚范围正常、补偿零介入,3080 与 3081 逐项一致 |
157
- | **`0.4.6`** | **`0.2.0-rc.2`**、**`0.2.0-rc.1`**、`0.1.7-rc.2` | 针对 `0.2.0-rc.2` 的验证版:代码零改动,只更新兼容元数据(`dsh.compatibility.dshReleases` 补 `0.2.0-rc.2`),并把两个宿主 devDependency 升到 `0.2.0-rc.2` 后重跑类型检查与全部用例。上游在 `rc.1 → rc.2` 之间只动了版本号(唯一源码改动是 `ui-renderer` 的 hooks 顺序修复,与本插件无关),因此本插件在 `rc.2` 上零改动可用;同时实测确认移动端裁剪补偿在 `rc.2` 上已无作用对象(被裁层 1 → **0**,可滚范围 336px → **92343px**,脚本每轮自检后整体撤销、不写任何内联样式) |
158
- | **`0.4.5`** | **`0.2.0-rc.1`**、`0.1.7-rc.2` | 长会话的正文是在官方滚动层拿到少量可滚范围**之后**才挂载的,旧逻辑把这个中间态当成「已正常」收工,晚出现的 `overflow:hidden` 层再也没人放行(真机实测:可滚范围 336px、滚动层内部仍有 1 层被裁)。现在改为在既有轮询窗口内继续侦测并放行迟到的裁剪层:可滚范围 336px → 6889px,被裁层 1 → 0,官方「回到底部」仍在屏内 |
159
- | **`0.4.4`** | **`0.2.0-rc.1`**、`0.1.7-rc.2` | 修好 DSH `0.2.0-rc.1` 上的 iOS 会话滚动:官方滚动层内部有一层 `overflow:hidden` 且高度锁死,把会话内容裁掉(真机实测:21083px 的内容只换来 336px 可滚范围),表现为打开会话不在最新、手指几乎拖不动。`mobileScrollFix` 现在让该层长高并脱离滚动容器身份,可滚范围恢复到 20675px;真机验收同时确认输入框仍吸底、官方「回到底部」按钮回到原位 |
160
- | **`0.4.3`** | **`0.2.0-rc.1`**、`0.1.7-rc.2`、`0.1.7-rc.1` | 方向修正:不再给内容层打 `overflow` 补丁,改修移动端**高度链**——给 `html/body/#root` 确定高度、shell 用 `100dvh`、沿被裁层补 `min-height:0`,并自检「官方滚动层真的能滚」否则整体回退;移除自建「回到底部」按钮与全部 `overflow-y`/`-webkit-overflow-scrolling` 补丁;声明 DSH `0.2.0-rc.1` 并把 `dsh`/peer 范围放宽到 `<0.3.0` |
161
- | **`0.4.2`** | `0.1.7-rc.2` | 找回官方「回到底部」按钮:窄屏矫正让 conversation 自己的滚动层高度不再增长,官方按钮因此永远认为还在尾部——插件在官方按钮缺席时补一个,官方按钮一恢复就自动让位;同时修复矫正的 `overflow-y` 补丁与全屏遮罩打架导致侧边栏被灰雾盖住的回归 |
162
- | **`0.4.1`** | `0.1.7-rc.2` | `mobileScrollFix` 首版,修「手机上聊天区滑不动」:仅在「窄屏 + 移动 UA + 整页不可滚 + 找到被裁剪溢出的层」四条同时成立时才处理,正常页面一律不碰;新增 `?lgdiag=1` 布局诊断;真机实测连接存活 86.4 秒 |
163
- | **`0.4.0`** | **`0.1.7-rc.2`**、`0.1.7-rc.1` | 手机长连接自愈:代理代答 DSH 的 WebSocket 心跳(实测把「停回心跳 6 秒被切断」变成「20 秒以上存活」);页面补丁加入断线看门狗与移动端兼容垫片;「连接与证书」新增连接体检与代理侧计数 |
164
- | **`0.3.6`** | **`0.1.7-rc.2`**、`0.1.7-rc.1` | 远程也能添加工作区:浏览器侧遮蔽官方目录流程(本机仍走系统对话框,远程改用页面内目录浏览器,可在弹层内解锁);修掉代理双向丢弃插件管理 cookie 导致 `password_unlock` 对远程形同虚设;补上一直缺失的「远程设备管理权限」控件;「已保存」改为右上角提示;状态表面配色按实测重做;弹层两行被压扁重叠 |
165
- | **`0.3.5`** | **`0.1.7-rc.2`**、`0.1.7-rc.1` | 连接层可见性:`http://` 访问 TLS 端口由「空白页 + 无日志」改为 301 跳 `https` 并记日志;删除设备记录后旧 cookie 不再把浏览器锁死(吊销/拉黑仍拒绝);移除页文案同步修正 |
166
- | **`0.3.4`** | **`0.1.7-rc.2`**、`0.1.7-rc.1` | 局域网设备可用官方设置页:新增默认开启的 `settingsUnlock` 开关(index 注入宿主界面标记,刷新页面生效;界面解锁而非新增权限) |
167
- | **`0.3.3`** | **`0.1.7-rc.2`**、`0.1.7-rc.1` | 门禁体验修复:首次访问的两道关提前说明;失效链接页恢复可登录;拉黑说明改为与实现一致(未触碰宿主接口) |
156
+ | **`0.7.1`** | **`0.2.1-alpha.1`**、`0.2.0-rc.2`、`0.2.0-rc.1`、`0.1.7-rc.2` | 文档版:README 和历史发布说明改成人话,功能与 0.7.0 完全相同。 |
157
+ | **`0.7.0`** | **`0.2.1-alpha.1`**、`0.2.0-rc.2`、`0.2.0-rc.1`、`0.1.7-rc.2` | 手机端轮次浮轨终于好用:卡片不再跑偏,预览跟着手指走,按住刻度上下滑动就能看每一轮在说什么(默认关闭)。顺带修掉重启后手机白屏的问题。 |
158
+ | **`0.6.0`** | **`0.2.1-alpha.1`**、**`0.2.0-rc.2`**、`0.2.0-rc.1`、`0.1.7-rc.2` | 手机上「看得见刻度、看不到内容」的问题:改成按住刻度约 0.3 秒弹出卡片,显示那一轮的提问和回复摘要。 |
159
+ | **`0.5.0`** | **`0.2.1-alpha.1`**、**`0.2.0-rc.2`**、`0.2.0-rc.1`、`0.1.7-rc.2` | 跟上新版 DSH(只改兼容声明);新增手机端轮次浮轨,默认关闭。 |
160
+ | **`0.4.6`** | **`0.2.0-rc.2`**、**`0.2.0-rc.1`**、`0.1.7-rc.2` | 跟上 DSH 0.2.0-rc.2:只更新兼容声明,并确认旧的手机滚动补偿已经不需要了。 |
161
+ | **`0.4.5`** | **`0.2.0-rc.1`**、`0.1.7-rc.2` | 修长会话里正文晚一步加载时被判成「已经正常」、结果仍然滑不动的问题。 |
162
+ | **`0.4.4`** | **`0.2.0-rc.1`**、`0.1.7-rc.2` | 修 iOS 上打开会话不在最新、手指几乎拖不动的问题。 |
163
+ | **`0.4.3`** | **`0.2.0-rc.1`**、`0.1.7-rc.2`、`0.1.7-rc.1` | 换个修法:改移动端高度链,不再给内容层打补丁,并撤掉自建的「回到底部」按钮。 |
164
+ | **`0.4.2`** | `0.1.7-rc.2` | 找回官方自带的「回到底部」按钮,并修掉它和全屏遮罩打架、侧边栏发灰的问题。 |
165
+ | **`0.4.1`** | `0.1.7-rc.2` | 第一版手机滚动修复:只在真的滑不动的页面上动手,正常页面不碰;新增 ?lgdiag=1 诊断。 |
166
+ | **`0.4.0`** | **`0.1.7-rc.2`**、`0.1.7-rc.1` | 手机长连接不再轻易掉线(代理替页面回心跳),并加入断线看门狗和连接体检。 |
167
+ | **`0.3.6`** | **`0.1.7-rc.2`**、`0.1.7-rc.1` | 局域网下也能添加工作区,并修远程设备管理和几处界面问题。 |
168
+ | **`0.3.5`** | **`0.1.7-rc.2`**、`0.1.7-rc.1` | 用 http 访问 TLS 端口会跳到 https 并留日志;删掉设备后旧 cookie 不再把浏览器锁死。 |
169
+ | **`0.3.4`** | **`0.1.7-rc.2`**、`0.1.7-rc.1` | 局域网设备也能用官方设置页(默认开启,只是解锁界面,不新增权限)。 |
170
+ | **`0.3.3`** | **`0.1.7-rc.2`**、`0.1.7-rc.1` | 首次访问的两道关提前说明;失效链接页可以重新登录;拉黑说明与实现对齐。 |
168
171
  | **`0.3.2`** | **`0.1.7-rc.2`**、`0.1.7-rc.1` | 装完即用:默认对外监听 + `dataDir` 自动推导;设置页液体玻璃与官方尺寸;访问地址改为单行滚动 |
169
172
  | **`0.3.1`** | **`0.1.7-rc.2`**、`0.1.7-rc.1` | 针对 `0.1.7-rc.2` 的验证版:代码零改动,只更新兼容元数据 |
170
173
  | `0.3.0` | `0.1.7-rc.1` | 设备批准与永久拉黑;修掉打开分享的 `?auth=` 链接时的空白页 |
@@ -237,12 +240,14 @@ dsh plugin --profile web add "link:$(pwd)"
237
240
  | 手势 | 行为 |
238
241
  | --- | --- |
239
242
  | 轻点刻度 | 与原来一致:跳转到该轮(未加载的先翻历史) |
240
- | **按住刻度约 0.3 秒** | 弹出**轮次卡片**:该轮的用户提问 + 回复摘要(文本正是官方组件为悬停渲染的那份,靠聚焦刻度取出) |
243
+ | **按住刻度约 0.3 秒** | 弹出**轮次卡片**:该轮的用户提问 + 回复摘要(文本正是官方组件为悬停渲染的那份,靠派发 `pointermove` 取出,不调用 `focus()`) |
244
+ | **按住成功后上下滑动** | **连续扫过每一轮**:手指滑到哪一格,卡片立刻换成那一轮的摘要——与 PC 上鼠标划过一致 |
245
+ | 手指停在轨道上/下边缘 | 按 16ms 步进自动卷动虚拟轨道,可以一直往下或往上扫 |
241
246
  | 卡片上的 ◀ / ▶ | 逐轮微调,边看边选——不必瞄准 10px 的格子 |
242
247
  | 卡片上的「跳到第 N 轮」 | 走官方点击,一键跳转后卡片自动关闭 |
243
- | 按住后上下拖动(>16px) | 取消长按,让刻度正常滚动,不会误弹卡片 |
248
+ | 0.3 秒内快速拖动 | 普通滚动轨道(不会弹卡片) |
244
249
 
245
- 卡片只在手机(`pointer: coarse`)与窄屏下存在;点空白处、✕ 或跳转都会关掉它。
250
+ 卡片只在手机(`pointer: coarse`)与窄屏下存在;点空白处、✕ 或跳转都会关掉它。卡片**挂在官方轨道内**(不是 body 上的 fixed 浮层),这是 iPhone Chrome 上不再错位到左上角的关键。
246
251
 
247
252
  **已知短板(所以默认关)**:每格只有 28×10px,而格间距在官方 JS 里锁死为 10px——用 CSS 撑到 44px 会让相邻格互相覆盖、反而点错。所以精度的答案不是放大刻度,而是上面的卡片与 ◀▶。另外轨道无法再往中间挪:它左边紧贴正文列(实测 440px 视口下轨道 `[401,411,28,52]`、正文列右缘 401),再往内就会压字。
248
253
 
package/lib/client.js CHANGED
@@ -1805,7 +1805,7 @@ window.__ModuleLoader__.load({
1805
1805
  (0, react.createElement)("p", {
1806
1806
  className: "lg-hint",
1807
1807
  key: "h2"
1808
- }, "📱 手机上的三种手势:① 轻点刻度 = 直接跳过去(与官方一致);② 按住刻度约 0.3 秒 = 弹出卡片,显示这一轮的用户提问与回复摘要,卡片里的 ◀ ▶ 可以逐轮微调、「跳到第 N 轮」一键跳转——PC 上那套「鼠标移上去看提示」是悬停交互,手机上根本触发不了,所以改成按住;③ 按住后上下拖动 = 让刻度自己滚动,不会误弹卡片。"),
1808
+ }, "📱 手机上的三种手势:① 轻点刻度 = 直接跳过去(与官方一致);② 按住刻度约 0.3 秒 = 弹出卡片,显示这一轮的用户提问与回复摘要,卡片里的 ◀ ▶ 可以逐轮微调、「跳到第 N 轮」一键跳转——PC 上那套「鼠标移上去看提示」是悬停交互,手机上根本触发不了,所以改成按住;③ 按住成功后上下滑动 = 像 PC 鼠标划过一样,卡片会连续换成手指下每一轮的摘要;停在轨道上/下边缘会自动继续卷动。想普通滚动轨道时,在 0.3 秒前快速拖动即可。"),
1809
1809
  (0, react.createElement)("p", {
1810
1810
  className: "lg-hint",
1811
1811
  key: "h3"