feat: 主要围绕“工作区”补齐了分支管理、阻塞守卫和差异查看能力,并把相关状态逐步收敛到统一的 WorkspaceModel。#2
feat: 主要围绕“工作区”补齐了分支管理、阻塞守卫和差异查看能力,并把相关状态逐步收敛到统一的 WorkspaceModel。#2liangriyu wants to merge 23 commits intoLeibnizhu:mainfrom
WorkspaceModel。#2Conversation
There was a problem hiding this comment.
Pull request overview
该 PR 以“工作区(cwd)”为核心,补齐了分支管理、阻塞守卫、差异面板多模式与 Git Status 一等视图等能力,并将相关状态逐步收敛到统一的 WorkspaceModel,让页面与组件更多只消费单一工作区模型而不是拼装多份真相。
Changes:
- 新增/扩展 bridge 接口:分支查询与切换/创建、模式化 workspace diff、结构化 Git status、persisted approvals 账本与 dismiss 能力。
- 前端引入并推广
WorkspaceModel:统一聚合分支、guard、gitStatus、diff、approvals 与 UI 状态;支持 baseBranch 按 cwd 持久化。 - UI 升级:分支 chip 变为可交互菜单(含阻塞原因与 persisted 记录忽略),差异面板升级为多模式(含 Git Status tab + baseBranch 选择器)。
Reviewed changes
Copilot reviewed 25 out of 25 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| src/types/codex.ts | 新增 persisted approvals、workspace diff modes/snapshot、WorkspaceModel 等统一类型定义 |
| src/server/codexAppServerBridge.ts | 增加 persisted approvals 账本、git status/branches/branch ops、workspace-diff-mode(含 baseBranch 推导)等能力 |
| src/i18n/uiText.ts | 新增分支菜单、diff panel 多模式、Git status/baseBranch 等 UI 文案 |
| src/composables/useDesktopState.ts | 引入 workspaceByCwd/WorkspaceModel 聚合逻辑,新增分支/guard/diff/persisted approvals/baseBranch 等状态与动作 |
| src/composables/desktop-state/storage.ts | 增加 baseBranch 的 cwd -> branch 本地持久化读写 |
| src/components/content/ThreadComposer.vue | 分支 chip 升级为菜单:显示阻塞原因、dirty 摘要、persisted records 并支持单条忽略 |
| src/components/content/CodePreviewPanel.vue | workspace 面板升级:多模式 tabs、Git Status 视图、branch 模式 baseBranch 选择与 ref/warning/empty state |
| src/App.vue | 页面编排改为消费 workspace store:打开/切换面板模式、baseBranch 更新、分支操作联动刷新 |
| src/api/codexRpcClient.ts | 新增 persisted requests 读取、dismiss、workspace-diff-mode 请求等 HTTP 调用封装 |
| src/api/codexGateway.ts | 新增/归一化 workspace git status/branches、branch ops、persisted approvals、workspace diff snapshot 等高层 API |
| docs/plans/2026-04-01-workspace-model-unification-plan.md | 工作区模型收敛实施计划与结果记录 |
| docs/plans/2026-04-01-workspace-model-unification-design.md | 工作区模型收敛设计文档 |
| docs/plans/2026-04-01-workspace-guard-phase2-persisted-approvals-plan.md | 守卫 phase2(persisted approvals)计划与结果 |
| docs/plans/2026-04-01-workspace-guard-phase1-plan.md | 守卫 phase1(结构化 git status)计划与结果 |
| docs/plans/2026-04-01-workspace-guard-consistency-design.md | 守卫一致性设计文档 |
| docs/plans/2026-04-01-persisted-approval-dismiss-plan.md | persisted approvals dismiss 计划与结果 |
| docs/plans/2026-04-01-persisted-approval-dismiss-design.md | persisted approvals dismiss 设计文档 |
| docs/plans/2026-04-01-git-status-base-branch-plan.md | Git Status + baseBranch 配置计划与结果 |
| docs/plans/2026-04-01-git-status-base-branch-design.md | Git Status + baseBranch 配置设计文档 |
| docs/plans/2026-04-01-diff-panel-implementation-plan.md | diff panel modes 计划与结果 |
| docs/plans/2026-04-01-diff-panel-design.md | diff panel 设计文档 |
| docs/plans/2026-04-01-base-branch-auto-detection-plan.md | baseBranch 自动推导计划 |
| docs/plans/2026-04-01-base-branch-auto-detection-design.md | baseBranch 自动推导设计文档 |
| docs/plans/2026-03-31-branch-management-design.md | 分支能力设计文档 |
| docs/plans/2026-03-31-branch-capability-phase1-plan.md | 分支能力 phase1 计划与结果 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 992d11ddba
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
# Conflicts: # .gitignore
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 38103c6ed2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
概要
这个 PR 主要增强了工作区维度的分支管理和差异查看体验。
本次改动包括:
baseBranch的本地自动推导策略WorkspaceModel收敛工作区状态主要改动
baseBranch支持按工作区保存,并在未显式配置时基于本地 Git 信息自动推导。验证
npm run build