feat(desktop): Plans 面板完整实现 + 计划取消修复#2072
Conversation
- 右侧上下文面板新增 plan tab,支持完整的计划列表视图 - CtxPlan 组件实现 master-detail 分栏布局:左侧 130px 计划列表 + 右侧 Markdown 正文 - 列表条目显示状态徽章(进行中 / 待审批 / 细化中 / 已完成 / 已取消) - 分栏模式下列表行截断显示计划名,鼠标悬停展示主题风格自定义 tooltip - 新增 ArchivedPlan 类型,记录 plan/summary/steps/completedStepIds/archivedAt/status - planArchived 状态加入 reducer,并在以下时机自动归档: - dismiss_plan(计划完成) - plan_cleared(计划被清除) - 取消审批(status: cancelled) - revision_required 时将细化中的计划归档 - localStorage 存储按工作区隔离:key 改为 reasonix:planArchived:<btoa(workspaceDir)> - workspaceDir 首次加载或变更时通过 plans_loaded_for_workspace action 按项目加载历史 - clear / session_loaded / settings workspaceDir 变更时同步清空 planArchived - PendingPlan 新增 refining 字段 - 点击细化后计划在列表中原地更新为细化中状态,显示脉冲动效,不新增条目 - plan_required 收到新计划时,若存在 refining 项则原地替换 - 计划待审批数增加时自动打开右侧面板、切换到 plan tab、折叠左侧 sidebar - 审批完成后自动释放 sidebar 折叠 - PlanApprovalCard 不再渲染完整计划正文(p.plan Markdown) - 改为:细化进度条 + 摘要(如有)+ 完整计划见右侧计划面板引导文字 - 减少对话流长度,完整内容由右侧面板承载 - plan_response cancel 处理中新增 abortTurn(tab) 调用 - 修复:取消后 agent loop 继续运行导致 AI 重新输出计划的问题 - 顺序:先 abort 中断 loop,再 resolve pauseGate 清理 Promise - 新增 src/cli/ui/PlanPanel.tsx 统一右侧计划面板,覆盖 pending/refining/executing/checkpoint/revising 五种状态 - App.tsx 布局重构为左右分栏:计划激活时左侧对话列 35% 宽度,右侧面板 flexGrow=1 自动撑满 - 细化流程改为行内编辑:计划正文保持在右侧可见,文本输入框渲染在下方 - LiveActivityArea 新增 suppressPlanLiveRow 避免左右重复 - Plans master-detail 分栏布局(mem--split) - 紧凑列表 mem-row[data-compact]:ellipsis 截断 + flex 布局 - 计划细化脉冲动效(plan-refining-bar / plan-refining-dot) - 自定义计划名 tooltip(plan-name-tooltip):主题色 card/border/shadow 变量,rise 动画 - 审批卡片引导文字(plan-view-hint) 新增键:planTitle, planActive, planPending, planRefining, planCancelled, planArchived, planUntitled, planRefiningInProgress, noPlansMsg, planViewInPanel
esengine
left a comment
There was a problem hiding this comment.
Thanks for the work — the Desktop Plans panel direction looks promising. But this PR bundles too much and I can't merge it as one piece.
Blocker: PR is CONFLICTING. Please rebase onto current main.
Blocker: undeclared TUI scope. The PR description is entirely about the Desktop Plans panel, but the diff also adds a brand-new src/cli/ui/PlanPanel.tsx and reshapes src/cli/ui/App.tsx into a 35% / 65% split layout. That's a major TUI change — the TUI is the primary experience for most users and a layout reflow needs its own focused review, not a buried hunk inside a desktop-features PR. Please pull it out.
Please split into separate PRs:
-
fix(desktop): abort agent loop on plan_response cancel— just the+abortTurn(tab)hunk insrc/cli/commands/desktop.ts(~1 line + maybe a regression test). This is a real bug, lands fast, separately verifiable. -
feat(desktop): Plans tab in context panel— the Desktop work only. Filled-out PR template (What / Why / How to verify). All four locales (you already cover en/zh-CN/ja/de). Independent. -
feat(cli): split-pane plan panel in TUI— the TUI changes (newPlanPanel.tsx, App.tsx layout split,suppressPlanLiveRow, allsrc/cli/ui/*edits). Its own PR with screenshots / asciinema so the layout change is visible in review. I'd want to discuss this one before you implement further — 35/65 split fundamentally changes the TUI shape and I want to think about it before code lands.
Other notes once split:
- PR template is empty (What/Why/How to verify all blank). Please fill it in for each split PR — that's the entry point reviewers read first.
- Per-workspace
localStoragekeying for archived plans is a nice touch; make sure it's covered bydesktop/src/App.test.ts(and the workspace-change clears).
Closing question on the design: with the Plans panel taking over the right side, what happens to other context-panel tabs the user pinned? Is the panel forcibly switched to Plans on every new plan_required? I want to make sure we're not yanking attention away from whatever the user opened the panel to look at.
cb4b859 to
14d610d
Compare
esengine
left a comment
There was a problem hiding this comment.
Thanks for the screenshots — the Plans panel UI does look good. But the three blockers from my original review are still open; the latest push added screenshots, not the structural changes:
- Still CONFLICTING — please rebase onto current
main(a lot has merged since). - Still bundled (+1387/-311 across 16 files). This needs to be split. The Desktop Plans panel itself is the reviewable unit; the undeclared TUI-side changes and the other surfaces folded in here make it impossible to review (or revert) as one piece. Please pull this down to just the Desktop Plans panel + the plan-cancel fix, and split the rest into follow-up PRs.
- Once split + rebased, make the description match the actual diff.
The direction is good and I want to land it — but it has to come in as a focused, conflict-free, scoped PR. Happy to review the split pieces quickly.
我已经推送了新的PR,关于你问到的是否会影响到用户当前的注意里,正常情况是不会的,只有生成计划文档时才会自动打开,这个是为了方便用户在开发过程中更加方便的去查看计划文档,如果是其他地方生成md 是不会自动打开,只有生成计划才会自动打开,具体的呢可以参考一下我上传的图片,因为客户区有限,所以左侧的栏目会自动收起来,正常来讲,当用户有生成计划的需求时,用户就已经处于等待查看计划的状态,所以应该是以计划显示为主,让用户更加方便的查看计划和查看对话区的过程,关于TUI 35% / 65% 分区,其实他是 计划面板的一个分区,当用户主动打开计划面板时 会加载计划列表,这时是不显示计划详情的,当显示计划时35% (计划状态-计划名)/ 65%(计划内容) |
|
Closing as superseded by your split — exactly the breakdown I asked for: #2225 (plan-cancel abort, merged), #2227 (TUI split-pane plan panel, in review), #2226 (desktop Plans tab, needs a rebase). Reviewing those individually is much cleaner than this bundled +1387 version. Thanks for splitting it up — let's land the focused pieces. |


右侧上下文面板新增 plan tab,支持完整的计划列表视图
CtxPlan 组件实现 master-detail 分栏布局:左侧 130px 计划列表 + 右侧 Markdown 正文
列表条目显示状态徽章(进行中 / 待审批 / 细化中 / 已完成 / 已取消)
分栏模式下列表行截断显示计划名,鼠标悬停展示主题风格自定义 tooltip
新增 ArchivedPlan 类型,记录 plan/summary/steps/completedStepIds/archivedAt/status
planArchived 状态加入 reducer,并在以下时机自动归档:
localStorage 存储按工作区隔离:key 改为 reasonix:planArchived:<btoa(workspaceDir)>
workspaceDir 首次加载或变更时通过 plans_loaded_for_workspace action 按项目加载历史
clear / session_loaded / settings workspaceDir 变更时同步清空 planArchived
PendingPlan 新增 refining 字段
点击细化后计划在列表中原地更新为细化中状态,显示脉冲动效,不新增条目
plan_required 收到新计划时,若存在 refining 项则原地替换
计划待审批数增加时自动打开右侧面板、切换到 plan tab、折叠左侧 sidebar
审批完成后自动释放 sidebar 折叠
PlanApprovalCard 不再渲染完整计划正文(p.plan Markdown)
改为:细化进度条 + 摘要(如有)+ 完整计划见右侧计划面板引导文字
减少对话流长度,完整内容由右侧面板承载
plan_response cancel 处理中新增 abortTurn(tab) 调用
修复:取消后 agent loop 继续运行导致 AI 重新输出计划的问题
顺序:先 abort 中断 loop,再 resolve pauseGate 清理 Promise
新增 src/cli/ui/PlanPanel.tsx 统一右侧计划面板,覆盖 pending/refining/executing/checkpoint/revising 五种状态
App.tsx 布局重构为左右分栏:计划激活时左侧对话列 35% 宽度,右侧面板 flexGrow=1 自动撑满
细化流程改为行内编辑:计划正文保持在右侧可见,文本输入框渲染在下方
LiveActivityArea 新增 suppressPlanLiveRow 避免左右重复
Plans master-detail 分栏布局(mem--split)
紧凑列表 mem-row[data-compact]:ellipsis 截断 + flex 布局
计划细化脉冲动效(plan-refining-bar / plan-refining-dot)
自定义计划名 tooltip(plan-name-tooltip):主题色 card/border/shadow 变量,rise 动画
审批卡片引导文字(plan-view-hint)
新增键:planTitle, planActive, planPending, planRefining, planCancelled, planArchived, planUntitled, planRefiningInProgress, noPlansMsg, planViewInPanel
What
Why
How to verify
Checklist
npm run verifypasses locally (lint + typecheck + tests + comment-policy gate)Co-Authored-By: Claudetrailer in commitsCHANGELOG.md— release notes are maintainer-written at release time