fix(dock): 保持保存的 active 面板 v3.26.23
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 44s

This commit is contained in:
qiqi committed 2026-11-22 00:29:31 +08:00
1 parent dd498a1cf7
commit 72f0bb2aec
12 files changed
+53 -21

No files matched your search

+1 -1
View File
@@ -25,7 +25,7 @@ assert.strictEqual(d.left.list.indexOf('prompts') >= 0, true, '左侧应保留')
// 3) 未注册的面板 → 保留 id(插件可能还没加载完),active 回退到可用面板
d = sanitize(mk(['ghost', 'groups'], ['gallery']), panels, noDefaults)
assert.deepStrictEqual(d.left.list, ['ghost', 'groups'], '未注册 id 应保留(等插件加载),实际 ' + JSON.stringify(d.left.list))
assert.strictEqual(d.left.active, 'groups', 'active 应回退到可用面板')
assert.strictEqual(d.left.active, 'ghost', 'active 若仍在 list 中应保持(等插件加载)')
// 4) 默认回填:另一侧已有的不补;removed 里的不补
d = sanitize({ left: { list: ['prompts'], active: 'prompts', removed: ['styles'] }, right: { list: ['gallery'], active: 'gallery', removed: [] } }, panels, defaults)