@qzsy/dsh-bridge 3.5.0 → 3.5.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,18 @@
1
1
  # 更新日志
2
2
 
3
+ ## [v3.5.1] - 2026-11-02
4
+
5
+ ### 🐛 修复
6
+
7
+ - **选当前模型也能继续**:选中项与当前模型相同时,宿主不一定会关闭模型菜单;现在会先按 Esc / 外部点击收起旧菜单,再打开父级并进入「推理等级」,不会卡在半路。
8
+ - **父菜单点击时序**:等父 popover 进入动画和事件绑定完成后再点「推理等级」,避免点得太早导致推理 sheet 不出现。
9
+ - **过渡期宿主菜单改为透明隐藏**:不再用 `visibility:hidden`,避免宿主按钮虽然可见性隐藏却无法被程序化点击;推理 sheet 出现后立即恢复。
10
+
11
+ ### 🧪 验证
12
+
13
+ - 独立宿主模拟:模型 sheet → 选模型 → 推理 sheet → 选等级关闭,4/4;待安装后跑真实 DSH。
14
+
15
+
3
16
  ## [v3.5.0] - 2026-11-02
4
17
 
5
18
  ### ✨ 新增
package/client/client.js CHANGED
@@ -469,7 +469,7 @@ var MOBILE_DRAWER_CSS = `
469
469
  pointer-events: none !important;
470
470
  }
471
471
  body.qzsy-model-advancing div[id$="-menu"]:not([data-qzsy-model-sheet]):not([data-qzsy-model-sheet-clone]) {
472
- visibility: hidden !important;
472
+ opacity: 0 !important;
473
473
  pointer-events: none !important;
474
474
  }
475
475
  body.qzsy-model-sheet-dragging [data-qzsy-model-sheet] {
@@ -930,41 +930,53 @@ function setupMobileDrawer() {
930
930
  document.body.appendChild(modelClone);
931
931
  window.setTimeout(() => {
932
932
  if (disposed || token !== modelAdvanceToken || !modelAdvancing) return;
933
- const trigger = document.querySelector(
934
- 'button[aria-haspopup="menu"][aria-label*="\u9009\u62E9\u6A21\u578B"], button[aria-haspopup="menu"][aria-label*="Select model"], button[aria-haspopup="menu"][aria-label*="\u6A21\u578B"]'
935
- );
936
- try {
937
- trigger?.click();
938
- } catch {
933
+ if (modelPortal && visiblePortal(modelPortal)) {
934
+ try {
935
+ dismissHostMenus();
936
+ } catch {
937
+ }
938
+ window.setTimeout(() => openParentAndReason(), 100);
939
+ return;
939
940
  }
940
- let attempts = 0;
941
- const openReasonCell = () => {
941
+ openParentAndReason();
942
+ function openParentAndReason() {
942
943
  if (disposed || token !== modelAdvanceToken || !modelAdvancing) return;
943
- const cell = [...document.querySelectorAll('button[role="menuitem"]')].find((b) => /推理等级|Reasoning effort|Reasoning level|推理强度/i.test(b.innerText || ""));
944
- if (cell) {
945
- reasoningStep = true;
946
- try {
947
- cell.click();
948
- } catch {
949
- }
950
- window.setTimeout(() => {
951
- if (disposed || token !== modelAdvanceToken) return;
952
- if (!modelPortal) {
953
- cancelAdvanceOverlay();
954
- clearModelSheet();
955
- }
956
- }, 900);
957
- return;
958
- }
959
- attempts += 1;
960
- if (attempts > 16) {
961
- cancelAdvanceOverlay();
962
- clearModelSheet();
963
- return;
944
+ const trigger = document.querySelector(
945
+ 'button[aria-haspopup="menu"][aria-label*="\u9009\u62E9\u6A21\u578B"], button[aria-haspopup="menu"][aria-label*="Select model"], button[aria-haspopup="menu"][aria-label*="\u6A21\u578B"]'
946
+ );
947
+ try {
948
+ trigger?.click();
949
+ } catch {
964
950
  }
965
- window.setTimeout(openReasonCell, 60);
966
- };
967
- window.setTimeout(openReasonCell, 120);
951
+ let attempts = 0;
952
+ const openReasonCell = () => {
953
+ if (disposed || token !== modelAdvanceToken || !modelAdvancing) return;
954
+ const cell = [...document.querySelectorAll('button[role="menuitem"]')].find((b) => /推理等级|Reasoning effort|Reasoning level|推理强度/i.test(b.innerText || ""));
955
+ if (cell) {
956
+ reasoningStep = true;
957
+ try {
958
+ cell.click();
959
+ } catch {
960
+ }
961
+ window.setTimeout(() => {
962
+ if (disposed || token !== modelAdvanceToken) return;
963
+ if (!modelPortal) {
964
+ cancelAdvanceOverlay();
965
+ clearModelSheet();
966
+ }
967
+ }, 1200);
968
+ return;
969
+ }
970
+ attempts += 1;
971
+ if (attempts > 20) {
972
+ cancelAdvanceOverlay();
973
+ clearModelSheet();
974
+ return;
975
+ }
976
+ window.setTimeout(openReasonCell, 60);
977
+ };
978
+ window.setTimeout(openReasonCell, 300);
979
+ }
968
980
  }, 140);
969
981
  };
970
982
  const syncModelSheet = () => {
package/client/mobile.js CHANGED
@@ -266,7 +266,7 @@ export const MOBILE_DRAWER_CSS = `
266
266
  pointer-events: none !important;
267
267
  }
268
268
  body.qzsy-model-advancing div[id$="-menu"]:not([data-qzsy-model-sheet]):not([data-qzsy-model-sheet-clone]) {
269
- visibility: hidden !important;
269
+ opacity: 0 !important;
270
270
  pointer-events: none !important;
271
271
  }
272
272
  body.qzsy-model-sheet-dragging [data-qzsy-model-sheet] {
@@ -756,36 +756,48 @@ export function setupMobileDrawer() {
756
756
 
757
757
  window.setTimeout(() => {
758
758
  if (disposed || token !== modelAdvanceToken || !modelAdvancing) return;
759
- const trigger = document.querySelector(
760
- 'button[aria-haspopup="menu"][aria-label*="选择模型"], button[aria-haspopup="menu"][aria-label*="Select model"], button[aria-haspopup="menu"][aria-label*="模型"]',
761
- );
762
- try { trigger?.click(); } catch { /* 忽略 */ }
763
- let attempts = 0;
764
- const openReasonCell = () => {
759
+ // 选中的是当前模型时宿主可能不关菜单,先按 Esc/外部点击收掉
760
+ if (modelPortal && visiblePortal(modelPortal)) {
761
+ try { dismissHostMenus(); } catch { /* 忽略 */ }
762
+ window.setTimeout(() => openParentAndReason(), 100);
763
+ return;
764
+ }
765
+ openParentAndReason();
766
+
767
+ function openParentAndReason() {
765
768
  if (disposed || token !== modelAdvanceToken || !modelAdvancing) return;
766
- const cell = [...document.querySelectorAll('button[role="menuitem"]')].find((b) => /推理等级|Reasoning effort|Reasoning level|推理强度/i.test(b.innerText || ''));
767
- if (cell) {
768
- reasoningStep = true;
769
- try { cell.click(); } catch { /* 忽略 */ }
770
- window.setTimeout(() => {
771
- if (disposed || token !== modelAdvanceToken) return;
772
- if (!modelPortal) {
773
- // 推理菜单没出现:撤掉 overlay,避免卡在半路
774
- cancelAdvanceOverlay();
775
- clearModelSheet();
776
- }
777
- }, 900);
778
- return;
779
- }
780
- attempts += 1;
781
- if (attempts > 16) {
782
- cancelAdvanceOverlay();
783
- clearModelSheet();
784
- return;
785
- }
786
- window.setTimeout(openReasonCell, 60);
787
- };
788
- window.setTimeout(openReasonCell, 120);
769
+ const trigger = document.querySelector(
770
+ 'button[aria-haspopup="menu"][aria-label*="选择模型"], button[aria-haspopup="menu"][aria-label*="Select model"], button[aria-haspopup="menu"][aria-label*="模型"]',
771
+ );
772
+ try { trigger?.click(); } catch { /* 忽略 */ }
773
+ let attempts = 0;
774
+ const openReasonCell = () => {
775
+ if (disposed || token !== modelAdvanceToken || !modelAdvancing) return;
776
+ const cell = [...document.querySelectorAll('button[role="menuitem"]')].find((b) => /推理等级|Reasoning effort|Reasoning level|推理强度/i.test(b.innerText || ''));
777
+ if (cell) {
778
+ reasoningStep = true;
779
+ try { cell.click(); } catch { /* 忽略 */ }
780
+ window.setTimeout(() => {
781
+ if (disposed || token !== modelAdvanceToken) return;
782
+ if (!modelPortal) {
783
+ // 推理菜单没出现:撤掉 overlay,避免卡在半路
784
+ cancelAdvanceOverlay();
785
+ clearModelSheet();
786
+ }
787
+ }, 1200);
788
+ return;
789
+ }
790
+ attempts += 1;
791
+ if (attempts > 20) {
792
+ cancelAdvanceOverlay();
793
+ clearModelSheet();
794
+ return;
795
+ }
796
+ window.setTimeout(openReasonCell, 60);
797
+ };
798
+ // 等父菜单的进入动画/事件绑定完成再点「推理等级」
799
+ window.setTimeout(openReasonCell, 300);
800
+ }
789
801
  }, 140);
790
802
  };
791
803
 
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@qzsy/dsh-bridge",
3
- "version": "3.5.0",
3
+ "version": "3.5.1",
4
4
  "description": "DSH 远程隧道云官方客户端插件:一条命令把本机 DeepSeek Harness 接入云端隧道(设备码绑定、短期令牌、本地门禁代理、HTTP/SSE/WebSocket 反向隧道)。",
5
- "releaseNotes": "【v3.5.0】模型 → 思考级别连招\\n• 选完模型自动进入推理等级 sheet(Off / Low / High / Max),选完才关闭\\n• 旧 sheet 快照过渡,宿主菜单在背后切换,不闪桌面 popover\\n• 模型和推理等级仍由宿主选择;桌面端不变",
5
+ "releaseNotes": "【v3.5.1】模型 → 思考级别连招修复\\n• 选中当前模型时先收起旧菜单,再进入推理等级,不再卡住\\n• 等父菜单动画/事件就绪后再点推理等级,避免 sheet 不出现\\n• 过渡期宿主菜单改透明隐藏,程序化点击可靠",
6
6
  "type": "module",
7
7
  "main": "lib/index.js",
8
8
  "exports": {