@@ -2,7 +2,7 @@ use std::sync::Arc;
2
2
3
3
use gpui:: { AnyElement , DismissEvent , SharedString , Task , WeakView } ;
4
4
use picker:: { Picker , PickerDelegate , PickerEditorPosition } ;
5
- use ui:: { prelude:: * , ListItem , ListItemSpacing , PopoverMenu , PopoverTrigger } ;
5
+ use ui:: { prelude:: * , ListItem , ListItemSpacing , PopoverMenu , PopoverTrigger , Tooltip } ;
6
6
7
7
use crate :: assistant_panel:: ContextEditor ;
8
8
use crate :: SlashCommandWorkingSet ;
@@ -177,11 +177,17 @@ impl PickerDelegate for SlashCommandDelegate {
177
177
. inset ( true )
178
178
. spacing ( ListItemSpacing :: Dense )
179
179
. selected ( selected)
180
+ . tooltip ( {
181
+ let description = info. description . clone ( ) ;
182
+ move |cx| cx. new_view ( |_| Tooltip :: new ( description. clone ( ) ) ) . into ( )
183
+ } )
180
184
. child (
181
185
v_flex ( )
182
186
. group ( format ! ( "command-entry-label-{ix}" ) )
183
187
. w_full ( )
188
+ . py_0p5 ( )
184
189
. min_w ( px ( 250. ) )
190
+ . max_w ( px ( 400. ) )
185
191
. child (
186
192
h_flex ( )
187
193
. gap_1p5 ( )
@@ -192,14 +198,15 @@ impl PickerDelegate for SlashCommandDelegate {
192
198
{
193
199
label. push_str ( & args) ;
194
200
}
195
- Label :: new ( label) . size ( LabelSize :: Small )
201
+ Label :: new ( label) . single_line ( ) . size ( LabelSize :: Small )
196
202
} ) )
197
203
. children ( info. args . clone ( ) . filter ( |_| !selected) . map (
198
204
|args| {
199
205
div ( )
200
206
. font_buffer ( cx)
201
207
. child (
202
208
Label :: new ( args)
209
+ . single_line ( )
203
210
. size ( LabelSize :: Small )
204
211
. color ( Color :: Muted ) ,
205
212
)
@@ -210,9 +217,11 @@ impl PickerDelegate for SlashCommandDelegate {
210
217
) ) ,
211
218
)
212
219
. child (
213
- Label :: new ( info. description . clone ( ) )
214
- . size ( LabelSize :: Small )
215
- . color ( Color :: Muted ) ,
220
+ div ( ) . overflow_hidden ( ) . text_ellipsis ( ) . child (
221
+ Label :: new ( info. description . clone ( ) )
222
+ . size ( LabelSize :: Small )
223
+ . color ( Color :: Muted ) ,
224
+ ) ,
216
225
) ,
217
226
) ,
218
227
) ,
0 commit comments