dsh-config-sync-plugin 0.3.78 → 0.3.81

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/README.en.md CHANGED
@@ -19,7 +19,7 @@ The package name is **`dsh-config-sync-plugin`** (the `dsh-config-sync` name on
19
19
 
20
20
  | Way | Command / entry | Notes |
21
21
  |---|---|---|
22
- | npm | `npm i dsh-config-sync-plugin` | Use it as a dependency, or add `"dsh-config-sync-plugin": "^0.3.78"` to the profile's `package.json` and run `pnpm i`. The name matches the `cordis.patch.yml` insert name and the install folder `dsh-config-sync-plugin-<ver>` |
22
+ | npm | `npm i dsh-config-sync-plugin` | Use it as a dependency, or add `"dsh-config-sync-plugin": "^0.3.81"` to the profile's `package.json` and run `pnpm i`. The name matches the `cordis.patch.yml` insert name and the install folder `dsh-config-sync-plugin-<ver>` |
23
23
  | Marketplace | client → Plugins → Discover → “Config Sync” | Installs from the git commit registered in `market-index.json` |
24
24
  | Offline tgz | `releases\dsh-config-sync-plugin-<ver>.tgz` | GitHub Release asset for air-gapped machines; the panel's Update button downloads the same file |
25
25
 
@@ -253,6 +253,35 @@ Two display fixes on top of 0.3.77:
253
253
  1. **Jump order matches section order**: the quick-jump tabs now follow the exact render order of the sections (Overview / Sync conflicts [when present] / Local paths [when expanded] / Targets / Automation & updates / Scripts / Restore / Content / Plugin data / Workspace visibility / Feedback). The two conditional sections (conflicts, local paths) appear in the tabs only when their cards are shown.
254
254
  2. **Scroll lands below the title**: the sticky title bar now uses an opaque background (same fill as panel cards), so content no longer shows through it; jumping to a tab sets the scroll offset from the title bar's actual height, so the target section lands fully below the title instead of being covered.
255
255
 
256
+ ### Workspace visibility card session names now match the DSH panel (0.3.81)
257
+
258
+ Fixes session names in the "Workspace visibility" card differing from the DSH session panel.
259
+
260
+ DSH session titles evolve: a fallback title (truncated first message) is created first, then a provider title is generated by the model. The card previously stopped at the first fallback; it now picks the latest title by priority — provider > fallback > untagged title > first user message — matching the DSH panel exactly.
261
+ ### Fix cross-machine sync downgrading the installed plugin and rolling back pulls (0.3.80)
262
+
263
+ Fixes an issue where pulling on another machine replaced a newer locally installed plugin with an older archive from the config repo, turning the link into 0.0.0, failing bundle resolution, and rolling the pull back.
264
+
265
+ | Problem | Fix |
266
+ |---|---|
267
+ | An older archive was still deployed because versions merely differed | Version comparison is now semantic upgrade-only: the archive is deployed only when its version is higher than the installed one |
268
+ | Archive top-level folder mismatched the file name (e.g. a 0.3.70 package wrapping a 0.3.56 folder), producing nested folders and a broken link | capture now validates the archive top-level folder and version after packing; bad archives are deleted with a warning instead of being synced |
269
+ | Stale plugin keys caused repeated plugin-missing notices | Removed invalid legacy keys from localPluginMap and cleared stale notices |
270
+
271
+ The corrupted archive in the config repo was also repacked with correct 0.3.79 content.
272
+
273
+ ### The panel is now a fixed header plus an independently scrolling body (0.3.79)
274
+
275
+ 0.3.78 still kept the sticky header inside the same scroll container, so two cases leaked through: with a shorter panel, or with a header that wraps onto more lines, content brushed past the header's divider and even showed up in the padding above it; and the jump offset was computed from the header height, so it shifted whenever conditional sections appeared or disappeared.
276
+
277
+ 0.3.79 splits the panel in two: the header (title, badges, meta line and section tabs) now sits **outside** the scroll area, pinned at the top of the panel; below it a separate `overflow-y:auto` region holds the notices and every section card. Three direct results:
278
+
279
+ 1. **Structurally impossible to leak through**: the scrolling region starts 20px under the header divider, so however far you scroll, content stays inside it — never in the header area or above it.
280
+ 2. **Jump targets are fixed**: a section tab now just scrolls to the top of the scrolling region plus 8px, with no header-height math, so header wrapping and conditional sections no longer move the landing point.
281
+ 3. **No more header jitter**: the header does not scroll at all, so the shadow, translucent background and padding patches are gone; a single divider line is all that is left.
282
+
283
+ The change touches only the panel itself (`S.page` / `pageInner` are used nowhere else); the sidebar row and the settings summary row are unaffected.
284
+
256
285
 
257
286
  ## New sessions land in the default workspace (since 0.3.28)
258
287
 
package/README.md CHANGED
@@ -15,7 +15,7 @@ DSH 插件:左侧栏多一行「配置同步」,点开是整页体检面板
15
15
 
16
16
  | 方式 | 命令 / 入口 | 说明 |
17
17
  |---|---|---|
18
- | npm | `npm i dsh-config-sync-plugin` | 适合把它当依赖管理,或在 profile 的 `package.json` 里写 `"dsh-config-sync-plugin": "^0.3.78"` 后 `pnpm i`;包名与 `cordis.patch.yml` 里注册的名字、插件目录 `dsh-config-sync-plugin-<ver>` 一致 |
18
+ | npm | `npm i dsh-config-sync-plugin` | 适合把它当依赖管理,或在 profile 的 `package.json` 里写 `"dsh-config-sync-plugin": "^0.3.81"` 后 `pnpm i`;包名与 `cordis.patch.yml` 里注册的名字、插件目录 `dsh-config-sync-plugin-<ver>` 一致 |
19
19
  | 插件市场 | 客户端「插件市场 → 发现」搜「配置同步」 | 走 `market-index.json` 登记的 git 提交,版本与 README 对齐 |
20
20
  | 离线 tgz | `releases\dsh-config-sync-plugin-<ver>.tgz` | GitHub Release 附件,适合内网机器;面板「更新」按钮下载的也是它 |
21
21
 
@@ -273,6 +273,35 @@ pwsh -File runtime\sync.ps1 pull `
273
273
  1. **跳转顺序对齐卡片**:快捷标签顺序改为与分区实际渲染顺序完全一致(概览 / 同步冲突[有冲突时] / 本机路径[展开时] / 同步目标 / 自动化与插件更新 / 生成脚本 / 还原备份 / 同步内容 / 插件数据 / 工作区显示 / 问题反馈)。同步冲突、本机路径两个条件分区只在卡片存在时才出现在标签里。
274
274
  2. **滚动落点在标题下方**:标题栏改为不透明背景(面板卡片同色),滚动时内容不再从标题背后透出;点标签跳转时按标题栏实际高度设置滚动落点,目标分区完整显示在标题下方,不再被遮住。
275
275
 
276
+ ### 工作区显示卡片的会话名称与 DSH 面板保持一致(0.3.81)
277
+
278
+ 修复「工作区显示」卡片里会话名称与 DSH 会话面板显示不一致的问题。
279
+
280
+ DSH 的会话标题会演进:先产生 fallback 临时标题(首条消息截断),随后由大模型生成 provider 正式标题。之前卡片只读到第一条 fallback 就停止;现在改为按 provider 正式标题 > fallback > 无来源 title > 首条用户消息 的优先级取最新标题,与 DSH 面板完全一致。
281
+ ### 修复跨机同步把新插件降级覆盖、拉取后被回滚(0.3.80)
282
+
283
+ 修复跨机拉取时本地已安装的新版插件被配置仓库里的旧归档反向覆盖,进而导致 link 变成 0.0.0、插件 bundle 自检失败、拉取自动回滚的问题。
284
+
285
+ | 问题 | 修复 |
286
+ |---|---|
287
+ | 归档版本比本机旧时仍被当作新版本覆盖 | 版本比对由「不等即覆盖」改为语义化「只升不降」:只有归档版本高于本机版本才重新部署 |
288
+ | 归档内顶层目录名与文件名不符(如 0.3.70 包里套着 0.3.56 目录),解压出嵌套目录导致 link 失效 | capture 打包后强校验归档内顶层目录名与 version,异常归档直接删除并告警,不再同步到本机 |
289
+ | 残留的旧插件键导致每次拉取报 plugin-missing | 清理 localPluginMap 中的无效历史键与历史通知 |
290
+
291
+ 同时修正配置仓库中损坏的插件归档,用正确的 0.3.79 内容重打包。
292
+
293
+ ### 面板改成「页头固定 + 内容区独立滚动」的两段式布局(0.3.79)
294
+
295
+ 0.3.78 仍是一个滚动容器里塞一个吸顶页头,遇到两种情况还是会露:面板变矮、或页头换行变高时,内容会擦着标题分隔线上沿过去,甚至从标题上方那圈留白里露出来;跳转落点按页头高度动态算,条件分区出现/消失时也会忽高忽低。
296
+
297
+ 0.3.79 换成两段式:页头(标题 + 徽标 + 元信息 + 区标签)**整体移出滚动区**,固定在面板顶部;下方另起一块带 `overflow-y:auto` 的内容区,只装提示条和各分区卡片。带来三个直接效果:
298
+
299
+ 1. **结构上不可能再穿过去**:内容区边界就在标题分隔线下方 20px,滚动再多也只在内容区里,不会出现在标题区或标题上方。
300
+ 2. **跳转落点固定**:区标签跳转直接滚到内容区顶部 + 8px,不再按页头高度算偏移,页头怎么换行、条件分区在不在都不影响。
301
+ 3. **页头不再抖动**:页头不参与滚动,滚动条、阴影、半透明背景那套补丁全部去掉,只留一条分隔线。
302
+
303
+ 改造只动面板自己(`S.page` / `pageInner` 只在这一处用),侧栏行、设置页摘要行不受影响。
304
+
276
305
 
277
306
  ## 同步后新会话落在默认工作区
278
307
 
package/client.js CHANGED
@@ -93,12 +93,22 @@ window.__ModuleLoader__.load({
93
93
  color: 'var(--dsw-alias-label-primary-foreground)', fontWeight: 600,
94
94
  transition: 'background .15s ease, border-color .15s ease',
95
95
  },
96
- // 面板整页
96
+ // 面板整页:竖向两段式 —— 页头固定在上、下面这段才是滚动区
97
+ // 只有这样内容才不会滚过标题,跳转后分区标题也一定落在主标题下方
97
98
  page: {
98
- height: '100%', overflowY: 'auto', boxSizing: 'border-box',
99
- padding: '24px 28px 36px', background: 'var(--dsw-alias-bg-base)',
99
+ height: '100%', display: 'flex', flexDirection: 'column', overflow: 'hidden',
100
+ boxSizing: 'border-box', background: 'var(--dsw-alias-bg-base)',
100
101
  color: 'var(--dsw-alias-label-primary)',
101
102
  },
103
+ pageHeaderWrap: {
104
+ flex: '0 0 auto', zIndex: 50, padding: '24px 28px 0',
105
+ background: 'var(--dsw-alias-bg-base)',
106
+ },
107
+ pageHeaderInner: { maxWidth: '1140px', margin: '0 auto' },
108
+ pageBody: {
109
+ flex: '1 1 auto', minHeight: 0, overflowY: 'auto', overflowX: 'hidden',
110
+ padding: '20px 28px 36px', boxSizing: 'border-box',
111
+ },
102
112
  pageInner: { maxWidth: '1140px', margin: '0 auto', display: 'flex', flexDirection: 'column', gap: '20px' },
103
113
  pageTitle: { fontSize: '20px', lineHeight: '28px', fontWeight: 700, letterSpacing: '0.3px', color: 'var(--dsw-alias-label-primary)' },
104
114
  pageLead: { fontSize: '12px', lineHeight: '19px', color: 'var(--dsw-alias-label-tertiary)', margin: 0, maxWidth: '820px' },
@@ -2636,8 +2646,10 @@ window.__ModuleLoader__.load({
2636
2646
  : null
2637
2647
 
2638
2648
  return h('div', { style: S.page },
2639
- h('div', { style: S.pageInner },
2640
- h('div', { ref: headerRef, style: { ...S.pageHeader, position: 'sticky', top: '0', zIndex: 50, background: 'var(--dsw-alias-settings-card-fill, #fff)', boxShadow: '0 2px 8px var(--dsw-alias-border-l1)' } },
2649
+ // 页头在滚动区之外:内容滚不到它上面,区标签跳转后的标题也只出现在它下面
2650
+ h('div', { style: S.pageHeaderWrap },
2651
+ h('div', { style: S.pageHeaderInner },
2652
+ h('div', { ref: headerRef, style: S.pageHeader },
2641
2653
  h('div', { style: S.pageHeaderMain },
2642
2654
  h('div', { style: S.pageTitleRow },
2643
2655
  h('div', { style: S.pageTitle }, M('配置同步', 'Config Sync')),
@@ -2706,11 +2718,15 @@ window.__ModuleLoader__.load({
2706
2718
  key: sid, type: 'button',
2707
2719
  style: { fontSize: '12px', lineHeight: '18px', padding: '3px 10px', borderRadius: '6px', border: '1px solid transparent', background: 'transparent', color: 'var(--dsw-alias-label-secondary)', cursor: 'pointer' },
2708
2720
  title: M('跳转到此区', 'Jump to section'),
2709
- onClick: () => { const el = document.getElementById('sync-section-' + sid); if (!el || !el.scrollIntoView) return; const hh = headerRef.current ? headerRef.current.offsetHeight : 160; el.style.scrollMarginTop = (hh + 8) + 'px'; el.scrollIntoView({ behavior: 'smooth', block: 'start' }) },
2721
+ onClick: () => { const el = document.getElementById('sync-section-' + sid); if (!el || !el.scrollIntoView) return; el.scrollIntoView({ behavior: 'smooth', block: 'start' }) },
2710
2722
  }, label)
2711
2723
  }),
2712
2724
  ),
2713
2725
  ),
2726
+ ),
2727
+ ),
2728
+ h('div', { style: S.pageBody },
2729
+ h('div', { style: S.pageInner },
2714
2730
  toast
2715
2731
  ? h('div', {
2716
2732
  style: {
@@ -2741,6 +2757,7 @@ window.__ModuleLoader__.load({
2741
2757
  Section(M('工作区显示', 'Workspace visibility'), M('点工作区展开会话,点「修改」后才可切换状态;工作区与会话独立操作', 'Click a workspace to expand; click Edit to change states; workspaces and sections are independent'), [workspaceViewCard], 'workspace'),
2742
2758
  // 反馈放在最后一区
2743
2759
  Section(M('问题反馈', 'Feedback'), M('提交即建 GitHub Issue,跨机器共用;离线先排队', 'Each report becomes a GitHub Issue, shared across machines; offline reports queue locally'), [feedbackCard], 'feedback'),
2760
+ ),
2744
2761
  ),
2745
2762
  )
2746
2763
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-config-sync-plugin",
3
- "version": "0.3.78",
3
+ "version": "0.3.81",
4
4
  "type": "module",
5
5
  "description": "在 DSH 设置里查看 dsh-config 仓库与本机的同步状态,并生成退出后执行的 push/pull 脚本。同步动作本身不在应用内执行。面板与文案跟随客户端语言(中文/English)。",
6
6
  "main": "./index.js",
package/runtime/apply.ps1 CHANGED
@@ -900,6 +900,9 @@ $localPluginMap = [ordered]@{
900
900
  'dsh-our-free-model-2.8.0' = 'dsh-our-free-model'
901
901
  'dsh-purge-1.4.0' = 'dsh-purge'
902
902
  'dsh-config-sync-plugin-0.3.69' = 'dsh-config-sync-plugin'
903
+ 'dsh-config-sync-plugin-0.3.81' = 'dsh-config-sync-plugin'
904
+ 'dsh-config-sync-plugin-0.3.80' = 'dsh-config-sync-plugin'
905
+ 'dsh-config-sync-plugin-0.3.79' = 'dsh-config-sync-plugin'
903
906
  'dsh-config-sync-plugin-0.3.78' = 'dsh-config-sync-plugin'
904
907
  'dsh-config-sync-plugin-0.3.77' = 'dsh-config-sync-plugin'
905
908
  'dsh-config-sync-plugin-0.3.76' = 'dsh-config-sync-plugin'
@@ -919,7 +922,6 @@ $localPluginMap = [ordered]@{
919
922
  'dsh-config-sync-plugin-0.3.58' = 'dsh-config-sync-plugin'
920
923
  'dsh-config-sync-plugin-0.3.57' = 'dsh-config-sync-plugin'
921
924
  'dsh-config-sync-plugin-0.3.56' = 'dsh-config-sync-plugin'
922
- 'dsh-config-sync-0.1.0' = 'dsh-config-sync'
923
925
  }
924
926
  foreach ($dirName in $localPluginMap.Keys) {
925
927
  $pattern = 'link:[^"]*' + [regex]::Escape($dirName)
@@ -1245,6 +1247,15 @@ if (-not (Test-SyncGroupEnabled $Scope 'extra')) {
1245
1247
 
1246
1248
  # 读归档里的插件版本:tgz 里是 package/package.json,zip 里是 <目录名>/package.json 或根 package.json。
1247
1249
  # 读不出来返回 $null,调用方回退到 mtime 判据(不因为读不到就盲目重铺)。
1250
+ function Compare-PluginVersion([string]$a, [string]$b) {
1251
+ $pa = $null; $pb = $null
1252
+ if ($a -match '^v?(\d+)\.(\d+)\.(\d+)') { $pa = @([int]$matches[1], [int]$matches[2], [int]$matches[3]) }
1253
+ if ($b -match '^v?(\d+)\.(\d+)\.(\d+)') { $pb = @([int]$matches[1], [int]$matches[2], [int]$matches[3]) }
1254
+ if ((-not $pa) -or (-not $pb)) { return $null }
1255
+ for ($i = 0; $i -lt 3; $i++) { if ($pa[$i] -gt $pb[$i]) { return 1 }; if ($pa[$i] -lt $pb[$i]) { return -1 } }
1256
+ return 0
1257
+ }
1258
+
1248
1259
  function Get-ArchivePluginVersion([string]$archPath, [string]$dirName) {
1249
1260
  try {
1250
1261
  if ($archPath -like '*.tgz' -or $archPath -like '*.tar.gz') {
@@ -1310,7 +1321,8 @@ foreach ($dirName in $localPluginMap.Keys) {
1310
1321
  }
1311
1322
  $hasNewVersion = $false
1312
1323
  if ((Test-Path -LiteralPath $arch) -and $archVer -and $depVer) {
1313
- $hasNewVersion = ($archVer -ne $depVer)
1324
+ $cmpVer = Compare-PluginVersion $archVer $depVer
1325
+ if ($null -ne $cmpVer) { $hasNewVersion = ($cmpVer -gt 0) } else { $hasNewVersion = ($archVer -ne $depVer) }
1314
1326
  } elseif (Test-Path -LiteralPath $arch) {
1315
1327
  # 读不到版本(老归档、结构异常)时退回 mtime,但要求比已部署目录新 10 秒以上,避免每轮误判
1316
1328
  $archTime = (Get-Item -LiteralPath $arch).LastWriteTime
@@ -921,10 +921,29 @@ if ($PackLocalPlugins) {
921
921
  $p = Join-Path $linkPath 'package.json'
922
922
  if (Test-Path -LiteralPath $p) { $ver = (Get-Content -LiteralPath $p -Raw -Encoding utf8 | ConvertFrom-Json).version }
923
923
  Ok ("已打包 " + $dirName + "(version " + $ver + ",{0:N1} MB)" -f ((Get-Item -LiteralPath $zipPath).Length / 1MB))
924
- # 路径里若有版本号,和 package.json 的 version 对不上就提醒改名
925
- if ($dirName -match '([0-9]+\.[0-9]+\.[0-9]+)$' -and $ver -ne $Matches[1]) {
926
- Warn "目录名版本($($Matches[1])) 与插件实际版本($ver) 不一致,建议核对是否换了新版本"
927
- }
924
+ # 打包后强校验:归档内 package.json 必须在 dirName 第一层,其 version 必须与目录名版本号一致;不满足就删掉坏归档,避免同步到本机后解出嵌套旧目录
925
+ try {
926
+ Add-Type -AssemblyName System.IO.Compression.FileSystem -ErrorAction SilentlyContinue
927
+ $z = [IO.Compression.ZipFile]::OpenRead($zipPath)
928
+ $badZip = $false
929
+ try {
930
+ $pe = $z.Entries | Where-Object { $_.FullName -match ('^' + [regex]::Escape($dirName) + '[\\/]package\.json$') } | Select-Object -First 1
931
+ if (-not $pe) {
932
+ Warn ("打包校验失败:归档里缺 " + $dirName + " 顶层 package.json(可能多套了一层旧目录),删除坏归档")
933
+ $badZip = $true
934
+ } else {
935
+ $sr = New-Object IO.StreamReader($pe.Open())
936
+ try { $iv = [string](($sr.ReadToEnd()) | ConvertFrom-Json).version } finally { $sr.Dispose() }
937
+ if ($dirName -match '([0-9]+\.[0-9]+\.[0-9]+)$' -and $iv -ne $Matches[1]) {
938
+ Warn ("打包校验失败:目录名版本(" + $Matches[1] + ") 与归档内 version(" + $iv + ") 不一致,删除坏归档")
939
+ $badZip = $true
940
+ } else {
941
+ Ok ("打包校验通过:" + $dirName + "(version " + $iv + ",顶层目录名一致)")
942
+ }
943
+ }
944
+ } finally { try { $z.Dispose() } catch {} }
945
+ if ($badZip) { Remove-Item -LiteralPath $zipPath -Force -ErrorAction SilentlyContinue }
946
+ } catch { Warn ("无法校验归档结构:" + $_.Exception.Message + ",请人工核对 zip 内顶层目录名") }
928
947
  }
929
948
  }
930
949
 
@@ -134,14 +134,21 @@ function titleFromFile(file) {
134
134
  } else {
135
135
  text = buf.toString('utf8', 0, 256 * 1024)
136
136
  }
137
- let lastTitle = ''
137
+ // 会话标题会演进:先产生 fallback(首条消息截断),随后 AI 生成 provider 正式标题覆盖。
138
+ // DSH 面板显示的是最新/provider 标题;这里必须一致,不能像以前那样找到第一条就 break。
139
+ let providerTitle = '' // source.kind === 'provider' 的 AI 标题(取最后一条)
140
+ let fallbackTitle = '' // fallback 标题(取最后一条)
141
+ let anyTitle = '' // 无 source 信息的兜底标题(取最后一条)
138
142
  let firstUserText = ''
139
143
  for (const line of text.split('\n')) {
140
144
  if (!line) continue
141
145
  let ev
142
146
  try { ev = JSON.parse(line) } catch { continue }
143
147
  if (ev.type === 'session/title' && ev.data && typeof ev.data.title === 'string') {
144
- lastTitle = ev.data.title
148
+ const kind = ev.data.source && ev.data.source.kind
149
+ if (kind === 'provider') providerTitle = ev.data.title
150
+ else if (kind === 'fallback') fallbackTitle = ev.data.title
151
+ else anyTitle = ev.data.title
145
152
  }
146
153
  if (!firstUserText && ev.type === 'user/message' && ev.data && Array.isArray(ev.data.content)) {
147
154
  for (const part of ev.data.content) {
@@ -151,9 +158,9 @@ function titleFromFile(file) {
151
158
  }
152
159
  }
153
160
  }
154
- if (lastTitle) break
155
161
  }
156
- result = { title: cleanTitle(lastTitle) || cleanTitle(firstUserText) }
162
+ // 优先级与 DSH 面板一致:provider 正式标题 > fallback > 无来源 title > 首条用户消息
163
+ result = { title: cleanTitle(providerTitle) || cleanTitle(fallbackTitle) || cleanTitle(anyTitle) || cleanTitle(firstUserText) }
157
164
  } catch {
158
165
  result = { title: '' }
159
166
  }
@@ -1627,6 +1627,10 @@ console.log('== 配置同步页面 5 点调整 ==')
1627
1627
  wvSrc.includes('zstdDecompressSync') && wvSrc.includes('buildSessionLogIndex')
1628
1628
  && wvSrc.includes("'session/title'") && wvSrc.includes('title: rec.title || wsId')
1629
1629
  && wvSrc.includes('const title = log ? titleFromFile(log).title'), 'workspace-view.mjs 的标题提取')
1630
+ check('会话名称:与 DSH 面板一致——优先 provider 正式标题,不再取第一条 fallback',
1631
+ wvSrc.includes('providerTitle') && wvSrc.includes("kind === 'provider'")
1632
+ && wvSrc.includes('cleanTitle(providerTitle) || cleanTitle(fallbackTitle)')
1633
+ && !wvSrc.includes('if (lastTitle) break'), '标题演进:provider > fallback > 无来源 > 首条消息')
1630
1634
  check('会话名称:卡片显示 s.title || s.id', cliSrc.includes('s.title || s.id'), 'client.js 卡片')
1631
1635
  // 2) 修改按钮:点「修改」才出现三态 select 与会话隐藏按钮
1632
1636
  check('修改按钮:编辑态才显示三态 select 与会话隐藏按钮',
@@ -1644,8 +1648,10 @@ console.log('== 配置同步页面 5 点调整 ==')
1644
1648
  const wvPos = cliSrc.indexOf("Section(M('工作区显示', 'Workspace visibility')")
1645
1649
  const fbPos = cliSrc.indexOf("Section(M('问题反馈', 'Feedback')")
1646
1650
  check('工作区显示卡片移到问题反馈前', wvPos > 0 && fbPos > 0 && wvPos < fbPos, '分区顺序')
1647
- // 5) 标题固定 + 快速跳转 tab:Section 支持 id 锚点、pageHeader sticky、tab 点击 scrollIntoView
1648
- check('标题固定:pageHeader sticky', cliSrc.includes("position: 'sticky'") && cliSrc.includes('zIndex: 50'), 'pageHeader sticky')
1651
+ // 5) 标题固定 + 快速跳转 tab:Section 支持 id 锚点、页头在滚动区之外、tab 点击 scrollIntoView
1652
+ check('标题固定:页头在滚动区之外(两段式布局,不再 sticky)',
1653
+ cliSrc.includes('pageHeaderWrap:') && cliSrc.includes('pageBody:')
1654
+ && !cliSrc.includes("position: 'sticky'"), 'pageHeader 两段式')
1649
1655
  check('快速跳转 tab:Section 带锚点 id', cliSrc.includes('function Section(title, hint, cards, id)') && cliSrc.includes("sync-section-' + id"), 'Section id')
1650
1656
  check('快速跳转 tab:点击后平滑滚动到对应卡片',
1651
1657
  cliSrc.includes("getElementById('sync-section-' + sid)")
@@ -1663,11 +1669,12 @@ console.log('== 配置同步页面 5 点调整 ==')
1663
1669
  // 7) 条件区(同步冲突/本机路径)按卡片是否存在动态出现在 tab
1664
1670
  check('快速跳转 tab:条件区 conflict/roots 动态过滤',
1665
1671
  cliSrc.includes('...(conflictCard ?') && cliSrc.includes('...(showRoots ?'), 'tab 条件区')
1666
- // 8) 内容不在标题背后显示:sticky 头部不透明背景 + 跳转按头部高度设 scrollMarginTop
1667
- check('滚动落点在标题下方:sticky 不透明背景 + 动态 scrollMarginTop',
1668
- cliSrc.includes('background: \'var(--dsw-alias-settings-card-fill, #fff)\'')
1669
- && cliSrc.includes('el.style.scrollMarginTop = (hh + 8)')
1670
- && cliSrc.includes('headerRef.current ? headerRef.current.offsetHeight'), '滚动遮挡')
1672
+ // 8) 滚动区从标题下方开始:页头不滚动、内容区独立 overflow 且落点是固定 8px
1673
+ check('滚动落点在标题下方:内容区独立滚动 + 固定 scrollMarginTop',
1674
+ /pageBody:\s*\{[^}]*overflowY: 'auto'/.test(cliSrc)
1675
+ && /pageBody:\s*\{[^}]*minHeight: 0/.test(cliSrc)
1676
+ && cliSrc.includes("scrollMarginTop: '8px'")
1677
+ && !cliSrc.includes('headerRef.current ? headerRef.current.offsetHeight'), '滚动遮挡')
1671
1678
  }
1672
1679
  process.exit(failures === 0 ? 0 : 1)
1673
1680