Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Fix AI Context menu text wrapping causing overlap (#21438)
Jason Leea8c7e610211d
diff --git a/crates/assistant/src/slash_command_picker.rs b/crates/assistant/src/slash_command_picker.rsindex 8e797d61842..215888540a9 100644--- a/crates/assistant/src/slash_command_picker.rs+++ b/crates/assistant/src/slash_command_picker.rs@@ -2,7 +2,7 @@ use std::sync::Arc;use gpui::{AnyElement, DismissEvent, SharedString, Task, WeakView};use picker::{Picker, PickerDelegate, PickerEditorPosition};-use ui::{prelude::*, ListItem, ListItemSpacing, PopoverMenu, PopoverTrigger};+use ui::{prelude::*, ListItem, ListItemSpacing, PopoverMenu, PopoverTrigger, Tooltip};use crate::assistant_panel::ContextEditor;use crate::SlashCommandWorkingSet;@@ -177,11 +177,17 @@ impl PickerDelegate for SlashCommandDelegate {.inset(true).spacing(ListItemSpacing::Dense).selected(selected)+ .tooltip({+ let description = info.description.clone();+ move |cx| cx.new_view(|_| Tooltip::new(description.clone())).into()+ }).child(v_flex().group(format!("command-entry-label-{ix}")).w_full()+ .py_0p5().min_w(px(250.))+ .max_w(px(400.)).child(h_flex().gap_1p5()@@ -192,7 +198,7 @@ impl PickerDelegate for SlashCommandDelegate {{label.push_str(&args);}- Label::new(label).size(LabelSize::Small)+ Label::new(label).single_line().size(LabelSize::Small)})).children(info.args.clone().filter(|_| !selected).map(|args| {@@ -200,6 +206,7 @@ impl PickerDelegate for SlashCommandDelegate {.font_buffer(cx).child(Label::new(args)+ .single_line().size(LabelSize::Small).color(Color::Muted),)@@ -210,9 +217,11 @@ impl PickerDelegate for SlashCommandDelegate {)),).child(- Label::new(info.description.clone())- .size(LabelSize::Small)- .color(Color::Muted),+ div().overflow_hidden().text_ellipsis().child(+ Label::new(info.description.clone())+ .size(LabelSize::Small)+ .color(Color::Muted),+ ),),),),