Add design tweaks to the AI configuration panel (#15894)

This PR polishes elements around setting up LLM providers on the
Assistant panel, including:

- [x] Adding banners for promoting Zed AI and to deal with the "No
provider set up" scenario
- [x] Tweaking the error popover whenever there's no API key added
- [ ] Making configuration panel scrollable

--- 

Release Notes:

- N/A

---------

Co-authored-by: Thorsten Ball <mrnugget@gmail.com>
Co-authored-by: Bennet Bo Fenner <53836821+bennetbo@users.noreply.github.com>
Co-authored-by: Marshall Bowers <1486634+maxdeviant@users.noreply.github.com>
This commit is contained in:
Danilo Leal 2024-08-08 07:12:36 -03:00 committed by GitHub
parent e69b0833aa
commit 76d58ac295
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 212 additions and 154 deletions

View file

@ -18,7 +18,7 @@ use settings::{Settings, SettingsStore};
use std::{sync::Arc, time::Duration};
use strum::IntoEnumIterator;
use theme::ThemeSettings;
use ui::{prelude::*, Indicator};
use ui::{prelude::*, Icon, IconName};
use util::ResultExt;
const PROVIDER_ID: &str = "anthropic";
@ -535,9 +535,9 @@ impl Render for ConfigurationView {
.justify_between()
.child(
h_flex()
.gap_2()
.child(Indicator::dot().color(Color::Success))
.child(Label::new("API key configured").size(LabelSize::Small)),
.gap_1()
.child(Icon::new(IconName::Check).color(Color::Success))
.child(Label::new("API key configured.")),
)
.child(
Button::new("reset-key", "Reset key")

View file

@ -18,8 +18,8 @@ use settings::{Settings, SettingsStore};
use std::time::Duration;
use strum::IntoEnumIterator;
use ui::{
div, h_flex, v_flex, Button, ButtonCommon, Clickable, Color, Context, FixedWidth, IconName,
IconPosition, IconSize, Indicator, IntoElement, Label, LabelCommon, ParentElement, Styled,
div, h_flex, v_flex, Button, ButtonCommon, Clickable, Color, Context, FixedWidth, Icon,
IconName, IconPosition, IconSize, IntoElement, Label, LabelCommon, ParentElement, Styled,
ViewContext, VisualContext, WindowContext,
};
@ -305,8 +305,8 @@ impl Render for ConfigurationView {
if self.state.read(cx).is_authenticated(cx) {
const LABEL: &str = "Authorized.";
h_flex()
.gap_2()
.child(Indicator::dot().color(Color::Success))
.gap_1()
.child(Icon::new(IconName::Check).color(Color::Success))
.child(Label::new(LABEL))
} else {
let loading_icon = svg()

View file

@ -14,7 +14,7 @@ use settings::{Settings, SettingsStore};
use std::{future, sync::Arc, time::Duration};
use strum::IntoEnumIterator;
use theme::ThemeSettings;
use ui::{prelude::*, Indicator};
use ui::{prelude::*, Icon, IconName};
use util::ResultExt;
use crate::{
@ -454,9 +454,9 @@ impl Render for ConfigurationView {
.justify_between()
.child(
h_flex()
.gap_2()
.child(Indicator::dot().color(Color::Success))
.child(Label::new("API key configured").size(LabelSize::Small)),
.gap_1()
.child(Icon::new(IconName::Check).color(Color::Success))
.child(Label::new("API key configured.")),
)
.child(
Button::new("reset-key", "Reset key")

View file

@ -16,7 +16,7 @@ use settings::{Settings, SettingsStore};
use std::{sync::Arc, time::Duration};
use strum::IntoEnumIterator;
use theme::ThemeSettings;
use ui::{prelude::*, Indicator};
use ui::{prelude::*, Icon, IconName};
use util::ResultExt;
use crate::{
@ -505,7 +505,7 @@ impl Render for ConfigurationView {
.size_full()
.on_action(cx.listener(Self::save_api_key))
.children(
INSTRUCTIONS.map(|instruction| Label::new(instruction).size(LabelSize::Small)),
INSTRUCTIONS.map(|instruction| Label::new(instruction)),
)
.child(
h_flex()
@ -530,9 +530,9 @@ impl Render for ConfigurationView {
.justify_between()
.child(
h_flex()
.gap_2()
.child(Indicator::dot().color(Color::Success))
.child(Label::new("API key configured").size(LabelSize::Small)),
.gap_1()
.child(Icon::new(IconName::Check).color(Color::Success))
.child(Label::new("API key configured.")),
)
.child(
Button::new("reset-key", "Reset key")