Update plan text (#38731)
Release Notes: - N/A --------- Co-authored-by: David Kleingeld <davidsk@zed.dev>
This commit is contained in:
co-authored by
David Kleingeld
parent
3646aa6bba
commit
f78699eb71
@@ -11,6 +11,7 @@ use cloud_llm_client::{
|
||||
SUBSCRIPTION_LIMIT_RESOURCE_HEADER_NAME, TOOL_USE_LIMIT_REACHED_HEADER_NAME,
|
||||
ZED_VERSION_HEADER_NAME,
|
||||
};
|
||||
use feature_flags::{BillingV2FeatureFlag, FeatureFlagAppExt};
|
||||
use futures::{
|
||||
AsyncBufReadExt, FutureExt, Stream, StreamExt, future::BoxFuture, stream::BoxStream,
|
||||
};
|
||||
@@ -973,12 +974,13 @@ struct ZedAiConfiguration {
|
||||
}
|
||||
|
||||
impl RenderOnce for ZedAiConfiguration {
|
||||
fn render(self, _window: &mut Window, _cx: &mut App) -> impl IntoElement {
|
||||
let young_account_banner = YoungAccountBanner;
|
||||
|
||||
fn render(self, _window: &mut Window, cx: &mut App) -> impl IntoElement {
|
||||
let is_pro = self.plan.is_some_and(|plan| {
|
||||
matches!(plan, Plan::V1(PlanV1::ZedPro) | Plan::V2(PlanV2::ZedPro))
|
||||
});
|
||||
let is_free_v2 = self
|
||||
.plan
|
||||
.is_some_and(|plan| plan == Plan::V2(PlanV2::ZedFree));
|
||||
let subscription_text = match (self.plan, self.subscription_period) {
|
||||
(Some(Plan::V1(PlanV1::ZedPro) | Plan::V2(PlanV2::ZedPro)), Some(_)) => {
|
||||
"You have access to Zed's hosted models through your Pro subscription."
|
||||
@@ -986,9 +988,16 @@ impl RenderOnce for ZedAiConfiguration {
|
||||
(Some(Plan::V1(PlanV1::ZedProTrial) | Plan::V2(PlanV2::ZedProTrial)), Some(_)) => {
|
||||
"You have access to Zed's hosted models through your Pro trial."
|
||||
}
|
||||
(Some(Plan::V1(PlanV1::ZedFree) | Plan::V2(PlanV2::ZedFree)), Some(_)) => {
|
||||
(Some(Plan::V1(PlanV1::ZedFree)), Some(_)) => {
|
||||
"You have basic access to Zed's hosted models through the Free plan."
|
||||
}
|
||||
(Some(Plan::V2(PlanV2::ZedFree)), Some(_)) => {
|
||||
if self.eligible_for_trial {
|
||||
"Subscribe for access to Zed's hosted models. Start with a 14 day free trial."
|
||||
} else {
|
||||
"Subscribe for access to Zed's hosted models."
|
||||
}
|
||||
}
|
||||
_ => {
|
||||
if self.eligible_for_trial {
|
||||
"Subscribe for access to Zed's hosted models. Start with a 14 day free trial."
|
||||
@@ -1038,7 +1047,10 @@ impl RenderOnce for ZedAiConfiguration {
|
||||
|
||||
v_flex().gap_2().w_full().map(|this| {
|
||||
if self.account_too_young {
|
||||
this.child(young_account_banner).child(
|
||||
this.child(YoungAccountBanner::new(
|
||||
is_free_v2 || cx.has_flag::<BillingV2FeatureFlag>(),
|
||||
))
|
||||
.child(
|
||||
Button::new("upgrade", "Upgrade to Pro")
|
||||
.style(ui::ButtonStyle::Tinted(ui::TintColor::Accent))
|
||||
.full_width()
|
||||
|
||||
Reference in New Issue
Block a user