assistant2: Tweak the settings UI (#23845)

This PR does some somewhat light UI adjustment to the Assistant 2
settings view. The Prompt Library section should feature the default
prompts in the future, so that's why it's been separated that way.

<img width="800" alt="Screenshot 2025-01-29 at 2 59 59 PM"
src="https://github.com/user-attachments/assets/7b033bde-51ab-44d5-9e53-3f72b8ff5f51"
/>

Release Notes:

- N/A
This commit is contained in:
Danilo Leal 2025-01-29 16:20:09 -03:00 committed by GitHub
parent a03b7624f1
commit f8dddf0a5c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 82 additions and 50 deletions

View file

@ -689,7 +689,7 @@ impl Render for ConfigurationView {
.child(h_flex().child(Label::new(INSTRUCTIONS[1])).child(
Button::new("anthropic_console", ANTHROPIC_CONSOLE_URL)
.style(ButtonStyle::Subtle)
.icon(IconName::ExternalLink)
.icon(IconName::ArrowUpRight)
.icon_size(IconSize::XSmall)
.icon_color(Color::Muted)
.on_click(move |_, _, cx| cx.open_url(ANTHROPIC_CONSOLE_URL))
@ -703,6 +703,8 @@ impl Render for ConfigurationView {
.px_2()
.py_1()
.bg(cx.theme().colors().editor_background)
.border_1()
.border_color(cx.theme().colors().border_variant)
.rounded_md()
.child(self.render_api_key_editor(cx)),
)

View file

@ -506,7 +506,7 @@ impl Render for ConfigurationView {
h_flex().child(Label::new(INSTRUCTIONS[1])).child(
Button::new("deepseek_console", DEEPSEEK_CONSOLE_URL)
.style(ButtonStyle::Subtle)
.icon(IconName::ExternalLink)
.icon(IconName::ArrowUpRight)
.icon_size(IconSize::XSmall)
.icon_color(Color::Muted)
.on_click(move |_, _window, cx| cx.open_url(DEEPSEEK_CONSOLE_URL)),
@ -520,12 +520,14 @@ impl Render for ConfigurationView {
.px_2()
.py_1()
.bg(cx.theme().colors().editor_background)
.border_1()
.border_color(cx.theme().colors().border_variant)
.rounded_md()
.child(self.render_api_key_editor(cx)),
)
.child(
Label::new(format!(
"Or set {} environment variable",
"Or set the {} environment variable.",
DEEPSEEK_API_KEY_VAR
))
.size(LabelSize::Small),

View file

@ -452,7 +452,7 @@ impl Render for ConfigurationView {
.child(h_flex().child(Label::new(INSTRUCTIONS[1])).child(
Button::new("google_console", GOOGLE_CONSOLE_URL)
.style(ButtonStyle::Subtle)
.icon(IconName::ExternalLink)
.icon(IconName::ArrowUpRight)
.icon_size(IconSize::XSmall)
.icon_color(Color::Muted)
.on_click(move |_, _, cx| cx.open_url(GOOGLE_CONSOLE_URL))
@ -466,6 +466,8 @@ impl Render for ConfigurationView {
.px_2()
.py_1()
.bg(cx.theme().colors().editor_background)
.border_1()
.border_color(cx.theme().colors().border_variant)
.rounded_md()
.child(self.render_api_key_editor(cx)),
)

View file

@ -413,8 +413,7 @@ impl Render for ConfigurationView {
let lmstudio_reqs =
"To use LM Studio as a provider for Zed assistant, it needs to be running with at least one model downloaded.";
let mut inline_code_bg = cx.theme().colors().editor_background;
inline_code_bg.fade_out(0.5);
let inline_code_bg = cx.theme().colors().editor_foreground.opacity(0.05);
if self.loading_models_task.is_some() {
div().child(Label::new("Loading models...")).into_any()
@ -432,7 +431,7 @@ impl Render for ConfigurationView {
.child(
h_flex()
.gap_0p5()
.child(Label::new("To get your first model, try running "))
.child(Label::new("To get your first model, try running"))
.child(
div()
.bg(inline_code_bg)
@ -457,7 +456,7 @@ impl Render for ConfigurationView {
this.child(
Button::new("lmstudio-site", "LM Studio")
.style(ButtonStyle::Subtle)
.icon(IconName::ExternalLink)
.icon(IconName::ArrowUpRight)
.icon_size(IconSize::XSmall)
.icon_color(Color::Muted)
.on_click(move |_, _window, cx| {
@ -472,7 +471,7 @@ impl Render for ConfigurationView {
"Download LM Studio",
)
.style(ButtonStyle::Subtle)
.icon(IconName::ExternalLink)
.icon(IconName::ArrowUpRight)
.icon_size(IconSize::XSmall)
.icon_color(Color::Muted)
.on_click(move |_, _window, cx| {
@ -485,7 +484,7 @@ impl Render for ConfigurationView {
.child(
Button::new("view-models", "Model Catalog")
.style(ButtonStyle::Subtle)
.icon(IconName::ExternalLink)
.icon(IconName::ArrowUpRight)
.icon_size(IconSize::XSmall)
.icon_color(Color::Muted)
.on_click(move |_, _window, cx| {

View file

@ -452,8 +452,7 @@ impl Render for ConfigurationView {
let ollama_reqs =
"Ollama must be running with at least one model installed to use it in the assistant.";
let mut inline_code_bg = cx.theme().colors().editor_background;
inline_code_bg.fade_out(0.5);
let inline_code_bg = cx.theme().colors().editor_foreground.opacity(0.05);
if self.loading_models_task.is_some() {
div().child(Label::new("Loading models...")).into_any()
@ -496,7 +495,7 @@ impl Render for ConfigurationView {
this.child(
Button::new("ollama-site", "Ollama")
.style(ButtonStyle::Subtle)
.icon(IconName::ExternalLink)
.icon(IconName::ArrowUpRight)
.icon_size(IconSize::XSmall)
.icon_color(Color::Muted)
.on_click(move |_, _, cx| cx.open_url(OLLAMA_SITE))
@ -509,7 +508,7 @@ impl Render for ConfigurationView {
"Download Ollama",
)
.style(ButtonStyle::Subtle)
.icon(IconName::ExternalLink)
.icon(IconName::ArrowUpRight)
.icon_size(IconSize::XSmall)
.icon_color(Color::Muted)
.on_click(move |_, _, cx| {
@ -522,7 +521,7 @@ impl Render for ConfigurationView {
.child(
Button::new("view-models", "All Models")
.style(ButtonStyle::Subtle)
.icon(IconName::ExternalLink)
.icon(IconName::ArrowUpRight)
.icon_size(IconSize::XSmall)
.icon_color(Color::Muted)
.on_click(move |_, _, cx| cx.open_url(OLLAMA_LIBRARY_URL)),

View file

@ -502,7 +502,7 @@ impl Render for ConfigurationView {
.child(h_flex().child(Label::new(INSTRUCTIONS[1])).child(
Button::new("openai_console", OPENAI_CONSOLE_URL)
.style(ButtonStyle::Subtle)
.icon(IconName::ExternalLink)
.icon(IconName::ArrowUpRight)
.icon_size(IconSize::XSmall)
.icon_color(Color::Muted)
.on_click(move |_, _, cx| cx.open_url(OPENAI_CONSOLE_URL))
@ -518,6 +518,8 @@ impl Render for ConfigurationView {
.px_2()
.py_1()
.bg(cx.theme().colors().editor_background)
.border_1()
.border_color(cx.theme().colors().border_variant)
.rounded_md()
.child(self.render_api_key_editor(cx)),
)