From 0a132779a1a7bc55473d7dce2fd4d0d946738140 Mon Sep 17 00:00:00 2001 From: Danilo Leal <67129314+danilo-leal@users.noreply.github.com> Date: Wed, 2 Apr 2025 17:41:16 -0300 Subject: [PATCH] agent: Change loading label if command is waiting on permission (#27955) If there's a command pending confirmation, the label changes from "Generating" to "Waiting for confirmation". Release Notes: - N/A --- crates/agent/src/message_editor.rs | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/crates/agent/src/message_editor.rs b/crates/agent/src/message_editor.rs index 48a39a86b353297a6b24fbb5941149499725e5eb..538f45d9b127e39447f7e8ab8d05dc2091c14e0b 100644 --- a/crates/agent/src/message_editor.rs +++ b/crates/agent/src/message_editor.rs @@ -341,6 +341,9 @@ impl Render for MessageEditor { let is_too_long = thread.is_getting_too_long(cx); let is_model_selected = self.is_model_selected(cx); let is_editor_empty = self.is_editor_empty(cx); + let needs_confirmation = + thread.has_pending_tool_uses() && thread.tools_needing_confirmation().next().is_some(); + let submit_label_color = if is_editor_empty { Color::Muted } else { @@ -432,11 +435,17 @@ impl Render for MessageEditor { }, ), ) - .child( - Label::new("Generating…") - .size(LabelSize::XSmall) - .color(Color::Muted), - ) + .child({ + + + Label::new(if needs_confirmation { + "Waiting for confirmation…" + } else { + "Generating…" + }) + .size(LabelSize::XSmall) + .color(Color::Muted) + }) .child(ui::Divider::vertical()) .child( Button::new("cancel-generation", "Cancel")