assistant: Show only configured models in the model picker (#20392)

Closes https://github.com/zed-industries/zed/issues/16568

This PR introduces some changes to how we display models in the model
selector within the assistant panel. Basically, it comes down to this:

- If you don't have any provider configured, you should see _all_
available models in the picker
- But, once you've configured some, you should _only_ see models from
them in the picker

Visually, nothing's changed much aside from the added "Configured
Models" label at the top to ensure the understanding that that's a list
of, well, configured models only. 😬

<img width="700" alt="Screenshot 2024-11-07 at 23 42 41"
src="https://github.com/user-attachments/assets/219ed386-2318-43a6-abea-1de0cda8dc53">

Release Notes:

- Change model selector in the assistant panel to only show configured
models
This commit is contained in:
Danilo Leal 2024-11-08 10:08:59 -03:00 committed by GitHub
parent 435708b615
commit 187356ab9b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 88 additions and 53 deletions

View file

@ -4507,7 +4507,6 @@ impl Render for ContextEditorToolbarItem {
fn render(&mut self, cx: &mut ViewContext<Self>) -> impl IntoElement {
let left_side = h_flex()
.group("chat-title-group")
.pl_0p5()
.gap_1()
.items_center()
.flex_grow()
@ -4598,6 +4597,7 @@ impl Render for ContextEditorToolbarItem {
.children(self.render_remaining_tokens(cx));
h_flex()
.px_0p5()
.size_full()
.gap_2()
.justify_between()