From f14a923952277b3b123a7a14d9d1b094f56995db Mon Sep 17 00:00:00 2001 From: Danilo Leal <67129314+danilo-leal@users.noreply.github.com> Date: Thu, 12 Jun 2025 11:04:15 -0300 Subject: [PATCH] agent: Allow to see the review button while generating (#32610) I think we mistakenly added an early return for the review multibuffer button if `has_pending_edit_tool_uses` is true. It is totally fine _to access_ the review multibuffer while that's happening. It's another thing to _accept and reject_ changes while they're still ongoing! Release Notes: - agent: Fixed access to the review multibuffer from the agent panel. --- crates/agent/src/message_editor.rs | 66 +++++++++++++----------------- 1 file changed, 28 insertions(+), 38 deletions(-) diff --git a/crates/agent/src/message_editor.rs b/crates/agent/src/message_editor.rs index 0e8a0cf93d2f988b84782f07d7e1b89ff37055a7..6544eee4f6d349a3387d4b51eeac71066d16e17d 100644 --- a/crates/agent/src/message_editor.rs +++ b/crates/agent/src/message_editor.rs @@ -428,10 +428,6 @@ impl MessageEditor { } fn handle_review_click(&mut self, window: &mut Window, cx: &mut Context) { - if self.thread.read(cx).has_pending_edit_tool_uses() { - return; - } - self.edits_expanded = true; AgentDiffPane::deploy(self.thread.clone(), self.workspace.clone(), window, cx).log_err(); cx.notify(); @@ -641,42 +637,36 @@ impl MessageEditor { .border_color(cx.theme().colors().border) .child( h_flex() - .items_start() .justify_between() .child(self.context_strip.clone()) - .child( - h_flex() - .gap_1() - .when(focus_handle.is_focused(window), |this| { - this.child( - IconButton::new("toggle-height", expand_icon) - .icon_size(IconSize::XSmall) - .icon_color(Color::Muted) - .tooltip({ - let focus_handle = focus_handle.clone(); - move |window, cx| { - let expand_label = if is_editor_expanded { - "Minimize Message Editor".to_string() - } else { - "Expand Message Editor".to_string() - }; - - Tooltip::for_action_in( - expand_label, - &ExpandMessageEditor, - &focus_handle, - window, - cx, - ) - } - }) - .on_click(cx.listener(|_, _, window, cx| { - window - .dispatch_action(Box::new(ExpandMessageEditor), cx); - })), - ) - }), - ), + .when(focus_handle.is_focused(window), |this| { + this.child( + IconButton::new("toggle-height", expand_icon) + .icon_size(IconSize::XSmall) + .icon_color(Color::Muted) + .tooltip({ + let focus_handle = focus_handle.clone(); + move |window, cx| { + let expand_label = if is_editor_expanded { + "Minimize Message Editor".to_string() + } else { + "Expand Message Editor".to_string() + }; + + Tooltip::for_action_in( + expand_label, + &ExpandMessageEditor, + &focus_handle, + window, + cx, + ) + } + }) + .on_click(cx.listener(|_, _, window, cx| { + window.dispatch_action(Box::new(ExpandMessageEditor), cx); + })), + ) + }), ) .child( v_flex()