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
This commit is contained in:
Danilo Leal 2024-10-24 19:37:42 -03:00 committed by GitHub
parent 6cd5c9e32f
commit 42a7402cc5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 7 deletions

View file

@ -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)),
)
}

View file

@ -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)),
),