TUI: prompt to implement plan and switch to Execute (#9712)

## Summary
- Replace the plan‑implementation prompt with a standard selection
popup.
- “Yes” submits a user turn in Execute via a dedicated app event to
preserve normal transcript behavior.
- “No” simply dismisses the popup.

<img width="977" height="433" alt="Screenshot 2026-01-22 at 2 00 54 PM"
src="https://github.com/user-attachments/assets/91fad06f-7b7a-4cd8-9051-f28a19b750b2"
/>

## Changes
- Add a plan‑implementation popup using `SelectionViewParams`.
- Add `SubmitUserMessageWithMode` so “Yes” routes through
`submit_user_message` (ensures user history + separator state).
- Track `saw_plan_update_this_turn` so the prompt appears even when only
`update_plan` is emitted.
- Suppress the plan popup on replayed turns, when messages are queued,
or when a rate‑limit prompt is pending.
- Add `execute_mode` helper for collaboration modes.
- Add tests for replay/queued/rate‑limit guards and plan update without
final message.
- Add snapshots for both the default and “No”‑selected popup states.
This commit is contained in:
charley-oai
2026-01-22 16:25:50 -08:00
committed by GitHub
parent e117a3ff33
commit 0e79d239ed
7 changed files with 307 additions and 4 deletions

View File

@@ -48,3 +48,10 @@ pub(crate) fn next_mode(
.map_or(0, |idx| (idx + 1) % presets.len());
presets.get(next_index).cloned()
}
pub(crate) fn execute_mode(models_manager: &ModelsManager) -> Option<CollaborationMode> {
models_manager
.list_collaboration_modes()
.into_iter()
.find(|preset| mode_kind(preset) == ModeKind::Execute)
}