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 <ben@zed.dev>
Co-authored-by: Anthony Eid <hello@anthonyeid.me>
This commit is contained in:
Danilo Leal
2025-09-03 17:59:12 -03:00
committed by GitHub
co-authored by Ben Kunkle Anthony Eid
parent bb2d833373
commit 2aa0114b40
4 changed files with 32 additions and 5 deletions
+14
View File
@@ -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, .. }
@@ -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<Self>) -> 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)
})
}
}
@@ -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()
+11 -2
View File
@@ -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<EditPredictionOnboarding>,
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<Self>,
) -> 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<Self>) -> impl IntoElement {