已合并
fix(review): switch review canvas with the active workspace #154
fix(review): switch review canvas with the active workspace #154
已合并
guantw创建于 1 天前
guantw成员
1 天前

Summary

Fixes OpenBitFun/bitfun_ade#133.

Switch the agent review canvas snapshot synchronously when the active workspace changes, so the review canvas follows the session when users move between workspaces. The existing session-owned browser-tab synchronization remains in place.

Type and Areas

Type: Bug fix, regression fix, UI/UX, test

Areas: Web UI, review canvas, workspace/session switching

Motivation / Impact

When two workspaces both had review content, switching the workspace changed the session view but could leave the previous workspace's review canvas visible. The previous React effect ran after workspace activation, so the target review tab could open before the target canvas snapshot was selected.

The change centralizes workspace snapshot switching in a guarded helper, handles synchronous workspace:switched and workspace:active-changed events before the target review tab opens, and keeps the context effect as a fallback. Repeated events for the same workspace are ignored.

Verification

  • pnpm --dir src/web-ui run test:run AuxPane.workspace-switch.test.tsx — passed (1 test) on the main, release/1.0.6, and release/1.0.5-based branches.
  • pnpm run type-check:web — passed on all three branches.
  • git diff HEAD^ HEAD --check — passed.

Reviewer Notes

No backend, protocol, or persisted-data shape changes. The focused test verifies synchronous canvas switching before the target review tab opens and suppresses duplicate swaps. HarmonyOS device behavior and remote workspace, remote control, Peer Device Mode, and Detached Dispatch scenarios were not exercised end to end.

Checklist

likedislike
Pull Request已成功合入, 合并人@SWangHash
(感谢 guantw 的贡献)
Gguantw成员
1 天前 修改了pull request 的描述
SWangHashSWangHash成员
1 天前 合入了pull request,合并节点 SHA:0b8c6363929342c0ebbb1c2396c9d55d6bf9e186