feat(settings): 侧边栏设置声明式化 — 注册表驱动的开关清单 + 内置支持插头化

- SidebarPrefs 新增 tabsEnabled / viewersEnabled 开放 map(缺省 = 启用),
  PrefsSchema 用 z.dict 校验,旧文档零迁移
- TabDescriptor/FileViewerDescriptor 新增声明式设置面:viewer 补 title/icon,
  两者补 settings.toggles(子代理声明 autoOpenSubagent、终端声明 agentTerminalTools)
- 服务新增 isTabEnabled/isViewerEnabled;openTab 拒绝禁用类型、matchFileViewer
  跳过禁用 viewer
- SideCardSection 重写为注册表驱动清单:侧边栏内容(图标+类型id+开关+嵌套开关)
  + 文件预览(图标+标题+扩展名+开关),开关持久化 + 乐观提交回滚
- 消费点 gating:+ 菜单过滤、子代理自动展开、agent 终端 reconcile、
  产出文件拦截(editor 关闭时回落默认行)、新会话 explorer 预置
- 内置 viewer 补 6 个手绘 outline 图标;store 快照携带 prefs 使开关变更即时生效
- 测试:service gating / builtins 声明 / parsePrefs map 校验 / schema 断言 /
  新增 SideCardSection renderToString 规格
- 文档:README 设置小节、AGENTS.md 描述符与服务方法、新增设计文档;版本 0.5.0
This commit is contained in:
Menghuan1918
2026-08-11 14:08:55 +08:00
parent 89d2c65707
commit 89ddf8a9e7
25 changed files with 938 additions and 99 deletions
+37
View File
@@ -25,6 +25,43 @@
cursor: pointer;
}
/* Nested declarative toggle (a tab's related setting): indented child row. */
.subRow {
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
padding: 10px 0 10px 28px;
border-bottom: 1px solid var(--dsw-alias-border-l2);
cursor: pointer;
}
/* Inventory section heading (侧边栏内容 / 文件预览). */
.sectionHeading {
padding: 18px 0 6px;
font-size: 12px;
line-height: 17px;
font-weight: 600;
letter-spacing: 0.02em;
color: var(--dsw-alias-label-secondary);
}
/* Icon of one inventory row, inline with the title. */
.rowIcon {
display: inline-flex;
align-items: center;
flex: none;
color: var(--dsw-alias-label-secondary);
}
/* Title with the icon beside it. */
.titleLine {
display: flex;
align-items: center;
gap: 8px;
min-width: 0;
}
.rowText {
display: flex;
flex-direction: column;