Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

ai onboarding: Don't show API keys section if user is already in Pro (#34867)

Danilo Leal2b671a46f23e
diff --git a/crates/agent_ui/src/message_editor.rs b/crates/agent_ui/src/message_editor.rs
index 69eae982f80..78037532925 100644
--- a/crates/agent_ui/src/message_editor.rs
+++ b/crates/agent_ui/src/message_editor.rs
@@ -1657,11 +1657,16 @@ impl Render for MessageEditor {
let line_height = TextSize::Small.rems(cx).to_pixels(window.rem_size()) * 1.5;
- let enrolled_in_trial = matches!(
+ let in_pro_trial = matches!(
self.user_store.read(cx).current_plan(),
Some(proto::Plan::ZedProTrial)
);
+ let pro_user = matches!(
+ self.user_store.read(cx).current_plan(),
+ Some(proto::Plan::ZedPro)
+ );
+
let configured_providers: Vec<(IconName, SharedString)> =
LanguageModelRegistry::read_global(cx)
.providers()
@@ -1676,9 +1681,10 @@ impl Render for MessageEditor {
v_flex()
.size_full()
.bg(cx.theme().colors().panel_background)
- .when(has_existing_providers && !enrolled_in_trial, |this| {
- this.child(cx.new(ApiKeysWithProviders::new))
- })
+ .when(
+ has_existing_providers && !in_pro_trial && !pro_user,
+ |this| this.child(cx.new(ApiKeysWithProviders::new)),
+ )
.when(changed_buffers.len() > 0, |parent| {
parent.child(self.render_edits_bar(&changed_buffers, window, cx))
})