Skip to content

v0.2.2 - 修复右键分组子菜单导致侧栏整块空白

Choose a tag to compare

@lsdt45 lsdt45 released this 17 Oct 02:41
· 19 commits to main since this release

🔧 变更与修复

1. 修复:右键「移动到分组」后整个工作区变空

  • 根因:0.2.1 把侧栏渲染拆进 browser/layout.js 时,createLayout(input) 漏注入 workspaceGroups。sectionMenuItems() 里的 ...workspaceGroups.map(choice) 成了自由变量,分组子菜单一渲染就抛 ReferenceError,被 QuietBoundary 兜底后整块 sidebar.workspaces 渲染为 null。
  • 表现:在会话 / 工作区行右键 → 指针落到「移动到分组」,侧栏工作区列表整块消失;错误边界状态不会自愈,必须刷新页面。
  • 修复:把 workspaceGroups 注入 layout 工厂(src/client/browser/layout.js、src/client/index.js 各一行)。

2. 守卫补强,同类问题不再漏

  • 架构守卫(tests/architecture.test.mjs):不再把 ...name 展开误判为成员访问。还原 bug 的副本上会直接失败并点名 browser/layout.js uses workspaceGroups (from index.js) without importing it。
  • 新增回归测试(tests/browser.context-menu.test.mjs):带 hook 状态与 React 错误边界语义的渲染桩,真实走一遍「右键 → 悬停分组子菜单」,断言边界未吞异常、子菜单正常渲染;并覆盖关闭菜单后再右键的用例。

3. 版本与验证

  • 版本升至 0.2.2,重建浏览器产物(产物一致性校验通过)。
  • npm run verify:build + check + 47 项测试全部通过。

更新方式:dsh plugin --profile desktop update dsh-workspace-plus(Web 端把 desktop 换成 web),更新后重启 DSH。