assistant: Tweak the model selector design (#19704)

Exploring using the UI font for it, as it is more common for dropdowns
and popovers throughout the app. Feeling like it makes it lighter and
also shorter in width!

| Before | After |
|--------|--------|
| <img width="1296" alt="Screenshot 2024-10-24 at 16 39 04"
src="https://github.com/user-attachments/assets/0412f922-77a9-4d83-adf9-5632534d6c5b">
| <img width="1296" alt="Screenshot 2024-10-24 at 16 38 26"
src="https://github.com/user-attachments/assets/8bf52ba7-fda7-4437-b53e-903c282f2931">
|

Release Notes:

- N/A
This commit is contained in:
Danilo Leal 2024-10-24 19:37:09 -03:00 committed by GitHub
parent d45b830412
commit 6cd5c9e32f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -158,39 +158,34 @@ impl PickerDelegate for ModelPickerDelegate {
.spacing(ListItemSpacing::Sparse) .spacing(ListItemSpacing::Sparse)
.selected(selected) .selected(selected)
.start_slot( .start_slot(
div().pr_1().child( div().pr_0p5().child(
Icon::new(model_info.icon) Icon::new(model_info.icon)
.color(Color::Muted) .color(Color::Muted)
.size(IconSize::Medium), .size(IconSize::Medium),
), ),
) )
.child( .child(
h_flex() h_flex().w_full().justify_between().min_w(px(200.)).child(
.w_full() h_flex()
.justify_between() .gap_1p5()
.font_buffer(cx) .child(Label::new(model_info.model.name().0.clone()))
.min_w(px(240.)) .child(
.child( Label::new(provider_name)
h_flex() .size(LabelSize::XSmall)
.gap_2() .color(Color::Muted),
.child(Label::new(model_info.model.name().0.clone())) )
.child( .children(match model_info.availability {
Label::new(provider_name) LanguageModelAvailability::Public => None,
.size(LabelSize::XSmall) LanguageModelAvailability::RequiresPlan(Plan::Free) => None,
.color(Color::Muted), LanguageModelAvailability::RequiresPlan(Plan::ZedPro) => {
) show_badges.then(|| {
.children(match model_info.availability { Label::new("Pro")
LanguageModelAvailability::Public => None, .size(LabelSize::XSmall)
LanguageModelAvailability::RequiresPlan(Plan::Free) => None, .color(Color::Muted)
LanguageModelAvailability::RequiresPlan(Plan::ZedPro) => { })
show_badges.then(|| { }
Label::new("Pro") }),
.size(LabelSize::XSmall) ),
.color(Color::Muted)
})
}
}),
),
) )
.end_slot(div().when(model_info.is_selected, |this| { .end_slot(div().when(model_info.is_selected, |this| {
this.child( this.child(
@ -212,7 +207,7 @@ impl PickerDelegate for ModelPickerDelegate {
h_flex() h_flex()
.w_full() .w_full()
.border_t_1() .border_t_1()
.border_color(cx.theme().colors().border) .border_color(cx.theme().colors().border_variant)
.p_1() .p_1()
.gap_4() .gap_4()
.justify_between() .justify_between()