dsh-config-sync-plugin 0.3.77 → 0.3.78
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 +9 -1
- package/README.md +9 -1
- package/client.js +6 -3
- package/package.json +1 -1
- package/runtime/apply.ps1 +1 -0
- package/tools/selftest.mjs +17 -0
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.
|
|
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>` |
|
|
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
|
|
|
@@ -246,6 +246,14 @@ Five interaction refinements on top of the 0.3.76 "Workspace visibility" card:
|
|
|
246
246
|
|
|
247
247
|
Title reading and state changes stay self-contained in this plugin and do not call the session-manager Web API.
|
|
248
248
|
|
|
249
|
+
### Quick-jump order matches the cards; scrolling no longer hides behind the title (0.3.78)
|
|
250
|
+
|
|
251
|
+
Two display fixes on top of 0.3.77:
|
|
252
|
+
|
|
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
|
+
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
|
+
|
|
256
|
+
|
|
249
257
|
## New sessions land in the default workspace (since 0.3.28)
|
|
250
258
|
|
|
251
259
|
A finished sync brings DSH back up, and the client opens a fresh session on startup. Where that session lands is decided by `global.defaultWorkspaceId` in `<DshHome>\storages\workspace.json` — and DSH writes that value only during **first-time initialization**, so after a few syncs it can be left pointing at whatever workspace was used last.
|
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.
|
|
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>` 一致 |
|
|
19
19
|
| 插件市场 | 客户端「插件市场 → 发现」搜「配置同步」 | 走 `market-index.json` 登记的 git 提交,版本与 README 对齐 |
|
|
20
20
|
| 离线 tgz | `releases\dsh-config-sync-plugin-<ver>.tgz` | GitHub Release 附件,适合内网机器;面板「更新」按钮下载的也是它 |
|
|
21
21
|
|
|
@@ -266,6 +266,14 @@ pwsh -File runtime\sync.ps1 pull `
|
|
|
266
266
|
|
|
267
267
|
会话标题读取与三态读写都在本插件内自包含完成,不依赖 session-manager 的 Web API。
|
|
268
268
|
|
|
269
|
+
### 快速跳转顺序与卡片对齐、滚动不再被标题遮挡(0.3.78)
|
|
270
|
+
|
|
271
|
+
0.3.77 的两处显示问题已修:
|
|
272
|
+
|
|
273
|
+
1. **跳转顺序对齐卡片**:快捷标签顺序改为与分区实际渲染顺序完全一致(概览 / 同步冲突[有冲突时] / 本机路径[展开时] / 同步目标 / 自动化与插件更新 / 生成脚本 / 还原备份 / 同步内容 / 插件数据 / 工作区显示 / 问题反馈)。同步冲突、本机路径两个条件分区只在卡片存在时才出现在标签里。
|
|
274
|
+
2. **滚动落点在标题下方**:标题栏改为不透明背景(面板卡片同色),滚动时内容不再从标题背后透出;点标签跳转时按标题栏实际高度设置滚动落点,目标分区完整显示在标题下方,不再被遮住。
|
|
275
|
+
|
|
276
|
+
|
|
269
277
|
## 同步后新会话落在默认工作区
|
|
270
278
|
|
|
271
279
|
`<DshHome>\storages\workspace.json` 的 `global.defaultWorkspaceId` 决定新会话落在哪。DSH 只在本机**首次初始化**写过一次,之后同步几轮就可能停在「上次用的工作区」。`post-exit.ps1` 在**客户端完全退出之后、重新拉起之前**把它校正到默认工作区(早写会被客户端退出时的回写盖掉)。
|
package/client.js
CHANGED
|
@@ -2165,6 +2165,7 @@ window.__ModuleLoader__.load({
|
|
|
2165
2165
|
// 定时器放 ref 里:数据每刷新一次 effect 就会重跑,若在 effect 里 return 清理函数,
|
|
2166
2166
|
// 会把还没到点的"5 秒后消失"定时器一起清掉,提示就一直挂在屏幕上。
|
|
2167
2167
|
const toastTimer = react.useRef(null)
|
|
2168
|
+
const headerRef = react.useRef(null)
|
|
2168
2169
|
const summary = summarize(data)
|
|
2169
2170
|
// 门禁分三条:有路径就能生成还原脚本;拉取允许「真仓库 or 空目录」;推送只允许真仓库。
|
|
2170
2171
|
// 空目录 = 新机器还没拉过,面板只放行「拉取」,推送按钮直接禁掉(后端也会再拦一次)。
|
|
@@ -2636,7 +2637,7 @@ window.__ModuleLoader__.load({
|
|
|
2636
2637
|
|
|
2637
2638
|
return h('div', { style: S.page },
|
|
2638
2639
|
h('div', { style: S.pageInner },
|
|
2639
|
-
h('div', { style: { ...S.pageHeader, position: 'sticky', top: '0', zIndex: 50, background: 'var(--dsw-alias-
|
|
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)' } },
|
|
2640
2641
|
h('div', { style: S.pageHeaderMain },
|
|
2641
2642
|
h('div', { style: S.pageTitleRow },
|
|
2642
2643
|
h('div', { style: S.pageTitle }, M('配置同步', 'Config Sync')),
|
|
@@ -2689,13 +2690,15 @@ window.__ModuleLoader__.load({
|
|
|
2689
2690
|
h('div', { style: { display: 'flex', gap: '4px', flexWrap: 'wrap', width: '100%', borderTop: '1px solid var(--dsw-alias-border-l1)', paddingTop: '8px' } },
|
|
2690
2691
|
[
|
|
2691
2692
|
['overview', M('概览', 'Overview')],
|
|
2692
|
-
['
|
|
2693
|
+
...(conflictCard ? [['conflict', M('同步冲突', 'Sync conflicts')]] : []),
|
|
2694
|
+
...(showRoots ? [['roots', M('本机路径', 'Local paths')]] : []),
|
|
2693
2695
|
['targets', M('同步目标', 'Targets')],
|
|
2694
2696
|
['automation', M('自动化', 'Automation')],
|
|
2695
2697
|
['actions', M('生成脚本', 'Scripts')],
|
|
2696
2698
|
['restore', M('还原备份', 'Restore')],
|
|
2697
2699
|
['scope', M('同步内容', 'Content')],
|
|
2698
2700
|
['extra', M('插件数据', 'Plugin data')],
|
|
2701
|
+
['workspace', M('工作区显示', 'Workspaces')],
|
|
2699
2702
|
['feedback', M('问题反馈', 'Feedback')],
|
|
2700
2703
|
].map((pair) => {
|
|
2701
2704
|
const sid = pair[0], label = pair[1]
|
|
@@ -2703,7 +2706,7 @@ window.__ModuleLoader__.load({
|
|
|
2703
2706
|
key: sid, type: 'button',
|
|
2704
2707
|
style: { fontSize: '12px', lineHeight: '18px', padding: '3px 10px', borderRadius: '6px', border: '1px solid transparent', background: 'transparent', color: 'var(--dsw-alias-label-secondary)', cursor: 'pointer' },
|
|
2705
2708
|
title: M('跳转到此区', 'Jump to section'),
|
|
2706
|
-
onClick: () => { const el = document.getElementById('sync-section-' + sid); if (el
|
|
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' }) },
|
|
2707
2710
|
}, label)
|
|
2708
2711
|
}),
|
|
2709
2712
|
),
|
package/package.json
CHANGED
package/runtime/apply.ps1
CHANGED
|
@@ -900,6 +900,7 @@ $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.78' = 'dsh-config-sync-plugin'
|
|
903
904
|
'dsh-config-sync-plugin-0.3.77' = 'dsh-config-sync-plugin'
|
|
904
905
|
'dsh-config-sync-plugin-0.3.76' = 'dsh-config-sync-plugin'
|
|
905
906
|
'dsh-config-sync-plugin-0.3.75' = 'dsh-config-sync-plugin'
|
package/tools/selftest.mjs
CHANGED
|
@@ -1651,6 +1651,23 @@ console.log('== 配置同步页面 5 点调整 ==')
|
|
|
1651
1651
|
cliSrc.includes("getElementById('sync-section-' + sid)")
|
|
1652
1652
|
&& cliSrc.includes("scrollIntoView({ behavior: 'smooth', block: 'start' })")
|
|
1653
1653
|
&& cliSrc.includes("['feedback', M('问题反馈', 'Feedback')]"), 'tab 跳转')
|
|
1654
|
+
// 6) tab 顺序 = 卡片渲染顺序:workspace 在 extra 之后、feedback 之前(不再是第 2 位)
|
|
1655
|
+
const tabBlock = cliSrc.slice(cliSrc.indexOf("['overview', M('概览', 'Overview')]"), cliSrc.indexOf('.map((pair) =>'))
|
|
1656
|
+
const tabOrder = ['overview', 'workspace', 'targets', 'automation', 'actions', 'restore', 'scope', 'extra', 'feedback']
|
|
1657
|
+
.filter((k) => k !== 'workspace' && k !== 'feedback') // 下面单独校验位置
|
|
1658
|
+
const tabIdx = (s) => tabBlock.indexOf("['" + s + "',")
|
|
1659
|
+
check('快速跳转 tab 顺序与卡片顺序一致:workspace 在 extra 后、feedback 前',
|
|
1660
|
+
tabIdx('extra') > 0 && tabIdx('feedback') > tabIdx('extra')
|
|
1661
|
+
&& tabBlock.indexOf("['workspace',") > tabIdx('extra')
|
|
1662
|
+
&& tabBlock.indexOf("['workspace',") < tabIdx('feedback'), 'tab 顺序')
|
|
1663
|
+
// 7) 条件区(同步冲突/本机路径)按卡片是否存在动态出现在 tab
|
|
1664
|
+
check('快速跳转 tab:条件区 conflict/roots 动态过滤',
|
|
1665
|
+
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'), '滚动遮挡')
|
|
1654
1671
|
}
|
|
1655
1672
|
process.exit(failures === 0 ? 0 : 1)
|
|
1656
1673
|
|