Refine assistant config UI (#17871)

This PR does a little bit of a touch-up on the copywriting on the
assistant config UI. I had friends reporting to me that some of the
writing could be clearer, and hopefully, this goes into that direction!

Release Notes:

- N/A
This commit is contained in:
Danilo Leal 2024-09-16 07:12:07 -04:00 committed by GitHub
parent cdc3791544
commit 29a5def12c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 42 additions and 21 deletions

View file

@ -657,11 +657,10 @@ impl ConfigurationView {
impl Render for ConfigurationView {
fn render(&mut self, cx: &mut ViewContext<Self>) -> impl IntoElement {
const ANTHROPIC_CONSOLE_URL: &str = "https://console.anthropic.com/settings/keys";
const INSTRUCTIONS: [&str; 4] = [
"To use the assistant panel or inline assistant, you need to add your Anthropic API key.",
"You can create an API key at:",
"",
"Paste your Anthropic API key below and hit enter to use the assistant:",
const INSTRUCTIONS: [&str; 3] = [
"To use Zed's assistant with Anthropic, you need to add an API key. Follow these steps:",
"- Create one at:",
"- Paste your API key below and hit enter to use the assistant:",
];
let env_var_set = self.state.read(cx).api_key_from_env;
@ -682,7 +681,6 @@ impl Render for ConfigurationView {
)
)
.child(Label::new(INSTRUCTIONS[2]))
.child(Label::new(INSTRUCTIONS[3]))
.child(
h_flex()
.w_full()

View file

@ -358,7 +358,7 @@ impl Render for ConfigurationView {
}
_ => {
const LABEL: &str =
"To use the assistant panel or inline assistant, you must login to GitHub Copilot. Your GitHub account must have an active Copilot Chat subscription.";
"To use Zed's assistant with GitHub Copilot, you need to be logged in to GitHub. Note that your GitHub account must have an active Copilot Chat subscription.";
v_flex().gap_6().child(Label::new(LABEL)).child(
v_flex()
.gap_2()

View file

@ -446,11 +446,10 @@ impl ConfigurationView {
impl Render for ConfigurationView {
fn render(&mut self, cx: &mut ViewContext<Self>) -> impl IntoElement {
const GOOGLE_CONSOLE_URL: &str = "https://aistudio.google.com/app/apikey";
const INSTRUCTIONS: [&str; 4] = [
"To use the Google AI assistant, you need to add your Google AI API key.",
"You can create an API key at:",
"",
"Paste your Google AI API key below and hit enter to use the assistant:",
const INSTRUCTIONS: [&str; 3] = [
"To use Zed's assistant with Google AI, you need to add an API key. Follow these steps:",
"- Create one by visiting:",
"- Paste your API key below and hit enter to use the assistant",
];
let env_var_set = self.state.read(cx).api_key_from_env;
@ -472,7 +471,6 @@ impl Render for ConfigurationView {
)
)
.child(Label::new(INSTRUCTIONS[2]))
.child(Label::new(INSTRUCTIONS[3]))
.child(
h_flex()
.w_full()

View file

@ -497,13 +497,11 @@ impl ConfigurationView {
impl Render for ConfigurationView {
fn render(&mut self, cx: &mut ViewContext<Self>) -> impl IntoElement {
const OPENAI_CONSOLE_URL: &str = "https://platform.openai.com/api-keys";
const INSTRUCTIONS: [&str; 6] = [
"To use the assistant panel or inline assistant, you need to add your OpenAI API key.",
" - You can create an API key at: ",
" - Make sure your OpenAI account has credits",
" - Having a subscription for another service like GitHub Copilot won't work.",
"",
"Paste your OpenAI API key below and hit enter to use the assistant:",
const INSTRUCTIONS: [&str; 4] = [
"To use Zed's assistant with OpenAI, you need to add an API key. Follow these steps:",
" - Create one by visiting:",
" - Ensure your OpenAI account has credits",
" - Paste your API key below and hit enter to start using the assistant",
];
let env_var_set = self.state.read(cx).api_key_from_env;
@ -543,6 +541,12 @@ impl Render for ConfigurationView {
)
.size(LabelSize::Small),
)
.child(
Label::new(
"Note that having a subscription for another service like GitHub Copilot won't work.".to_string(),
)
.size(LabelSize::Small),
)
.into_any()
} else {
h_flex()