From 42a7402cc5354fa6a3182d972fa7f551dc9760ba Mon Sep 17 00:00:00 2001 From: Danilo Leal <67129314+danilo-leal@users.noreply.github.com> Date: Thu, 24 Oct 2024 19:37:42 -0300 Subject: [PATCH] assistant: Use a labeled button for the slash command menu (#19703) This should help a bit more the discoverability of the slash commands. Release Notes: - N/A --- crates/assistant/src/assistant_panel.rs | 10 +++++----- crates/assistant/src/slash_command_picker.rs | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/crates/assistant/src/assistant_panel.rs b/crates/assistant/src/assistant_panel.rs index d4da36adedeca2cd5ae9f57cbc4158e8ce8ac486..6d525a1ff08754fee6c317d90b41e47f4d776c62 100644 --- a/crates/assistant/src/assistant_panel.rs +++ b/crates/assistant/src/assistant_panel.rs @@ -3949,7 +3949,7 @@ impl Render for ContextEditor { .bg(cx.theme().colors().editor_background) .child( h_flex() - .gap_2() + .gap_1() .child(render_inject_context_menu(cx.view().downgrade(), cx)) .child( IconButton::new("quote-button", IconName::Quote) @@ -4249,11 +4249,11 @@ fn render_inject_context_menu( slash_command_picker::SlashCommandSelector::new( commands.clone(), active_context_editor, - IconButton::new("trigger", IconName::SlashSquare) + Button::new("trigger", "Add Context") + .icon(IconName::Plus) .icon_size(IconSize::Small) - .tooltip(|cx| { - Tooltip::with_meta("Insert Context", None, "Type / to insert via keyboard", cx) - }), + .icon_position(IconPosition::Start) + .tooltip(|cx| Tooltip::text("Type / to insert via keyboard", cx)), ) } diff --git a/crates/assistant/src/slash_command_picker.rs b/crates/assistant/src/slash_command_picker.rs index 58023848b0e508eb63ccbe626cddad34cebe5c1f..35ae90d412cfa0aaa956566060fbc71d27922c25 100644 --- a/crates/assistant/src/slash_command_picker.rs +++ b/crates/assistant/src/slash_command_picker.rs @@ -178,7 +178,7 @@ impl PickerDelegate for SlashCommandDelegate { SlashCommandEntry::Info(info) => Some( ListItem::new(ix) .inset(true) - .spacing(ListItemSpacing::Sparse) + .spacing(ListItemSpacing::Dense) .selected(selected) .child( h_flex() @@ -224,7 +224,7 @@ impl PickerDelegate for SlashCommandDelegate { SlashCommandEntry::Advert { renderer, .. } => Some( ListItem::new(ix) .inset(true) - .spacing(ListItemSpacing::Sparse) + .spacing(ListItemSpacing::Dense) .selected(selected) .child(renderer(cx)), ),