dsh-mobile-plugin 0.5.128 → 0.5.129

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/lib/client.js CHANGED
@@ -2,6 +2,7 @@
2
2
  // 2026-11-24:两种诊断页都把「完整重启 DSH」摆第一条;打开失败的那一屏补上版本/来源/激活时间/shellChanged。
3
3
  // 2026-11-24:就地反馈附件补 plugin_source / activated_at / shell_changed,便于判断装完没重启。
4
4
  // 2026-11-25:会话状态在 DSH 0.2.3 拆成独立服务,绿点同步改为同时兼容独立服务与普通属性两种宿主。
5
+ // 2026-11-27:保活的那扇弹窗收起时摘掉 role / aria-modal,免得官方快捷键一直以为有模态框挡着。
5
6
  /**
6
7
  * 移动端插件提供电脑插件页面目录;标准页面保留宿主上下文并支持直接导航。
7
8
  * 聊天嵌入服务合并顶部栏显示声明,随提供方与消费方生命周期释放。
@@ -934,6 +935,20 @@ window.__ModuleLoader__.load({
934
935
  }
935
936
  try { if (prev.focus && typeof prev.focus.focus === 'function') prev.focus.focus(); } catch { /* ignore */ }
936
937
  };
938
+ /**
939
+ * 挂上/摘掉「这是一扇模态框」的两样身份。官方快捷键系统只按这两个属性找弹窗
940
+ * (**不看它可不可见**),藏起来的那一窗要是留着它们,就会被当成一直挡在前面。
941
+ */
942
+ const markModal = (on) => {
943
+ if (!overlay) return;
944
+ if (on) {
945
+ overlay.setAttribute('role', 'dialog');
946
+ overlay.setAttribute('aria-modal', 'true');
947
+ } else if (typeof overlay.removeAttribute === 'function') {
948
+ overlay.removeAttribute('role');
949
+ overlay.removeAttribute('aria-modal');
950
+ }
951
+ };
937
952
  const hide = () => {
938
953
  releaseChrome();
939
954
  // 只有已确认就绪的页面保活;加载中或失败的页面,下次打开必须重新请求。
@@ -945,6 +960,8 @@ window.__ModuleLoader__.load({
945
960
  // 让它自己把轮询停掉 —— 否则「关掉窗口就恢复正常」这条就不成立了。
946
961
  if (overlay && overlay.__dshmKeep) {
947
962
  if (typeof overlay.style === 'object') overlay.style.display = 'none';
963
+ // 收起来的窗要摘掉身份:它不是「在场的模态框」,只是留在 DOM 里等下次复用。
964
+ markModal(false);
948
965
  tellFrame(overlay, false);
949
966
  // 说明那一行**不清**:下次复用这一窗时还要往上写一句「已复制」之类。
950
967
  } else if (overlay) {
@@ -974,6 +991,7 @@ window.__ModuleLoader__.load({
974
991
  if (overlay && overlay.__dshmKeep && overlay.__dshmSrc === frameSrc
975
992
  && overlay.__dshmFrameState === 'ready') {
976
993
  if (typeof overlay.style === 'object') overlay.style.display = '';
994
+ markModal(true);
977
995
  if (spec.title) overlay.setAttribute('aria-label', spec.title);
978
996
  tellFrame(overlay, true);
979
997
  // 底下那句说明仍然按这一轮重置(`noteEl` 是上一轮那个节点,还挂着)。
@@ -990,8 +1008,7 @@ window.__ModuleLoader__.load({
990
1008
  if (!overlay) {
991
1009
  overlay = make('div', 'dshm_overlay');
992
1010
  overlay.setAttribute(DIAG_MARK, '');
993
- overlay.setAttribute('role', 'dialog');
994
- overlay.setAttribute('aria-modal', 'true');
1011
+ markModal(true);
995
1012
  // 点遮罩收起;卡片内部的点击不冒到遮罩上(免得点按钮被当成「点外面」)。
996
1013
  overlay.addEventListener('click', (event) => {
997
1014
  if (event && event.target === overlay) hide();
@@ -1007,6 +1024,8 @@ window.__ModuleLoader__.load({
1007
1024
  // 复用一个**已收起**(keep 且被 `hide` 设成 display:none)的窗时,必须显式把 display 复位。
1008
1025
  // 否则从控制台窗切到诊断窗会落进同一个 overlay、整窗仍是隐藏的 —— 点了没反应。
1009
1026
  if (typeof overlay.style === 'object') overlay.style.display = '';
1027
+ // 身份在收起时摘掉了(见 `hide`),亮出来之前挂回去。
1028
+ markModal(true);
1010
1029
  if (spec.title) overlay.setAttribute('aria-label', spec.title);
1011
1030
  // 「这一窗收起时不销毁」的记号(见 `hide`)。只有带整页 iframe 的那一窗需要它:
1012
1031
  // 那一页重建一次要重新解析一整份产物,而诊断窗那几行读数是现拼的,重建几乎不要钱。
package/lib/impl.js CHANGED
@@ -1,3 +1,4 @@
1
+ // 2026-11-27:线路级问题码搬进 relay/ingress-guard.cjs,装配层只交现状、不再写判断。
1
2
  // 2026-11-26:零讯旧隧道落点端口失效时接线层清掉地址,通知 Cloudflare 兜底重新判定顶上。
2
3
  // 2026-11-25:三条线路的本地端口接上回环入口判据;自检结论记入 ingress-guard,状态带出绕开与兜底原因。
3
4
  // 热重载跨代:隧道助手/点对点的父地址取值器改为挂载时缓存,回滚或半装载后不再现读失效 ctx.webServer。
@@ -529,21 +530,21 @@ function apply(ctx) {
529
530
  // 总控上报当前状态(地址、令牌、连没连上):手机据此知道该不该、能不能去总控查。
530
531
  getControl: () => control.snapshot(),
531
532
  getLanPortLock: portLock,
532
- // 面板 / 手机读到的入口全景:实绑入口、是否被绕开、冲突类型与兜底原因码。
533
+ // 面板 / 手机读到的入口全景:实绑入口、是否被绕开、冲突类型、兜底原因码与线路级问题。
534
+ // routeIssue 与 fallbackReason 分开:后者说「兜底也顶不上、要用户接着处理」,前者只说
535
+ // 「这条线路自己落点不对」——兜底已经顶上时也要让用户看见旧隧道该去哪改。判据在 ingress-guard。
533
536
  getIngressView: () => {
534
537
  const signals = ingressSignals()
535
- return {
536
- ingressPort: ingressGuard.ingressPortOf(state),
537
- bypassing: signals.needsBypass,
538
- conflict: signals.conflict,
539
- fallbackReason: ingressGuard.fallbackReasonOf({
540
- signals, hasUsableRoute: hasUsableRoute(),
541
- cloudflareAvailable: cloudflare.status().available === true,
542
- portLocked: Boolean(portLock()),
543
- externalTarget: portLock() === 'forwarding',
544
- provider: state.zeroNewsUrl ? 'zeronews' : '', hasLegacyTunnel: Boolean(state.zeroNewsUrl),
545
- }),
546
- }
538
+ const ingressPort = ingressGuard.ingressPortOf(state)
539
+ const { fallbackReason, routeIssue } = ingressGuard.routeIssueOf({
540
+ signals, ingressPort, hasUsableRoute: hasUsableRoute(),
541
+ cloudflareAvailable: cloudflare.status().available === true,
542
+ portLocked: Boolean(portLock()), externalTarget: portLock() === 'forwarding',
543
+ provider: state.zeroNewsUrl ? 'zeronews' : '', hasLegacyTunnel: Boolean(state.zeroNewsUrl),
544
+ legacyTunnelPort: tunnelPortFor('zeronews'),
545
+ })
546
+ return { ingressPort, bypassing: signals.needsBypass, conflict: signals.conflict,
547
+ fallbackReason, routeIssue }
547
548
  },
548
549
  })
549
550
  function applyServices() {