Skip to content

feat(tui): plan 卡片 /continue 恢复 + 可滚动 4 行窗口 + Ctrl+S/Ctrl+C 修复#599

Merged
lsdefine merged 2 commits into
lsdefine:mainfrom
nianyucatfish:feat/tui-continue-plan-ctrlsc
Jun 11, 2026
Merged

feat(tui): plan 卡片 /continue 恢复 + 可滚动 4 行窗口 + Ctrl+S/Ctrl+C 修复#599
lsdefine merged 2 commits into
lsdefine:mainfrom
nianyucatfish:feat/tui-continue-plan-ctrlsc

Conversation

@nianyucatfish

Copy link
Copy Markdown
Collaborator

改动

Plan 卡片

  • /continue 恢复:plan 模式判定改用日志中结构化的 enter_plan_mode tool_use(continue_cmd.find_plan_entry),不再扫聊天文本——用户打字伪造不出。is_active/resolve_path 新增 restored_path 信号,AgentSession 新增 restored_plan_path 字段;plan_scan_baseline 退化为仅供 current_step 的 📌 扫描用。
  • 可滚动 4 行任务窗口:planbar 拆为固定表头/步骤行(#planbar-head)+ 任务滚动区(#planbar-tasksmax-height:4)。最多露 4 个 TODO,其余滚轮/PageUp 翻看;去掉旧的 5 行预算与 ⋮ +N more 截断,表头与当前步骤行固定不滚。
  • TODO 标记渲染为 [ ] / [x],与 plan.md 源文件写法对齐。

输入框按键

  • Ctrl+S restore 卡死修复:恢复暂存草稿由 self.text= 改为走编辑管线(clear() + 键盘插入),避免长会话整屏 relayout 导致的数秒卡死,与 stash 清空路径对称。
  • Ctrl+C 弹回收紧:仅在该轮未被消费(agent 尚未产出回复)时才把 user 文本弹回输入框,避免已答轮次污染输入框、以及重发导致 LLM 历史重复。

涉及文件

  • frontends/continue_cmd.pyfind_plan_entry
  • frontends/plan_state.pyis_active/resolve_pathrestored_path
  • frontends/tuiapp_v2.py — restore 接线、planbar 重构、Ctrl+S/Ctrl+C 路由

测试

  • headless 挂载冒烟通过:planbar 三层结构、max-height=4、初始隐藏。
  • plan-card 判定链(find_plan_entry_resolve_stashedextractis_complete)Python 验证通过。

plan-card 恢复:plan 模式判定改用日志中结构化的 enter_plan_mode
tool_use(continue_cmd.find_plan_entry),不再扫聊天文本——用户打字
伪造不出。is_active/resolve_path 新增 restored_path 信号,AgentSession
新增 restored_plan_path 字段,plan_scan_baseline 退化为仅供 current_step
的 📌 扫描用。

Ctrl+S restore 卡死:_stash_cleanup_restore 由 self.text= 改为
clear()+_insert_via_keyboard,走编辑管线避免长会话全屏 relayout,与
stash 清空路径对称。

Ctrl+C 弹回收紧:_cmd_stop 仅在该轮未被消费(agent 尚未产出回复)时
才把 user 文本弹回输入框,避免已答轮次污染输入框 / 重发导致历史重复。
planbar 拆为固定表头/步骤行(#planbar-head)+ 任务滚动区
(#planbar-tasks,max-height:4)。最多露 4 个 TODO,其余滚轮/PageUp
翻看,去掉旧的 5 行预算与 ⋮ +N more 截断;表头与当前步骤行固定不滚。

任务标记 ☐/✔ → [ ]/[x],与 plan.md 源文件写法对齐。
@lsdefine
lsdefine merged commit e38f233 into lsdefine:main Jun 11, 2026
lsdefine pushed a commit that referenced this pull request Jul 23, 2026
* feat(tui): /continue 恢复 plan 卡片 + Ctrl+S/Ctrl+C 路由修复

plan-card 恢复:plan 模式判定改用日志中结构化的 enter_plan_mode
tool_use(continue_cmd.find_plan_entry),不再扫聊天文本——用户打字
伪造不出。is_active/resolve_path 新增 restored_path 信号,AgentSession
新增 restored_plan_path 字段,plan_scan_baseline 退化为仅供 current_step
的 📌 扫描用。

Ctrl+S restore 卡死:_stash_cleanup_restore 由 self.text= 改为
clear()+_insert_via_keyboard,走编辑管线避免长会话全屏 relayout,与
stash 清空路径对称。

Ctrl+C 弹回收紧:_cmd_stop 仅在该轮未被消费(agent 尚未产出回复)时
才把 user 文本弹回输入框,避免已答轮次污染输入框 / 重发导致历史重复。

* feat(tui): plan 卡片可滚动(4 行任务窗口)+ TODO 渲染为 [ ]/[x]

planbar 拆为固定表头/步骤行(#planbar-head)+ 任务滚动区
(#planbar-tasks,max-height:4)。最多露 4 个 TODO,其余滚轮/PageUp
翻看,去掉旧的 5 行预算与 ⋮ +N more 截断;表头与当前步骤行固定不滚。

任务标记 ☐/✔ → [ ]/[x],与 plan.md 源文件写法对齐。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants