agent: Adjust MCP section in the settings view (#28615)

Mentioning "MCP" more prominently, adding tool descriptions in the icon
button tooltip, and other UI adjustments.

<img
src="https://github.com/user-attachments/assets/e021b3be-99b8-454c-b5fd-0221a7947a35"
width="600" />

Release Notes:

- N/A
This commit is contained in:
Danilo Leal 2025-04-11 21:39:57 -03:00 committed by GitHub
parent 17719f9f87
commit fb78cbbd45
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 43 additions and 20 deletions

View file

@ -9,6 +9,7 @@ pub struct Disclosure {
id: ElementId,
is_open: bool,
selected: bool,
disabled: bool,
on_toggle: Option<Arc<dyn Fn(&ClickEvent, &mut Window, &mut App) + 'static>>,
cursor_style: CursorStyle,
opened_icon: IconName,
@ -21,6 +22,7 @@ impl Disclosure {
id: id.into(),
is_open,
selected: false,
disabled: false,
on_toggle: None,
cursor_style: CursorStyle::PointingHand,
opened_icon: IconName::ChevronDown,
@ -45,6 +47,11 @@ impl Disclosure {
self.closed_icon = icon;
self
}
pub fn disabled(mut self, disabled: bool) -> Self {
self.disabled = disabled;
self
}
}
impl Toggleable for Disclosure {
@ -78,6 +85,7 @@ impl RenderOnce for Disclosure {
.shape(IconButtonShape::Square)
.icon_color(Color::Muted)
.icon_size(IconSize::Small)
.disabled(self.disabled)
.toggle_state(self.selected)
.when_some(self.on_toggle, move |this, on_toggle| {
this.on_click(move |event, window, cx| on_toggle(event, window, cx))
@ -120,13 +128,7 @@ impl Component for Disclosure {
"Toggleable",
v_flex()
.gap_2()
.child(
Disclosure::new("interactive", false)
// .on_toggle(Some(Arc::new(|_, _, cx| {
// cx.refresh();
// })))
.into_any_element(),
)
.child(Disclosure::new("interactive", false).into_any_element())
.child(Label::new("Click to toggle"))
.into_any_element(),
)],