dsh-lan-guard 0.4.3 → 0.4.4

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,30 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.4.4] — 2026-09-29(补偿 DSH `0.2.0-rc.1` 的会话裁剪回归)
4
+
5
+ **现象**(真机 iPhone 16 Pro Max / iOS 27,经代理的 3081):会话内容看得见,但**手指几乎拖不动、打开会话也不停在最新消息**。
6
+
7
+ **根因(真机 A/B)**:DSH `0.2.0-rc.1` 下,官方滚动层 `[data-conversation-scroll]` **内部**的 `EvIC1a_frame` 是 `overflow:hidden` 且高度被锁死(≈视口高),把 21083px 的会话内容裁掉,高度传不上去——该滚动层虽然「有溢出」,可滚范围却只有 **336px**:
8
+
9
+ | | `0.1.7-rc.2`(本机 10.0.0.20) | `0.2.0-rc.1`(lionm4 10.0.0.30) |
10
+ | --- | --- | --- |
11
+ | 滚动层 client / scroll | 720 / 15925 | 668 / 1004 |
12
+ | 可滚范围 | 15205 | **336** |
13
+ | 最后一条消息 | 在屏内 | 在 21215px 处(屏外) |
14
+
15
+ 把页面上本插件的内联改动全部清掉后该裁剪依旧存在 ⇒ **属 DSH 原生回归,不是注入造成的**;本插件的角色是补偿。
16
+
17
+ **修法**:`mobileScrollFix` 新增 `fixClip()`——对滚动层**内部**满足「`overflow:hidden/clip` 且内容溢出」的层**同时**设 `height:auto` 与 `overflow:visible`,并以「可滚范围是否真的变大」自检、无效则整体回退。两条缺一不可:
18
+
19
+ - `height:auto`:让该层长高到内容高度,高度才能回流到官方滚动层;
20
+ - `overflow:visible`:让该层不再是滚动容器。否则官方「回到底部」的槽(`EvIC1a_toBottomSlot`,`position:sticky; bottom:208px`)会以该层自己的底边为参照,按钮从 y≈514 掉到 y≈10683 而消失(这是只改 `height:auto` 时的实测副作用)。
21
+
22
+ 只动滚动层内部那一层:不新建滚动容器、不改官方其余 UI。同一版还把 `touchPassThrough()` 与 `fixClip()` 都移到 `convScrolls()` 短路**之前**——此前「官方滚动层按尺寸可滚」(正是故障场景本身)会让放行逻辑永不执行,Runbook 期望的 `touch passthrough layers=N` 也永远打不出来。
23
+
24
+ **真机验收**(同一长会话,滚到中段):可滚范围 336 → **20675**;输入框在顶部/中段/靠底/到底四处均为 `[588,780]`(吸底);官方 ↓ 按钮四处均在 `[538,572]`(与 stock 的 `[514,548]` 同区);滚到底时最后一条消息 `[540,572]` 在视口内。`?lgdiag=1` 面板输出 `clip grow layers=1 max 336->20675` → `clip released -> max=20675`。
25
+
26
+ **已排除的误判**:用户报「输入框底下还能看到滚动的文字」。按 10px 密集采样输入框那一条(586→796),stock 与修复后的最上层元素/背景/透明度**逐点完全一致**(如 y=786 两者都是透明的会话正文)⇒ 属 DSH 自带样式,非本版引入。
27
+
3
28
  ## [0.4.3] — 2026-09-28(改用 dsh-mobile 式「高度链」修正,移除自建补丁)
4
29
 
5
30
  ### 方向修正 — 不再给内容层打 overflow 补丁
package/README.md CHANGED
@@ -147,10 +147,11 @@ The plugin reads its config from its Cordis entry. **Every key has a usable defa
147
147
 
148
148
  ## Compatibility
149
149
 
150
- Current version: plugin **`0.4.0`**; mobile long-connection self-healing — the proxy answers DSH's WebSocket heartbeat, and the served page carries a socket watchdog plus mobile compatibility shims (verified on DeepSeek Harness **`0.1.7-rc.2`**).
150
+ Current version: plugin **`0.4.4`**; compensates a DSH `0.2.0-rc.1` layout regression in which an inner `overflow:hidden` layer clipped the session content, leaving the official scroller only 336px of range (verified on DeepSeek Harness **`0.2.0-rc.1`**, `0.1.7-rc.2`).
151
151
 
152
152
  | Plugin | Verified DeepSeek Harness | What this version is |
153
153
  | --- | --- | --- |
154
+ | **`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 |
154
155
  | **`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 |
155
156
  | **`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 |
156
157
  | **`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 |
package/README.zh.md CHANGED
@@ -147,10 +147,11 @@ dsh plugin --profile web add "link:$(pwd)"
147
147
 
148
148
  ## 兼容性
149
149
 
150
- 当前版本:插件 **`0.3.6`**;远程设备也能添加工作区 + 修掉让远程管理台永远锁定的代理缺陷(已在 DeepSeek Harness **`0.1.7-rc.2`** 上验证)。
150
+ 当前版本:插件 **`0.4.4`**;补偿 DSH `0.2.0-rc.1` 的一处布局回归 —— 官方滚动层内部有一层 `overflow:hidden` 且高度锁死,把会话内容裁掉,官方滚动层只拿到 336px 的可滚范围(已在 DeepSeek Harness **`0.2.0-rc.1`**、`0.1.7-rc.2` 上验证)。
151
151
 
152
152
  | 插件 | 已验证的 DeepSeek Harness | 这个版本是什么 |
153
153
  | --- | --- | --- |
154
+ | **`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;真机验收同时确认输入框仍吸底、官方「回到底部」按钮回到原位 |
154
155
  | **`0.4.0`** | **`0.1.7-rc.2`**、`0.1.7-rc.1` | 手机长连接自愈:代理代答 DSH 的 WebSocket 心跳(实测把「停回心跳 6 秒被切断」变成「20 秒以上存活」);页面补丁加入断线看门狗与移动端兼容垫片;「连接与证书」新增连接体检与代理侧计数 |
155
156
  | **`0.3.6`** | **`0.1.7-rc.2`**、`0.1.7-rc.1` | 远程也能添加工作区:浏览器侧遮蔽官方目录流程(本机仍走系统对话框,远程改用页面内目录浏览器,可在弹层内解锁);修掉代理双向丢弃插件管理 cookie 导致 `password_unlock` 对远程形同虚设;补上一直缺失的「远程设备管理权限」控件;「已保存」改为右上角提示;状态表面配色按实测重做;弹层两行被压扁重叠 |
156
157
  | **`0.3.5`** | **`0.1.7-rc.2`**、`0.1.7-rc.1` | 连接层可见性:`http://` 访问 TLS 端口由「空白页 + 无日志」改为 301 跳 `https` 并记日志;删除设备记录后旧 cookie 不再把浏览器锁死(吊销/拉黑仍拒绝);移除页文案同步修正 |
package/lib/index.js CHANGED
@@ -3214,7 +3214,7 @@ const MOBILE_SCROLL_MARKER = "/*dsh-lan-guard:mobile-scroll*/";
3214
3214
  * @returns one inline `<script>` element.
3215
3215
  */
3216
3216
  function mobileScrollFixScript() {
3217
- return `<script>${MOBILE_SCROLL_MARKER}(function(){try{var diag=/[?&]lgdiag/.test(self.location.search);var out=[];function log(s){out.push(s);if(diag)draw()}function draw(){try{var p=document.getElementById("lgsc");if(!p){p=document.createElement("pre");p.id="lgsc";p.style.cssText="position:fixed;left:0;top:0;right:0;height:46%;z-index:2147483647;background:rgba(0,0,0,.92);color:#0f0;font:10px/1.3 monospace;padding:6px;margin:0;overflow:auto;white-space:pre-wrap;pointer-events:none";(document.body||document.documentElement).appendChild(p)}p.textContent="[lan-guard 手机滚动诊断]"+String.fromCharCode(10)+out.join(String.fromCharCode(10))}catch(e){}}var touched=[];function set(el,prop,val){if(!el)return;try{el.style.setProperty(prop,val,"important");touched.push([el,prop])}catch(e){}}function undoAll(){for(var i=0;i<touched.length;i++){try{touched[i][0].style.removeProperty(touched[i][1])}catch(e){}}touched=[]}function conv(){try{return document.querySelector("[data-conversation-scroll]")}catch(e){return null}}function convScrolls(){var c=conv();return !!c&&c.scrollHeight>c.clientHeight+8}function pageScrolls(){var d=document.documentElement,b=document.body;return (d&&d.scrollHeight>d.clientHeight+8)||(b&&b.scrollHeight>b.clientHeight+8)}function clipping(){var r=[];var all=document.querySelectorAll("div");var lim=Math.min(all.length,5000);for(var i=0;i<lim;i++){var el=all[i];var cs=getComputedStyle(el);if(cs.overflowY!=="hidden"&&cs.overflowY!=="clip")continue;if(el.clientHeight<150)continue;if(el.scrollHeight<=el.clientHeight+8)continue;r.push(el)}r.sort(function(a,b){return (b.scrollHeight-b.clientHeight)-(a.scrollHeight-a.clientHeight)});return r}function overlayOpen(){try{if(document.querySelector("[aria-modal=true],[role=dialog],[data-conversation-overlay]"))return true;var el=document.elementFromPoint(Math.round(innerWidth*0.92),Math.round(innerHeight*0.45));while(el&&el!==document.body){var cs=getComputedStyle(el);if((cs.position==="fixed"||cs.position==="absolute")&&cs.pointerEvents!=="none"){var r=el.getBoundingClientRect();if(r.width>innerWidth*0.85&&r.height>innerHeight*0.7)return true}el=el.parentElement}}catch(e){}return false}function touchPassThrough(){var layers=document.querySelectorAll("div");var lim=Math.min(layers.length,5000);var n=0;for(var i=0;i<lim;i++){var el=layers[i];var cs=getComputedStyle(el);if(cs.position!=="fixed"&&cs.position!=="absolute")continue;if(cs.pointerEvents==="none")continue;var r=el.getBoundingClientRect();if(r.width<innerWidth*0.9||r.height<innerHeight*0.8)continue;if(el.querySelector("button,input,textarea,select,[contenteditable]"))continue;if((el.textContent||"").length>40)continue;el.style.setProperty("pointer-events","none","important");n++}log("touch passthrough layers="+n);return n}function fix(){if(convScrolls()){log("official scroll layer works; done");return true}var list=clipping();var clip=list[0];log("clipping="+list.length+(clip?(" first="+String(typeof clip.className==="string"?clip.className:"")+" "+clip.clientHeight+"/"+clip.scrollHeight):""));var root=document.getElementById("root");set(document.documentElement,"height","100%");set(document.body,"height","100%");set(document.body,"overflow","hidden");set(root,"height","100dvh");set(root,"min-height","0");set(root,"overflow","hidden");var n=clip,d=0;while(n&&n!==document.body&&d<8){var cs=getComputedStyle(n);if(cs.display.indexOf("flex")>=0||cs.display.indexOf("grid")>=0)set(n,"min-height","0");n=n.parentElement;d++}var ok=convScrolls();log("chainFix convScroll="+(conv()?(conv().clientHeight+"/"+conv().scrollHeight):"n/a")+" scrollable="+ok);if(!ok){undoAll();log("ineffective -> reverted (stock page)")}return ok}var done=false,tries=0;function run(){if(done)return;var narrow=self.matchMedia?self.matchMedia("(max-width: 1023px)").matches:false;var mobile=/iPhone|iPad|iPod|Android/i.test(navigator.userAgent||"");log("narrow="+narrow+" mobile="+mobile+" innerH="+innerHeight+" vv="+(self.visualViewport?self.visualViewport.height:"-")+" pageScrolls="+pageScrolls());if(!narrow||!mobile){done=true;return}if(overlayOpen()){undoAll();log("overlay/dialog open -> reverted");return}touchPassThrough();if(convScrolls()){log("official scroll layer already works");done=true;return}if(fix())done=true}run();var t=setInterval(function(){tries++;run();if(done||tries>30)clearInterval(t)},1500);}catch(e){}})()<\/script>`;
3217
+ return `<script>${MOBILE_SCROLL_MARKER}(function(){try{var diag=/[?&]lgdiag/.test(self.location.search);var out=[];function log(s){out.push(s);if(diag)draw()}function draw(){try{var p=document.getElementById("lgsc");if(!p){p=document.createElement("pre");p.id="lgsc";p.style.cssText="position:fixed;left:0;top:0;right:0;height:46%;z-index:2147483647;background:rgba(0,0,0,.92);color:#0f0;font:10px/1.3 monospace;padding:6px;margin:0;overflow:auto;white-space:pre-wrap;pointer-events:none";(document.body||document.documentElement).appendChild(p)}p.textContent="[lan-guard 手机滚动诊断]"+String.fromCharCode(10)+out.join(String.fromCharCode(10))}catch(e){}}var touched=[];function set(el,prop,val){if(!el)return;try{el.style.setProperty(prop,val,"important");touched.push([el,prop])}catch(e){}}function undoAll(){for(var i=0;i<touched.length;i++){try{touched[i][0].style.removeProperty(touched[i][1])}catch(e){}}touched=[]}function conv(){try{return document.querySelector("[data-conversation-scroll]")}catch(e){return null}}function convScrolls(){var c=conv();return !!c&&c.scrollHeight>c.clientHeight+8}function pageScrolls(){var d=document.documentElement,b=document.body;return (d&&d.scrollHeight>d.clientHeight+8)||(b&&b.scrollHeight>b.clientHeight+8)}function clipping(){var r=[];var all=document.querySelectorAll("div");var lim=Math.min(all.length,5000);for(var i=0;i<lim;i++){var el=all[i];var cs=getComputedStyle(el);if(cs.overflowY!=="hidden"&&cs.overflowY!=="clip")continue;if(el.clientHeight<150)continue;if(el.scrollHeight<=el.clientHeight+8)continue;r.push(el)}r.sort(function(a,b){return (b.scrollHeight-b.clientHeight)-(a.scrollHeight-a.clientHeight)});return r}function overlayOpen(){try{if(document.querySelector("[aria-modal=true],[role=dialog],[data-conversation-overlay]"))return true;var el=document.elementFromPoint(Math.round(innerWidth*0.92),Math.round(innerHeight*0.45));while(el&&el!==document.body){var cs=getComputedStyle(el);if((cs.position==="fixed"||cs.position==="absolute")&&cs.pointerEvents!=="none"){var r=el.getBoundingClientRect();if(r.width>innerWidth*0.85&&r.height>innerHeight*0.7)return true}el=el.parentElement}}catch(e){}return false}function touchPassThrough(){var layers=document.querySelectorAll("div");var lim=Math.min(layers.length,5000);var n=0;for(var i=0;i<lim;i++){var el=layers[i];var cs=getComputedStyle(el);if(cs.position!=="fixed"&&cs.position!=="absolute")continue;if(cs.pointerEvents==="none")continue;var r=el.getBoundingClientRect();if(r.width<innerWidth*0.9||r.height<innerHeight*0.8)continue;if(el.querySelector("button,input,textarea,select,[contenteditable]"))continue;if((el.textContent||"").length>40)continue;el.style.setProperty("pointer-events","none","important");n++}log("touch passthrough layers="+n);return n}function fixClip(){var c=conv();if(!c)return false;var list=clipping();var before=c.scrollHeight-c.clientHeight;var n=0;for(var i=0;i<list.length;i++){if(!c.contains(list[i]))continue;set(list[i],"height","auto");set(list[i],"overflow","visible");n++}if(!n)return false;var after=c.scrollHeight-c.clientHeight;log("clip grow layers="+n+" max "+before+"->"+after);if(after<=before+8){undoAll();log("clip grow ineffective -> reverted");return false}return true}function fix(){if(convScrolls()){log("official scroll layer works; done");return true}var list=clipping();var clip=list[0];log("clipping="+list.length+(clip?(" first="+String(typeof clip.className==="string"?clip.className:"")+" "+clip.clientHeight+"/"+clip.scrollHeight):""));var root=document.getElementById("root");set(document.documentElement,"height","100%");set(document.body,"height","100%");set(document.body,"overflow","hidden");set(root,"height","100dvh");set(root,"min-height","0");set(root,"overflow","hidden");var n=clip,d=0;while(n&&n!==document.body&&d<8){var cs=getComputedStyle(n);if(cs.display.indexOf("flex")>=0||cs.display.indexOf("grid")>=0)set(n,"min-height","0");n=n.parentElement;d++}var ok=convScrolls();log("chainFix convScroll="+(conv()?(conv().clientHeight+"/"+conv().scrollHeight):"n/a")+" scrollable="+ok);if(!ok){undoAll();log("ineffective -> reverted (stock page)")}return ok}var done=false,tries=0;function run(){if(done)return;var narrow=self.matchMedia?self.matchMedia("(max-width: 1023px)").matches:false;var mobile=/iPhone|iPad|iPod|Android/i.test(navigator.userAgent||"");log("narrow="+narrow+" mobile="+mobile+" innerH="+innerHeight+" vv="+(self.visualViewport?self.visualViewport.height:"-")+" pageScrolls="+pageScrolls());if(!narrow||!mobile){done=true;return}if(overlayOpen()){undoAll();log("overlay/dialog open -> reverted");return}touchPassThrough();if(fixClip()){log("clip released -> max="+(conv().scrollHeight-conv().clientHeight));done=true;return}if(convScrolls()){log("official scroll layer already works");done=true;return}if(fix())done=true}run();var t=setInterval(function(){tries++;run();if(done||tries>30)clearInterval(t)},1500);}catch(e){}})()<\/script>`;
3218
3218
  }
3219
3219
  /**
3220
3220
  * Insert the narrow-screen scroll correction.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-lan-guard",
3
- "version": "0.4.3",
3
+ "version": "0.4.4",
4
4
  "description": "DSH web plugin: expose the official desktop Web UI to the local network through a gated reverse proxy, without touching DSH's own loopback binding.",
5
5
  "license": "MIT",
6
6
  "type": "module",