agent_ui: Clear original agent prompt when creating a new worktree (#51839)

Before you mark this PR as ready for review, make sure that you have:
- [x] Added a solid test coverage and/or screenshots from doing manual
testing
- [x] Done a self-review taking into account security and performance
aspects
- [x] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)

Release Notes:

- N/A
This commit is contained in:
Anthony Eid authored and GitHub committed 2026-03-18 14:48:00 +00:00
1 parent 626851265f
commit af514cdfea
1 file changed
+10 -1
+10 -1
View File
@@ -3021,8 +3021,17 @@ impl AgentPanel {
multi_workspace.activate(new_workspace.clone(), cx);
})?;
this.update_in(cx, |this, _window, cx| {
this.update_in(cx, |this, window, cx| {
this.worktree_creation_status = None;
if let Some(thread_view) = this.active_thread_view(cx) {
thread_view.update(cx, |thread_view, cx| {
thread_view
.message_editor
.update(cx, |editor, cx| editor.clear(window, cx));
});
}
cx.notify();
})?;