From 2aa0114b40e090cf54a76663761d2ae772da9b4d Mon Sep 17 00:00:00 2001 From: Danilo Leal <67129314+danilo-leal@users.noreply.github.com> Date: Wed, 3 Sep 2025 17:59:12 -0300 Subject: [PATCH] ai onboarding: Add some fast-follow adjustments (#37486) Closes https://github.com/zed-industries/zed/issues/37305 Release Notes: - N/A --------- Co-authored-by: Ben Kunkle Co-authored-by: Anthony Eid --- crates/agent_ui/src/agent_panel.rs | 14 ++++++++++++++ .../src/edit_prediction_onboarding_content.rs | 8 ++++++-- crates/ai_onboarding/src/young_account_banner.rs | 2 +- crates/zeta/src/onboarding_modal.rs | 13 +++++++++++-- 4 files changed, 32 insertions(+), 5 deletions(-) diff --git a/crates/agent_ui/src/agent_panel.rs b/crates/agent_ui/src/agent_panel.rs index 305261183e92de6dbe2ad5756293e8b0bbf77849..d021eaefb5ebff43fad1fe4822b3758550a0179f 100644 --- a/crates/agent_ui/src/agent_panel.rs +++ b/crates/agent_ui/src/agent_panel.rs @@ -2967,6 +2967,20 @@ impl AgentPanel { return false; } + let user_store = self.user_store.read(cx); + + if user_store + .plan() + .is_some_and(|plan| matches!(plan, Plan::ZedPro)) + && user_store + .subscription_period() + .and_then(|period| period.0.checked_add_days(chrono::Days::new(1))) + .is_some_and(|date| date < chrono::Utc::now()) + { + OnboardingUpsell::set_dismissed(true, cx); + return false; + } + match &self.active_view { ActiveView::History | ActiveView::Configuration => false, ActiveView::ExternalAgentThread { thread_view, .. } diff --git a/crates/ai_onboarding/src/edit_prediction_onboarding_content.rs b/crates/ai_onboarding/src/edit_prediction_onboarding_content.rs index e883d8da8ce01bfea3f08676666c308a90f6d650..50b729c37ee8cf98e188d66e716bdafa4ad11ca1 100644 --- a/crates/ai_onboarding/src/edit_prediction_onboarding_content.rs +++ b/crates/ai_onboarding/src/edit_prediction_onboarding_content.rs @@ -1,6 +1,7 @@ use std::sync::Arc; use client::{Client, UserStore}; +use cloud_llm_client::Plan; use gpui::{Entity, IntoElement, ParentElement}; use ui::prelude::*; @@ -35,6 +36,8 @@ impl EditPredictionOnboarding { impl Render for EditPredictionOnboarding { fn render(&mut self, _window: &mut Window, cx: &mut Context) -> impl IntoElement { + let is_free_plan = self.user_store.read(cx).plan() == Some(Plan::ZedFree); + let github_copilot = v_flex() .gap_1() .child(Label::new(if self.copilot_is_configured { @@ -67,7 +70,8 @@ impl Render for EditPredictionOnboarding { self.continue_with_zed_ai.clone(), cx, )) - .child(ui::Divider::horizontal()) - .child(github_copilot) + .when(is_free_plan, |this| { + this.child(ui::Divider::horizontal()).child(github_copilot) + }) } } diff --git a/crates/ai_onboarding/src/young_account_banner.rs b/crates/ai_onboarding/src/young_account_banner.rs index ed9a6b3b35fb2e8e3afaa9d9b658539dd3fa6541..ae13b9556885c1552f7e90935f844347cd76a778 100644 --- a/crates/ai_onboarding/src/young_account_banner.rs +++ b/crates/ai_onboarding/src/young_account_banner.rs @@ -6,7 +6,7 @@ pub struct YoungAccountBanner; impl RenderOnce for YoungAccountBanner { fn render(self, _window: &mut Window, cx: &mut App) -> impl IntoElement { - const YOUNG_ACCOUNT_DISCLAIMER: &str = "To prevent abuse of our service, we cannot offer plans to GitHub accounts created fewer than 30 days ago. To request an exception, reach out to billing-support@zed.dev."; + const YOUNG_ACCOUNT_DISCLAIMER: &str = "To prevent abuse of our service, GitHub accounts created fewer than 30 days ago are not eligible for free plan usage or Pro plan free trial. To request an exception, reach out to billing-support@zed.dev."; let label = div() .w_full() diff --git a/crates/zeta/src/onboarding_modal.rs b/crates/zeta/src/onboarding_modal.rs index 3a58c8c7b812b193724eaf911cb15db264204964..6b743d95f2d2765be0d332e1aa8a03a9647131aa 100644 --- a/crates/zeta/src/onboarding_modal.rs +++ b/crates/zeta/src/onboarding_modal.rs @@ -14,7 +14,7 @@ use settings::update_settings_file; use ui::{Vector, VectorName, prelude::*}; use workspace::{ModalView, Workspace}; -/// Introduces user to Zed's Edit Prediction feature and terms of service +/// Introduces user to Zed's Edit Prediction feature pub struct ZedPredictModal { onboarding: Entity, focus_handle: FocusHandle, @@ -86,7 +86,16 @@ impl Focusable for ZedPredictModal { } } -impl ModalView for ZedPredictModal {} +impl ModalView for ZedPredictModal { + fn on_before_dismiss( + &mut self, + _window: &mut Window, + cx: &mut Context, + ) -> workspace::DismissDecision { + ZedPredictUpsell::set_dismissed(true, cx); + workspace::DismissDecision::Dismiss(true) + } +} impl Render for ZedPredictModal { fn render(&mut self, window: &mut Window, cx: &mut Context) -> impl IntoElement {