From 6384966ab546bad67e8ce16f13d37abe32ea363d Mon Sep 17 00:00:00 2001 From: Danilo Leal <67129314+danilo-leal@users.noreply.github.com> Date: Mon, 15 Sep 2025 13:35:39 -0300 Subject: [PATCH] agent: Improve some items in the settings view UI (#38199) All described in each commit; mostly small things, simplifying/clearing up the UI. Release Notes: - N/A --- crates/agent_ui/src/agent_configuration.rs | 58 +++++++++++++++------- 1 file changed, 40 insertions(+), 18 deletions(-) diff --git a/crates/agent_ui/src/agent_configuration.rs b/crates/agent_ui/src/agent_configuration.rs index e52b818eb3bac1966b66611efd5b5c59485f4a0a..aacfb423539496e6c5cb93ad8c12f1ed8ede346a 100644 --- a/crates/agent_ui/src/agent_configuration.rs +++ b/crates/agent_ui/src/agent_configuration.rs @@ -274,13 +274,28 @@ impl AgentConfiguration { *is_expanded = !*is_expanded; } })), - ) - .when(provider.is_authenticated(cx), |parent| { + ), + ) + .child( + v_flex() + .w_full() + .px_2() + .gap_1() + .when(is_expanded, |parent| match configuration_view { + Some(configuration_view) => parent.child(configuration_view), + None => parent.child(Label::new(format!( + "No configuration view for {provider_name}", + ))), + }) + .when(is_expanded && provider.is_authenticated(cx), |parent| { parent.child( Button::new( SharedString::from(format!("new-thread-{provider_id}")), "Start New Thread", ) + .full_width() + .style(ButtonStyle::Filled) + .layer(ElevationIndex::ModalSurface) .icon_position(IconPosition::Start) .icon(IconName::Thread) .icon_size(IconSize::Small) @@ -297,17 +312,6 @@ impl AgentConfiguration { ) }), ) - .child( - div() - .w_full() - .px_2() - .when(is_expanded, |parent| match configuration_view { - Some(configuration_view) => parent.child(configuration_view), - None => parent.child(Label::new(format!( - "No configuration view for {provider_name}", - ))), - }), - ) } fn render_provider_configuration_section( @@ -561,11 +565,28 @@ impl AgentConfiguration { .color(Color::Muted), ), ) - .children( - context_server_ids.into_iter().map(|context_server_id| { - self.render_context_server(context_server_id, window, cx) - }), - ) + .map(|parent| { + if context_server_ids.is_empty() { + parent.child( + h_flex() + .p_4() + .justify_center() + .border_1() + .border_dashed() + .border_color(cx.theme().colors().border.opacity(0.6)) + .rounded_sm() + .child( + Label::new("No MCP servers added yet.") + .color(Color::Muted) + .size(LabelSize::Small), + ), + ) + } else { + parent.children(context_server_ids.into_iter().map(|context_server_id| { + self.render_context_server(context_server_id, window, cx) + })) + } + }) .child( h_flex() .justify_between() @@ -1128,6 +1149,7 @@ impl AgentConfiguration { SharedString::from(format!("start_acp_thread-{name}")), "Start New Thread", ) + .layer(ElevationIndex::ModalSurface) .label_size(LabelSize::Small) .icon(IconName::Thread) .icon_position(IconPosition::Start)