dsh-session-superagent 0.9.279 → 0.9.280

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,33 @@
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.9.280] - 2026-11-06 —— 深层 UI 验收与高级区可访问性
6
+
7
+ ### 高级区 aria 关联
8
+
9
+ WatcherForm 高级区 trigger 现在有 `aria-controls=idPrefix-advanced-body`,展开 body 使用同 id。
10
+ 新增与编辑同页 id 不冲突,Enter/Space、摘要与草稿行为不变。
11
+ 新增用例修复前 25/26,修复后定向 128/128。
12
+
13
+ ### Tooltip 键盘回焦
14
+
15
+ 修复纯键盘 focus 打开 Tooltip 后,scroll remount 回焦让新实例立即重开的问题。
16
+ 仅在同步 `focus({preventScroll:true})` 窗口传官方 `disabled=true`,finally 立即恢复 false。
17
+ 独立模块真实键盘路径 **27/27**;client 内联镜像已同步同一逻辑,主线深层验收 **47/47**。
18
+
19
+ ### 深层真实验收
20
+
21
+ 完整 Chromium 新增 12 项:高级区展开/收起、aria 关联、5 面优先级 Switch、鼠标/Space、Tab 顺序、草稿恢复、InfoTip hover/Escape 与真实 scroll 关闭。
22
+ 最终 **47 PASS / 0 FAIL**,mutation=0,防写探针 403。截图通道问题单列 SKIP。
23
+
24
+ ### 计数
25
+
26
+ - 全量 **613/613**
27
+ - UI 体检 **11/11=100**
28
+ - 同源审计 84 项,0 漂移
29
+
30
+ 未验真实 DSH Web GUI 与真实 watcher 写操作。按 Git 工作流保留本地候选。
31
+
5
32
  ## [0.9.279] - 2026-11-06 —— 官方 Input 与 Switch 全覆盖
6
33
 
7
34
  ### 单行输入
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  <img src="assets/icon-180.png" width="88" height="88" alt="">
4
4
 
5
5
  [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
6
- [![Version](https://img.shields.io/badge/version-0.9.279-green.svg)](https://github.com/MYCF711/dsh-session-superagent/releases)
6
+ [![Version](https://img.shields.io/badge/version-0.9.280-green.svg)](https://github.com/MYCF711/dsh-session-superagent/releases)
7
7
  [![npm](https://img.shields.io/npm/v/dsh-session-superagent.svg)](https://www.npmjs.com/package/dsh-session-superagent)
8
8
  [![dsh](https://img.shields.io/badge/DeepSeek%20Harness-plugin-orange.svg)](https://github.com/topics/dsh-plugin)
9
9
  [![awesome](https://img.shields.io/badge/awesome-dsh--plugin-%E2%9C%93-success.svg)](https://github.com/awesome-dsh-plugin/awesome-dsh-plugin)
@@ -148,7 +148,7 @@ Gitee 私有仓库要在「设置 → 凭证」填私人令牌;公开仓库不
148
148
  ## 开发
149
149
 
150
150
  ```sh
151
- npm test # 612 项单测(带离线开关;裸 node --test 会真去 spawn gh,两分半)
151
+ npm test # 613 项单测(带离线开关;裸 node --test 会真去 spawn gh,两分半)
152
152
  ```
153
153
 
154
154
  ### 工具输出:文本给人和 agent,JSON 给程序
@@ -208,7 +208,7 @@ dsh plugin --profile <profile> add dsh-session-superagent@latest
208
208
 
209
209
 
210
210
  ```bash
211
- npm test # 612 项单测(带离线开关,约 1.6 秒)
211
+ npm test # 613 项单测(带离线开关,约 1.6 秒)
212
212
  node scripts/ui-audit.mjs # 11 项 UI 指标(写死颜色 / 自造 token / 官方结构采用 …)
213
213
  node scripts/preflight.mjs # 41 项门禁(含上面两条,外加 profile 一致性、路由面、包内容)
214
214
  node scripts/render-preview.mjs preview.html # 双主题静态预览,直接浏览器打开
package/client.js CHANGED
@@ -76,6 +76,7 @@ window.__ModuleLoader__.load({
76
76
  const TooltipPrimitive = primitive('Tooltip')
77
77
  if (!TooltipTrigger) throw new Error('DSH Tooltip 需要宿主 React.forwardRef')
78
78
  const [remountKey, setRemountKey] = HostReact.useState(0)
79
+ const [scrollFocusSuppressed, setScrollFocusSuppressed] = HostReact.useState(false)
79
80
  const triggerNodeRef = HostReact.useRef(null)
80
81
  const restoreFocusRef = HostReact.useRef(false)
81
82
  HostReact.useEffect(() => {
@@ -89,6 +90,7 @@ window.__ModuleLoader__.load({
89
90
  || (typeof triggerNode.contains === 'function' && triggerNode.contains(activeElement))
90
91
  ))
91
92
  setRemountKey((current) => current + 1)
93
+ setScrollFocusSuppressed(restoreFocusRef.current)
92
94
  }
93
95
  // Tooltip 没有受控 open API;capture 覆盖主面板及任意嵌套滚动容器。
94
96
  window.addEventListener('scroll', closeOnScroll, true)
@@ -98,10 +100,14 @@ window.__ModuleLoader__.load({
98
100
  if (!restoreFocusRef.current) return undefined
99
101
  restoreFocusRef.current = false
100
102
  const triggerNode = triggerNodeRef.current
101
- if (triggerNode && typeof triggerNode.focus === 'function'
102
- && (!('isConnected' in triggerNode) || triggerNode.isConnected)) {
103
- // 防止焦点归还再次滚动容器,形成 scroll -> remount 循环。
104
- triggerNode.focus({ preventScroll: true })
103
+ try {
104
+ if (triggerNode && typeof triggerNode.focus === 'function'
105
+ && (!('isConnected' in triggerNode) || triggerNode.isConnected)) {
106
+ // disabled 只覆盖这次同步回焦,避免 focus 让新 Tooltip 立即重开。
107
+ triggerNode.focus({ preventScroll: true })
108
+ }
109
+ } finally {
110
+ setScrollFocusSuppressed(false)
105
111
  }
106
112
  return undefined
107
113
  }, [remountKey])
@@ -111,6 +117,7 @@ window.__ModuleLoader__.load({
111
117
  side: 'top',
112
118
  portal: true,
113
119
  openOnClick: true,
120
+ disabled: scrollFocusSuppressed,
114
121
  gap: 8,
115
122
  }, hostH(TooltipTrigger, { text, icon, warn, triggerRef: triggerNodeRef }))
116
123
  }
@@ -396,7 +403,7 @@ window.__ModuleLoader__.load({
396
403
  }
397
404
 
398
405
  // 客户端版本探针:每次模块加载写一次,用来确认浏览器里跑的是哪一版
399
- const CLIENT_VERSION = '0.9.279'
406
+ const CLIENT_VERSION = '0.9.280'
400
407
  // SEMVER_COMPARATOR_SOURCE_START
401
408
  // This block is duplicated verbatim in client.js because the browser UMD cannot import ESM.
402
409
  // test/update-semver.test.mjs audits both copies and exercises their behavior.
@@ -892,10 +899,12 @@ window.__ModuleLoader__.load({
892
899
  }
893
900
 
894
901
  /** 官方 DisclosureRow:折叠行的标准写法(Enter / 空格可切换,带 aria-expanded)。 */
895
- function DisclosureRow({ icon, title, open, onToggle, collapsedContent, children }) {
902
+ function DisclosureRow({ icon, title, open, onToggle, collapsedContent, bodyId, children }) {
903
+ const content = Array.isArray(children) && children.length === 1 ? children[0] : children
896
904
  return h('div', { className: 'dt-disclosure', 'data-open': open ? 'true' : undefined },
897
905
  h('div', {
898
906
  className: 'dt-disclosure-row', role: 'button', tabIndex: 0, 'aria-expanded': !!open,
907
+ 'aria-controls': bodyId,
899
908
  onClick: onToggle,
900
909
  onKeyDown: (event) => {
901
910
  if (event.key === 'Enter' || event.key === ' ') { event.preventDefault(); onToggle() }
@@ -906,7 +915,13 @@ window.__ModuleLoader__.load({
906
915
  h('span', { className: 'dt-disclosure-chevron' }, h(Icon, { name: open ? 'chevron-up' : 'chevron-down' }))),
907
916
  h('span', { className: 'dt-disclosure-title' }, title),
908
917
  !open ? collapsedContent : null),
909
- open ? children : null)
918
+ open
919
+ ? bodyId
920
+ ? content && typeof content === 'object' && !Array.isArray(content)
921
+ ? { ...content, props: { ...(content.props || {}), id: bodyId } }
922
+ : h('div', { id: bodyId }, content)
923
+ : children
924
+ : null)
910
925
  }
911
926
 
912
927
  /** 无 DSH Tooltip 时完整保留原实现:原 trigger、点击/失焦与本地气泡都不改写。 */
@@ -1168,7 +1183,7 @@ window.__ModuleLoader__.load({
1168
1183
  h(DisclosureRow, {
1169
1184
  icon: h(Icon, { name: 'settings' }), title: '高级设置', open: advancedOpen,
1170
1185
  onToggle: () => { if (!busy && !disabled) setAdvancedOpen(!advancedOpen) },
1171
- collapsedContent: collapsedAdvanced,
1186
+ collapsedContent: collapsedAdvanced, bodyId: idPrefix + '-advanced-body',
1172
1187
  }, h('div', { className: 'dt-disclosure-body' }, advanced))),
1173
1188
  h(SaveBar, { dirty, busy, error, disabled, onDiscard: discard, onSave: submitFromClick, saveLabel: submitLabel }),
1174
1189
  // 新建空白表单也要给入口;开始输入后由 SaveBar 接管,不在屏幕上重复两个提交按钮。
package/lib/index.js CHANGED
@@ -49,7 +49,7 @@ import {
49
49
 
50
50
  export const name = 'dsh-session-superagent'
51
51
  /** 服务端版本:随 package.json 同步(meta 测试守着)。客户端据此挑「最新的那个实例」。 */
52
- export const SERVER_VERSION = '0.9.279'
52
+ export const SERVER_VERSION = '0.9.280'
53
53
  export const inject = ['tools', 'agents', 'webServer']
54
54
  /** 一条会话每小时最多被唤醒几次(跨所有守累计)。单守上限挡不住多守叠加。 */
55
55
  // 本进程启动时刻:用来区分「刚重启还没轮到」与「定时器真的丢了」
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-session-superagent",
3
- "version": "0.9.279",
3
+ "version": "0.9.280",
4
4
  "description": "Session-level superagent for DeepSeek Harness: watch a GitHub repository and wake a session when something needs doing. Credentials never reach the model.",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -75,6 +75,7 @@ export function createHostUi({ React, primitives } = {}) {
75
75
  throw new TypeError('Tooltip 需要宿主 React.cloneElement 以合并 trigger ref')
76
76
  }
77
77
  const [remountKey, setRemountKey] = React.useState(0)
78
+ const [scrollFocusSuppressed, setScrollFocusSuppressed] = React.useState(false)
78
79
  const triggerNodeRef = React.useRef(null)
79
80
  const restoreFocusRef = React.useRef(false)
80
81
  React.useEffect(() => {
@@ -89,6 +90,7 @@ export function createHostUi({ React, primitives } = {}) {
89
90
  || (typeof triggerNode.contains === 'function' && triggerNode.contains(activeElement))
90
91
  ))
91
92
  setRemountKey((current) => current + 1)
93
+ setScrollFocusSuppressed(restoreFocusRef.current)
92
94
  }
93
95
  // DSH Tooltip 没有受控 open 或 scroll listener;capture 可同时覆盖嵌套滚动容器。
94
96
  target.addEventListener('scroll', closeOnScroll, true)
@@ -116,10 +118,16 @@ export function createHostUi({ React, primitives } = {}) {
116
118
  // 标记只消费一次;即使新 ref 缺失,也不能在后续无关渲染中抢焦点。
117
119
  restoreFocusRef.current = false
118
120
  const triggerNode = triggerNodeRef.current
119
- if (triggerNode && typeof triggerNode.focus === 'function'
120
- && (!('isConnected' in triggerNode) || triggerNode.isConnected)) {
121
- // 避免焦点归还自身再次滚动容器,形成 scroll -> remount 循环。
122
- triggerNode.focus({ preventScroll: true })
121
+ try {
122
+ if (triggerNode && typeof triggerNode.focus === 'function'
123
+ && (!('isConnected' in triggerNode) || triggerNode.isConnected)) {
124
+ // 官方 disabled 会清 open/pinned,并让 focus 打开路径早退;只覆盖这次同步回焦,避免立即重开。
125
+ // preventScroll 同时避免焦点归还自身再次滚动容器,形成 scroll -> remount 循环。
126
+ triggerNode.focus({ preventScroll: true })
127
+ }
128
+ } finally {
129
+ // focus 返回立即恢复官方 hover/focus/click;不改变 key,也不再 detach/attach trigger。
130
+ setScrollFocusSuppressed(false)
123
131
  }
124
132
  return undefined
125
133
  }, [remountKey])
@@ -130,6 +138,7 @@ export function createHostUi({ React, primitives } = {}) {
130
138
  side: 'top',
131
139
  portal: true,
132
140
  openOnClick: true,
141
+ disabled: scrollFocusSuppressed,
133
142
  gap: 8,
134
143
  }, React.cloneElement(trigger, { ref: setTriggerRef }))
135
144
  }