From 2b671a46f23e2f5d1393e58973f7305e6b78494d Mon Sep 17 00:00:00 2001 From: Danilo Leal <67129314+danilo-leal@users.noreply.github.com> Date: Tue, 22 Jul 2025 02:39:22 -0300 Subject: [PATCH] ai onboarding: Don't show API keys section if user is already in Pro (#34867) Release Notes: - N/A --- crates/agent_ui/src/message_editor.rs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/crates/agent_ui/src/message_editor.rs b/crates/agent_ui/src/message_editor.rs index 69eae982f8..7803753292 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)) })