dsh-config-sync-plugin 0.3.88 → 0.3.90

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.88"` 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.89"` 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,9 +253,18 @@ 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
- ### Plugin update falls back to npm download (0.3.88)
256
+ ### Plugin update falls back to two npm sources (0.3.89)
257
257
 
258
- The "Plugin update" card now shows an **npm download URL** line with the actual fallback address (`https://registry.npmmirror.com/dsh-config-sync-plugin/-/dsh-config-sync-plugin-<ver>.tgz`). When the GitHub release download is unreachable (common in mainland China), the update package automatically falls back to the npm mirror. It is still verified against the authoritative sha256 in `version.json` — switching source never relaxes verification. The npm tarball is byte-identical to the GitHub release tgz (same sha256).
258
+ The "Plugin update" card now shows an **npm download URL** line with the actual fallback addresses (domestic mirror `registry.npmmirror.com` + official `registry.npmjs.org`). When the GitHub release download is unreachable (common in mainland China), the update package automatically falls back to npm. It is still verified against the authoritative sha256 in `version.json` — switching source never relaxes verification. The two sources back each other up: the mirror can briefly 404 during its first-sync window, and the official source takes over. The npm tarball is byte-identical to the GitHub release tgz (same sha256).
259
+
260
+ ### To-do and jump-tab display cleanup (0.3.90)
261
+
262
+ Four display adjustments to the panel:
263
+
264
+ 1. **Jump tabs highlight the current position**: the quick-jump tabs now auto-highlight the topmost visible section in the scroll region (primary fill + primary text), so "where am I" is obvious at a glance; clicking a tab also lights it up immediately.
265
+ 2. **"Local data" label removed from To-do**: the old subheading-like "Local data / 本机数据" row is gone; the To-do card presents its stats and details directly without the redundant title.
266
+ 3. **To-do expands to concrete names**: each group (Conversations / Local profile / Skills …) is one row; click it to reveal the concrete names — sessions show the session title (or `<sessionId> (session)` when unavailable), and the local profile shows file names like `package.json`, `cordis.patch.yml`; each group is de-duplicated and capped at 50 items. The To-do card title row has an Expand / Collapse toggle, expanded by default so details are visible on entry.
267
+ 4. **Overview description synced**: changed to "Versions, dependencies, snapshots and to-do at a glance".
259
268
 
260
269
  ### Local data moved into To-do, grouped by sync content, sessions shown by name (0.3.86)
261
270
 
@@ -681,7 +690,8 @@ The log shows which path ran: `文件比较(快筛):比对 N 个,深哈
681
690
 
682
691
  | Date | Version | Summary |
683
692
  |---|---|---|
684
- | 2026-11-24 | 0.3.88 | Plugin update card shows an "npm download URL"; falls back to the npm mirror when GitHub release is unreachable, still verified against the authoritative sha256 |
693
+ | 2026-11-24 | 0.3.90 | Jump tabs highlight the current section; "Local data" label removed from To-do; To-do expands to concrete session names and local profile files |
694
+ | 2026-11-24 | 0.3.89 | Plugin update card shows an "npm download URL"; falls back to two npm sources (mirror + official) when GitHub release is unreachable, still verified against the authoritative sha256 |
685
695
  | 2026-11-23 | 0.3.86 | Moved "Local data" into Overview / To-do, grouped pending files by the twelve sync-content groups, and show session names instead of session ids in the sample |
686
696
  | 2026-11-23 | 0.3.85 | Removed the tinted banner above the workspace list in edit mode; edit state is read from the Edit/Done button in the header |
687
697
  | 2026-11-23 | 0.3.84 | Workspace visibility card uses one Edit button for the whole card; each session row carries its own toggle with a background and divider, hidden names struck through |
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.88"` 后 `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.89"` 后 `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,9 +273,18 @@ pwsh -File runtime\sync.ps1 pull `
273
273
  1. **跳转顺序对齐卡片**:快捷标签顺序改为与分区实际渲染顺序完全一致(概览 / 同步冲突[有冲突时] / 本机路径[展开时] / 同步目标 / 自动化与插件更新 / 生成脚本 / 还原备份 / 同步内容 / 插件数据 / 工作区显示 / 问题反馈)。同步冲突、本机路径两个条件分区只在卡片存在时才出现在标签里。
274
274
  2. **滚动落点在标题下方**:标题栏改为不透明背景(面板卡片同色),滚动时内容不再从标题背后透出;点标签跳转时按标题栏实际高度设置滚动落点,目标分区完整显示在标题下方,不再被遮住。
275
275
 
276
- ### 插件更新支持 npm 兜底下载(0.3.88)
276
+ ### 插件更新支持 npm 双源兜底下载(0.3.89)
277
277
 
278
- 「插件更新」卡新增一行 **npm 下载路径**,直接显示实际兜底地址(`https://registry.npmmirror.com/dsh-config-sync-plugin/-/dsh-config-sync-plugin-<ver>.tgz`)。GitHub release 整段不通时(国内常见),更新包会自动兜底从 npm 镜像下载;仍按 `version.json` 里的权威 sha256 校验,换源不放宽校验。实测 npm tarball 与 GitHub release tgz 是同一份产物、sha256 完全一致。
278
+ 「插件更新」卡新增一行 **npm 下载路径**,直接显示实际兜底地址(国内镜像 `registry.npmmirror.com` + 官方 `registry.npmjs.org` 两个源)。GitHub release 整段不通时(国内常见),更新包会自动兜底从 npm 下载;仍按 `version.json` 里的权威 sha256 校验,换源不放宽校验。两个源互为备份:镜像首发同步窗口期会短暂 404,官方源随即兜上。实测 npm tarball 与 GitHub release tgz 是同一份产物、sha256 完全一致。
279
+
280
+ ### 待办与跳转按钮的显示梳理(0.3.90)
281
+
282
+ 面板的四处显示调整:
283
+
284
+ 1. **跳转按钮跟随当前位置高亮**:顶部快捷标签现在会按滚动区里最靠上的可见分区自动高亮(主色底 + 主色字),一眼看出「现在在哪一区」;点按钮跳转也会立即点亮对应标签。
285
+ 2. **待办去掉「本机数据」字眼**:原本地位等同小标题的「本机数据 / Local data」行删掉,待办卡直接以统计与明细呈现,不再重复冠名。
286
+ 3. **待办可展开具体名称**:每个分组(会话记录 / 本机 profile / Skills …)一行,点它展开看该组的具体名称 —— 会话显示会话记录标题(读不到时显示 `<sessionId>(会话)`),本机 profile 显示 `package.json`、`cordis.patch.yml` 等文件名,每项按组去重、最多列 50 条。待办卡标题行有「展开 / 收起」总开关,默认展开,进来即可见明细。
287
+ 4. **概览说明同步**:分区说明改为「版本、依赖、快照与待办一眼看完」。
279
288
 
280
289
  ### 本机数据挪进待办 + 按同步内容分组 + 会话显示会话名(0.3.86)
281
290
 
@@ -663,7 +672,8 @@ pwsh -File sync.ps1 push -ScanHistory
663
672
 
664
673
  | 日期 | 版本 | 要点 |
665
674
  |---|---|---|
666
- | 2026-11-24 | 0.3.88 | 插件更新卡新增「npm 下载路径」;GitHub release 不通时兜底 npm 镜像下载,仍按权威 sha256 校验 |
675
+ | 2026-11-24 | 0.3.90 | 顶部跳转按钮跟随当前位置高亮;待办去掉「本机数据」字眼、可展开看具体会话记录名与本机 profile |
676
+ | 2026-11-24 | 0.3.89 | 插件更新卡新增「npm 下载路径」;npm 双源(镜像+官方)兜底下载,仍按权威 sha256 校验 |
667
677
  | 2026-11-23 | 0.3.86 | 「本机数据」挪进概览-待办,按同步内容的 12 组口径分类统计,会话样本显示会话标题而非 session id |
668
678
  | 2026-11-23 | 0.3.85 | 去掉工作区显示卡片编辑态的强调色说明条,编辑与否只看标题行「修改」/「完成」按钮 |
669
679
  | 2026-11-23 | 0.3.84 | 工作区显示卡片改成整卡一个「修改」按钮;会话行自带开关、加底色与分隔线,隐藏态删除线 |
package/client.js CHANGED
@@ -2231,6 +2231,13 @@ window.__ModuleLoader__.load({
2231
2231
  // 「本机路径」平时不占版面:只在标题行按钮被点开时才渲染;按钮本身在
2232
2232
  // 「根外路径 / 被覆盖的配置」两类告警下变橙并带数字(待确认路径不算告警)。
2233
2233
  const [showRoots, setShowRoots] = react.useState(false)
2234
+ // 待办明细展开态:按分组 id 记,点分组标题即展开/收起该组的具体名称(会话记录名 / 本机 profile 文件)
2235
+ const [pendingOpen, setPendingOpen] = react.useState({})
2236
+ // 待办卡总开关:默认展开,让具体会话记录名 / 本机 profile 一进来就可见
2237
+ const [pendingDetailOpen, setPendingDetailOpen] = react.useState(true)
2238
+ // 顶部跳转按钮的当前位置高亮:跟随滚动区里最靠上的可见分区
2239
+ const [activeSection, setActiveSection] = react.useState('overview')
2240
+ const bodyRef = react.useRef(null)
2234
2241
  // 定时器放 ref 里:数据每刷新一次 effect 就会重跑,若在 effect 里 return 清理函数,
2235
2242
  // 会把还没到点的"5 秒后消失"定时器一起清掉,提示就一直挂在屏幕上。
2236
2243
  const toastTimer = react.useRef(null)
@@ -2263,6 +2270,29 @@ window.__ModuleLoader__.load({
2263
2270
  return () => { alive = false; clearInterval(timer) }
2264
2271
  }, [])
2265
2272
 
2273
+ // 滚动时找出最靠近滚动区顶部的分区,作为顶部跳转按钮的高亮目标。
2274
+ // 分区是动态的(冲突/本机路径卡可能不渲染),所以直接查 DOM 而不是维护一份 id 表。
2275
+ react.useEffect(() => {
2276
+ const body = bodyRef.current
2277
+ if (!body) return
2278
+ let raf = 0
2279
+ const update = () => {
2280
+ raf = 0
2281
+ const top = body.getBoundingClientRect().top
2282
+ const nodes = body.querySelectorAll('[id^="sync-section-"]')
2283
+ let current = ''
2284
+ for (const el of nodes) {
2285
+ if (el.getBoundingClientRect().top - top <= 28) current = el.id.slice('sync-section-'.length)
2286
+ else break
2287
+ }
2288
+ if (current) setActiveSection((prev) => (prev === current ? prev : current))
2289
+ }
2290
+ const onScroll = () => { if (!raf) raf = requestAnimationFrame(update) }
2291
+ body.addEventListener('scroll', onScroll, { passive: true })
2292
+ const t = setTimeout(update, 0) // 数据变化、DOM 重排后再算一次
2293
+ return () => { body.removeEventListener('scroll', onScroll); if (raf) cancelAnimationFrame(raf); clearTimeout(t) }
2294
+ }, [data])
2295
+
2266
2296
  const showToast = (text) => {
2267
2297
  setToast(text)
2268
2298
  if (toastTimer.current) clearTimeout(toastTimer.current)
@@ -2560,12 +2590,21 @@ window.__ModuleLoader__.load({
2560
2590
  ? M('已配置(只存本机)', 'Set (stored on this machine only)')
2561
2591
  : M('未配置(私有库会读不到清单)', 'Not set (private repos cannot be read)'),
2562
2592
  }),
2563
- u.remote && u.remote.npmTgz
2593
+ u.remote && u.remote.npmTgzUrls && u.remote.npmTgzUrls.length
2564
2594
  ? h(Kv, {
2565
2595
  k: M('npm 下载路径', 'npm download URL'),
2566
- v: u.remote.npmTgz,
2596
+ v: h('span', { style: { display: 'inline-flex', flexDirection: 'column', gap: '2px' } },
2597
+ u.remote.npmTgzUrls.map((url, i) =>
2598
+ h('span', { key: i, title: url }, url)
2599
+ )
2600
+ ),
2567
2601
  })
2568
- : null,
2602
+ : u.remote && u.remote.npmTgz
2603
+ ? h(Kv, {
2604
+ k: M('npm 下载路径', 'npm download URL'),
2605
+ v: u.remote.npmTgz,
2606
+ })
2607
+ : null,
2569
2608
  ),
2570
2609
  h('div', { style: S.footnote },
2571
2610
  M(
@@ -2617,38 +2656,67 @@ window.__ModuleLoader__.load({
2617
2656
  return local.pending > 0 ? M(`${base}(+${local.pending})`, `${base} (+${local.pending})`) : base
2618
2657
  })(), data && data.local && data.local.pending > 0 ? 'warn' : 'ok'),
2619
2658
  )
2620
- // 本机数据(原「本机仓库」卡里的一行)挪进待办:按「同步内容」分组列出待推送项,会话显示会话名
2659
+ // 待办:按「同步内容」分组列出待推送项,点分组展开看具体名称(会话记录名 / 本机 profile 文件)
2621
2660
  const localBlock = data && data.local && data.local.known ? (() => {
2622
2661
  const local = data.local
2623
2662
  const when = local.lastSyncAt ? new Date(local.lastSyncAt).toLocaleString(localeNow(), { hour12: false }) : '?'
2624
2663
  const groups = Array.isArray(local.groups) ? local.groups : []
2625
- const head = h('div', { style: { ...S.cardTitle, marginBottom: '4px' } }, M('本机数据', 'Local data'))
2626
2664
  const meta = h('div', { style: S.footnote }, M(
2627
2665
  `上次同步 ${when} · ${local.pending > 0 ? `有 ${local.pending} 个文件待推送` : '没有新写入'}${local.mode ? `(${local.mode})` : ''}`,
2628
2666
  `Last sync ${when} · ${local.pending > 0 ? `${local.pending} file(s) to push` : 'nothing new'}${local.mode ? ` (${local.mode})` : ''}`,
2629
2667
  ))
2668
+ // 每组一行:分组名 + 数量 + 展开箭头;展开后列出该组的具体名称
2630
2669
  const groupRows = groups.length
2631
- ? h('div', { style: { display: 'flex', flexWrap: 'wrap', gap: '6px' } }, groups.map((g, i) =>
2632
- h('div', {
2633
- key: i,
2634
- style: { ...S.chip, background: 'var(--dsw-alias-fill-l1, var(--dsw-alias-border-l1))' },
2635
- }, `${langIsZh() ? g.zh : g.en} · ${g.count}`)))
2636
- : null
2637
- const sampleRow = Array.isArray(local.sample) && local.sample.length
2638
- ? h('div', { style: S.footnote }, M(
2639
- `最近写入:${local.sample.join('、')}`,
2640
- `Recently changed: ${local.sample.join(', ')}`,
2641
- ))
2670
+ ? h('div', { style: { display: 'flex', flexDirection: 'column', gap: '4px' } }, groups.map((g, i) => {
2671
+ const open = pendingOpen[g.id] === true
2672
+ const items = Array.isArray(g.items) ? g.items : []
2673
+ const canExpand = items.length > 0
2674
+ return h('div', { key: g.id || i, style: { display: 'flex', flexDirection: 'column', gap: '2px' } },
2675
+ h('div', {
2676
+ style: { display: 'flex', alignItems: 'center', gap: '6px', cursor: canExpand ? 'pointer' : 'default', borderRadius: '6px', padding: '2px 4px' },
2677
+ title: canExpand ? (open ? M('点击收起明细', 'Click to collapse') : M('点击展开明细', 'Click to expand')) : undefined,
2678
+ onClick: canExpand ? () => setPendingOpen((prev) => ({ ...prev, [g.id]: !open })) : undefined,
2679
+ },
2680
+ h('span', { style: { flexShrink: 0, width: '10px', fontSize: '11px', color: 'var(--dsw-alias-label-tertiary)' } }, canExpand ? (open ? '▾' : '▸') : ''),
2681
+ h('span', { style: { ...S.chip, background: 'var(--dsw-alias-fill-l1, var(--dsw-alias-border-l1))' } }, langIsZh() ? g.zh : g.en),
2682
+ h('span', { style: { ...S.footnote, color: 'var(--dsw-alias-label-tertiary)' } }, `×${g.count}`),
2683
+ ),
2684
+ open && canExpand
2685
+ ? h('div', { style: { display: 'flex', flexDirection: 'column', gap: '2px', padding: '2px 0 2px 20px' } },
2686
+ items.map((name, j) => h('div', {
2687
+ key: j,
2688
+ style: { ...S.footnote, fontFamily: 'Consolas, ui-monospace, monospace', wordBreak: 'break-all' },
2689
+ }, name)),
2690
+ g.count > items.length
2691
+ ? h('div', { style: { ...S.footnote, opacity: 0.7 } }, M(`还有 ${g.count - items.length} 项未列出`, `${g.count - items.length} more not listed`))
2692
+ : null,
2693
+ )
2694
+ : null,
2695
+ )
2696
+ }))
2642
2697
  : null
2643
- return h('div', { style: { display: 'flex', flexDirection: 'column', gap: '4px' } }, head, meta, groupRows, sampleRow)
2698
+ return h('div', { style: { display: 'flex', flexDirection: 'column', gap: '4px' } }, meta, groupRows)
2644
2699
  })() : null
2645
2700
 
2646
2701
  const overview = h('div', { style: { gridColumn: '1 / -1', display: 'flex', flexDirection: 'column', gap: '8px' } },
2647
2702
  metrics,
2648
2703
  (localBlock || (data && Array.isArray(data.advice) && data.advice.length))
2649
2704
  ? h('div', { style: { ...S.card, gap: '6px', padding: '10px 13px' } },
2650
- h('div', { style: S.cardTitle }, M('待办', 'To-do')),
2651
- localBlock,
2705
+ h('div', { style: S.cardHead },
2706
+ h('div', { style: S.cardTitle }, M('待办', 'To-do')),
2707
+ localBlock
2708
+ ? h('button', {
2709
+ type: 'button',
2710
+ style: { marginLeft: 'auto', fontSize: '11px', lineHeight: '16px', padding: '1px 8px', borderRadius: '6px', cursor: 'pointer', border: '1px solid var(--dsw-alias-border-l2)', background: 'var(--dsw-alias-bg-base)', color: 'var(--dsw-alias-label-secondary)' },
2711
+ title: pendingDetailOpen ? M('收起待办明细', 'Collapse details') : M('展开待办明细', 'Expand details'),
2712
+ onClick: () => setPendingDetailOpen((v) => !v),
2713
+ }, pendingDetailOpen ? M('收起', 'Collapse') : M('展开', 'Expand'))
2714
+ : null,
2715
+ ),
2716
+ pendingDetailOpen ? localBlock : (localBlock ? h('div', { style: S.footnote }, M(
2717
+ `${data.local.pending > 0 ? `有 ${data.local.pending} 个文件待推送` : '没有新写入'} · 点「展开」看具体会话记录与本机 profile`,
2718
+ `${data.local.pending > 0 ? `${data.local.pending} file(s) to push` : 'nothing new'} · click Expand for session names and local profile`,
2719
+ )) : null),
2652
2720
  data && Array.isArray(data.advice) && data.advice.length ? h(Advice, { items: data.advice }) : null)
2653
2721
  : null,
2654
2722
  )
@@ -2806,18 +2874,31 @@ window.__ModuleLoader__.load({
2806
2874
  ['feedback', M('问题反馈', 'Feedback')],
2807
2875
  ].map((pair) => {
2808
2876
  const sid = pair[0], label = pair[1]
2877
+ // 当前所处的分区:主色底 + 主色字,和概览区标题竖条同一套视觉锚点
2878
+ const active = activeSection === sid
2809
2879
  return h('button', {
2810
2880
  key: sid, type: 'button',
2811
- style: { fontSize: '12px', lineHeight: '18px', padding: '3px 10px', borderRadius: '6px', border: '1px solid transparent', background: 'transparent', color: 'var(--dsw-alias-label-secondary)', cursor: 'pointer' },
2812
- title: M('跳转到此区', 'Jump to section'),
2813
- onClick: () => { const el = document.getElementById('sync-section-' + sid); if (!el || !el.scrollIntoView) return; el.scrollIntoView({ behavior: 'smooth', block: 'start' }) },
2881
+ style: {
2882
+ fontSize: '12px', lineHeight: '18px', padding: '3px 10px', borderRadius: '6px', cursor: 'pointer',
2883
+ border: '1px solid ' + (active ? 'var(--dsw-alias-toast-action)' : 'transparent'),
2884
+ background: active ? 'var(--dsw-alias-toast-action)' : 'transparent',
2885
+ color: active ? 'var(--dsw-alias-label-primary-foreground, var(--dsw-alias-label-primary))' : 'var(--dsw-alias-label-secondary)',
2886
+ fontWeight: active ? 600 : 400,
2887
+ },
2888
+ title: active ? M('当前所在区', 'Current section') : M('跳转到此区', 'Jump to section'),
2889
+ onClick: () => {
2890
+ setActiveSection(sid)
2891
+ const el = document.getElementById('sync-section-' + sid)
2892
+ if (!el || !el.scrollIntoView) return
2893
+ el.scrollIntoView({ behavior: 'smooth', block: 'start' })
2894
+ },
2814
2895
  }, label)
2815
2896
  }),
2816
2897
  ),
2817
2898
  ),
2818
2899
  ),
2819
2900
  ),
2820
- h('div', { style: S.pageBody },
2901
+ h('div', { ref: bodyRef, style: S.pageBody },
2821
2902
  h('div', { style: S.pageInner },
2822
2903
  toast
2823
2904
  ? h('div', {
@@ -2834,7 +2915,7 @@ window.__ModuleLoader__.load({
2834
2915
  : null,
2835
2916
  err ? h('div', { style: { ...S.hint, color: 'var(--dsw-alias-state-error-primary)' } }, M(`读取失败:${err}`, `Read failed: ${err}`)) : null,
2836
2917
  // 按内容分区:状态在上、配置居中、动作在下;每区内部网格并排(宽屏两列)
2837
- Section(M('概览', 'Overview'), M('版本、依赖、快照一眼看完', 'Versions, dependencies and snapshots at a glance'), [overview], 'overview'),
2918
+ Section(M('概览', 'Overview'), M('版本、依赖、快照与待办一眼看完', 'Versions, dependencies, snapshots and to-do at a glance'), [overview], 'overview'),
2838
2919
  conflictCard
2839
2920
  ? Section(M('同步冲突', 'Sync conflicts'), M('这些文件挡住了拉取:逐项选完保存,再点「立即拉取」', 'These files block the pull: pick per file, save, then pull'), [conflictCard], 'conflict')
2840
2921
  : null,
package/index.js CHANGED
@@ -1851,6 +1851,9 @@ function localPending(dshHome, lastSyncAt, profileName, ctx = {}) {
1851
1851
  let newest = 0
1852
1852
  const sample = []
1853
1853
  const groupCount = new Map()
1854
+ // 每组保留具体明细名称(会话记录名 / 本机 profile 文件名 …),供面板展开查看
1855
+ const groupItems = new Map()
1856
+ const DETAIL_CAP = 50
1854
1857
  while (stack.length && scanned < 20000 && Date.now() < deadline) {
1855
1858
  const cur = stack.pop()
1856
1859
  let st
@@ -1881,12 +1884,25 @@ function localPending(dshHome, lastSyncAt, profileName, ctx = {}) {
1881
1884
  const sid = basename(dirname(cur)) // sessions/<workspace>/<sessionId>/session.v4.jsonl.zstd
1882
1885
  const title = sessionTitleOf(dshHome, sid)
1883
1886
  if (title) label = title
1887
+ else label = `${sid}(会话)`
1888
+ } else if (gid === 'profile') {
1889
+ label = basename(cur) // 本机 profile 文件:package.json / cordis.patch.yml …
1884
1890
  }
1885
1891
  if (sample.length < 3) sample.push(label)
1892
+ // 按组收集明细名(去重、限量):面板展开可看具体会话记录名 / 本机 profile 文件
1893
+ let items = groupItems.get(gid)
1894
+ if (!items) { items = []; groupItems.set(gid, items) }
1895
+ if (items.length < DETAIL_CAP && !items.includes(label)) items.push(label)
1886
1896
  }
1887
1897
  }
1888
1898
  const groups = [...groupCount.entries()]
1889
- .map(([id, count]) => ({ id, zh: PENDING_GROUP_LABEL[id]?.[0] || id, en: PENDING_GROUP_LABEL[id]?.[1] || id, count }))
1899
+ .map(([id, count]) => ({
1900
+ id,
1901
+ zh: PENDING_GROUP_LABEL[id]?.[0] || id,
1902
+ en: PENDING_GROUP_LABEL[id]?.[1] || id,
1903
+ count,
1904
+ items: groupItems.get(id) || [],
1905
+ }))
1890
1906
  .sort((a, b) => b.count - a.count)
1891
1907
  return {
1892
1908
  known: true,
@@ -1894,6 +1910,7 @@ function localPending(dshHome, lastSyncAt, profileName, ctx = {}) {
1894
1910
  newestAt: newest ? new Date(newest).toISOString() : '',
1895
1911
  sample,
1896
1912
  groups,
1913
+ profileName: profileName || 'desktop',
1897
1914
  truncated: scanned >= 20000 || Date.now() >= deadline,
1898
1915
  }
1899
1916
  }
@@ -2151,13 +2168,24 @@ function compareVersion(a, b) {
2151
2168
  }
2152
2169
 
2153
2170
  /**
2154
- * 0.3.88:npm registry 的 tarball 地址。npm 包与 GitHub release 的 tgz 是同一份发布产物
2155
- * (实测两者 sha256 完全一致),所以 GitHub release 下载不通时能自动从 npm 镜像取,
2156
- * 清单里的权威 sha256 照常校验,不会因换源而放松校验。
2171
+ * 0.3.89:npm registry 的 tarball 地址(双源)。npm 包与 GitHub release 的 tgz 是同一份
2172
+ * 发布产物(实测 sha256 完全一致),GitHub release 不通时自动从 npm 取。两个源都列:
2173
+ * npmmirror 国内快、但发版后有同步窗口期会短暂 404;官方 registry 更权威、不受镜像延迟影响。
2174
+ * 清单里的权威 sha256 照常校验,换源不放宽校验。
2157
2175
  */
2158
- function npmTgzUrl(version) {
2176
+ function npmTgzUrls(version) {
2159
2177
  const v = String(version || '').replace(/[^0-9A-Za-z.+\-]/g, '')
2160
- return v ? `https://registry.npmmirror.com/dsh-config-sync-plugin/-/dsh-config-sync-plugin-${v}.tgz` : ''
2178
+ if (!v) return []
2179
+ const f = `dsh-config-sync-plugin-${v}.tgz`
2180
+ return [
2181
+ `https://registry.npmmirror.com/dsh-config-sync-plugin/-/${f}`,
2182
+ `https://registry.npmjs.org/dsh-config-sync-plugin/-/${f}`,
2183
+ ]
2184
+ }
2185
+ // 兼容旧调用:返回首选 npm 兜底地址
2186
+ function npmTgzUrl(version) {
2187
+ const list = npmTgzUrls(version)
2188
+ return list.length ? list[0] : ''
2161
2189
  }
2162
2190
 
2163
2191
  /**
@@ -2167,11 +2195,15 @@ function npmTgzUrl(version) {
2167
2195
  */
2168
2196
  function resolveTgzCandidates(manifest, manifestUrl = '') {
2169
2197
  const tgz = String((manifest && manifest.tgz) || '')
2170
- const npmTgz = npmTgzUrl(manifest && manifest.version)
2171
- const withNpm = (list) => (npmTgz && !list.includes(npmTgz) ? [...list, npmTgz] : list)
2172
- // 清单没给 tgz 时,也留 npm 这一条路(有版本就能拼出 tarball)
2173
- if (!tgz) return npmTgz ? [npmTgz] : []
2174
- // 清单里写了绝对地址:先照它来,末尾追加 npm 兜底(0.3.88 起不再直接 return)
2198
+ const npmList = npmTgzUrls(manifest && manifest.version)
2199
+ const withNpm = (list) => {
2200
+ const out = list.slice()
2201
+ for (const u of npmList) if (u && !out.includes(u)) out.push(u)
2202
+ return out
2203
+ }
2204
+ // 清单没给 tgz 时,也留 npm 这两条路(有版本就能拼出 tarball)
2205
+ if (!tgz) return npmList.slice()
2206
+ // 清单里写了绝对地址:先照它来,末尾追加 npm 双源兜底(0.3.89 起不再直接 return)
2175
2207
  if (/^https?:\/\//i.test(tgz)) return withNpm([tgz])
2176
2208
  const rel = tgz.replace(/^\.?\//, '')
2177
2209
  const bases = []
@@ -2308,8 +2340,9 @@ function updatePayload(state, settings = {}) {
2308
2340
  notesEn: String(remote.notesEn || ''),
2309
2341
  releasedAt: String(remote.releasedAt || ''),
2310
2342
  tgz: resolveTgzUrl(remote, state.url),
2311
- // 0.3.88:GitHub release 不通时的 npm 兜底下载地址,面板上单独显示一行
2343
+ // 0.3.89:GitHub release 不通时的 npm 兜底下载地址(双源,面板显示首选),面板上单独显示一行
2312
2344
  npmTgz: npmTgzUrl(remote.version),
2345
+ npmTgzUrls: npmTgzUrls(remote.version),
2313
2346
  sha256: String(remote.sha256 || ''),
2314
2347
  } : null,
2315
2348
  hasUpdate: remote ? compareVersion(remote.version, PLUGIN_VERSION) > 0 : false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-config-sync-plugin",
3
- "version": "0.3.88",
3
+ "version": "0.3.90",
4
4
  "type": "module",
5
5
  "description": "在 DSH 设置里查看 dsh-config 仓库与本机的同步状态,并生成退出后执行的 push/pull 脚本。同步动作本身不在应用内执行。面板与文案跟随客户端语言(中文/English)。",
6
6
  "main": "./index.js",
@@ -1749,17 +1749,27 @@ console.log('== 0.3.86:本机数据挪进待办 + 会话显示会话名 + 按
1749
1749
  && idxSrc.includes('zh: PENDING_GROUP_LABEL[id]?.[0]')
1750
1750
  && idxSrc.includes('groups,')
1751
1751
  && idxSrc.includes('sample: [], groups: []'), 'index.js localPending 返回值')
1752
- // 2) 客户端:本机数据从「本机仓库」卡挪进「待办」
1752
+ // 2) 客户端:待办去掉「本机数据」字眼,按分组可展开看具体名称
1753
1753
  const localDataHits = cliSrc.split("M('本机数据', 'Local data')").length - 1
1754
- check('本机数据只出现在待办卡(从本机仓库卡移除)',
1755
- localDataHits === 1
1756
- && cliSrc.includes('const localBlock = data && data.local && data.local.known')
1757
- && cliSrc.includes('localBlock,'), 'client.js 待办装配')
1758
- check('待办里按同步内容分组显示,并列出会话名样本',
1754
+ check('待办去掉「本机数据」字眼(0.3.90)',
1755
+ localDataHits === 0, 'client.js 无 Local data 文案')
1756
+ check('待办装配:localBlock 挂到待办卡',
1757
+ cliSrc.includes('const localBlock = data && data.local && data.local.known')
1758
+ && cliSrc.includes('pendingDetailOpen ? localBlock'), 'client.js 待办装配')
1759
+ check('待办按同步内容分组、点分组展开具体名称(会话名/profile 文件)',
1759
1760
  cliSrc.includes('langIsZh() ? g.zh : g.en')
1760
1761
  && cliSrc.includes('g.count')
1761
- && cliSrc.includes('最近写入:')
1762
- && cliSrc.includes('local.sample.join'), 'client.js 分组展示')
1762
+ && cliSrc.includes('const items = Array.isArray(g.items) ? g.items : []')
1763
+ && cliSrc.includes('setPendingOpen')
1764
+ && cliSrc.includes('还有 ${g.count - items.length} 项未列出'), 'client.js 分组展开')
1765
+ check('待办卡有展开/收起总开关(默认展开)',
1766
+ cliSrc.includes('const [pendingDetailOpen, setPendingDetailOpen] = react.useState(true)')
1767
+ && cliSrc.includes('pendingDetailOpen ? localBlock'), 'client.js 待办总开关')
1768
+ check('顶部跳转按钮跟随当前分区高亮(0.3.90)',
1769
+ cliSrc.includes('const [activeSection, setActiveSection] = react.useState')
1770
+ && cliSrc.includes('const active = activeSection === sid')
1771
+ && cliSrc.includes("querySelectorAll('[id^=\"sync-section-\"]')")
1772
+ && cliSrc.includes('ref: bodyRef'), 'client.js 跳转高亮')
1763
1773
  check('分组标签与同步内容一致(会话记录/技能/插件数据/记忆数据)',
1764
1774
  idxSrc.includes("conversations: ['会话记录', 'Conversations']")
1765
1775
  && idxSrc.includes("skills: ['Skills', 'Skills']")