fix(ui): 右侧栏「后台任务」tab 跨端同步与状态镜像自愈 - #453
Merged
Merged
Conversation
tab 开合意图提升为 RightDockProjectState.backgroundTasks 持久化字段, 随 rightDock 整桶 (stateVersion, writerId) LWW 跨端同步;关闭仍为 hide-only(快照进程 id,新任务在快照外则全端重新派生);无项目路径时 回退会话本地状态。 镜像自愈:store 新增 refreshManagedProcessState(兼作失败初始化重试), 页面回到可见即对账;面板作为可见 tab 期间 30s 周期对账。修复 WebUI socket 单例 reset→create 不触发 replaced 事件导致订阅挂死,以及 shouldMaintainConnection 缺少 processStateListeners。 Fixes #452
Contributor
|
PR governance checks failed — this PR has been converted to draft.
Fix the items above, then click Ready for review to re-run the checks. |
StackCairn
marked this pull request as draft
August 13, 2026 06:09
store 五例合一(镜像语义+refresh 自愈按序覆盖)、单例替换只留 reset→create 关键路径、right-dock 六例并两例(手势语义/落盘归并, 墓碑守卫改单断言)、Go 用例抽公共断言并裁冗余字段。覆盖不变。
su-fen
marked this pull request as ready for review
August 13, 2026 06:24
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #452
问题
改动
tab 开合跨端同步
RightDockProjectState新增backgroundTasks: { opened, dismissedIds },随 rightDock 整桶(stateVersion, writerId)LWW 归并跨端同步(与文件树等工具 tab 同通道);normalize / contentKey / 墓碑判定 / 工作区移除路径全覆盖。open/closeRightDockBackgroundTasksTabState手势变换:open 固定可见 + 激活 tab + 清空 dismissal;close 保持 hide-only 语义(快照当前进程 id,新任务在快照外则全端重新派生)。RightDockPanel可见性改读持久化状态,开/关手势写入 projectState(写入仅限用户手势);无 projectPathKey 时回退会话本地状态。RIGHT_DOCK_BACKGROUND_TASKS_TAB_ID;closeRightDockToolTabState显式构造补字段透传。状态镜像自愈
refreshManagedProcessState()(拉权威快照对账,兼作失败初始化的重试);init 挂visibilitychange→visible对账。BackgroundTasksPanel作为可见 tab 期间:激活即对账 + 30s 周期对账。everHadClient判定 replaced——reset→create序列(登出→登录)也触发onGatewayWebSocketClientReplaced,模块级 store 不再挂死在已 dispose 实例上;shouldMaintainConnection补上processStateListeners。测试
v2_managed_process_test.go)。managed-process-store.test.mjs)、单例替换契约含登出→登录路径(gateway-socket-singleton.test.mjs)。markdown-assets既有失败(main 干净树同样失败,与本 PR 无关);gateway Go websocket 包全过;两端 tsc、biome、check-ui-boundaries 干净。验证链路(定位过程中的实测)
网关广播/回放(Go 测试)、浏览器完整管线(Node 加载真实 gatewaySocket.ts + 共享 store 对接真网关)均实测健康,问题定位为上述会话本地意图与无自愈设计。