Skip to content

Commit 17e55da

Browse files
authored
Remove billing-v2 feature flag (#38843)
This PR removes the `billing-v2` feature flag, now that the new pricing is launched. Release Notes: - N/A
1 parent 6b968e0 commit 17e55da

File tree

8 files changed

+11
-49
lines changed

8 files changed

+11
-49
lines changed

Cargo.lock

Lines changed: 0 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/ai_onboarding/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ default = []
1818
client.workspace = true
1919
cloud_llm_client.workspace = true
2020
component.workspace = true
21-
feature_flags.workspace = true
2221
gpui.workspace = true
2322
language_model.workspace = true
2423
serde.workspace = true

crates/ai_onboarding/src/ai_onboarding.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ pub use young_account_banner::YoungAccountBanner;
1818
use std::sync::Arc;
1919

2020
use client::{Client, UserStore, zed_urls};
21-
use feature_flags::{BillingV2FeatureFlag, FeatureFlagAppExt as _};
2221
use gpui::{AnyElement, Entity, IntoElement, ParentElement};
2322
use ui::{Divider, RegisterComponent, Tooltip, prelude::*};
2423

@@ -85,7 +84,7 @@ impl ZedAiOnboarding {
8584
self
8685
}
8786

88-
fn render_sign_in_disclaimer(&self, cx: &mut App) -> AnyElement {
87+
fn render_sign_in_disclaimer(&self, _cx: &mut App) -> AnyElement {
8988
let signing_in = matches!(self.sign_in_status, SignInStatus::SigningIn);
9089

9190
v_flex()
@@ -96,7 +95,7 @@ impl ZedAiOnboarding {
9695
.color(Color::Muted)
9796
.mb_2(),
9897
)
99-
.child(PlanDefinitions.pro_plan(cx.has_flag::<BillingV2FeatureFlag>(), false))
98+
.child(PlanDefinitions.pro_plan(true, false))
10099
.child(
101100
Button::new("sign_in", "Try Zed Pro for Free")
102101
.disabled(signing_in)
@@ -120,7 +119,7 @@ impl ZedAiOnboarding {
120119
.max_w_full()
121120
.gap_1()
122121
.child(Headline::new("Welcome to Zed AI"))
123-
.child(YoungAccountBanner::new(is_v2))
122+
.child(YoungAccountBanner)
124123
.child(
125124
v_flex()
126125
.mt_2()
@@ -307,7 +306,7 @@ impl RenderOnce for ZedAiOnboarding {
307306
fn render(self, _window: &mut ui::Window, cx: &mut App) -> impl IntoElement {
308307
if matches!(self.sign_in_status, SignInStatus::SignedIn) {
309308
match self.plan {
310-
None => self.render_free_plan_state(cx.has_flag::<BillingV2FeatureFlag>(), cx),
309+
None => self.render_free_plan_state(true, cx),
311310
Some(plan @ (Plan::V1(PlanV1::ZedFree) | Plan::V2(PlanV2::ZedFree))) => {
312311
self.render_free_plan_state(plan.is_v2(), cx)
313312
}

crates/ai_onboarding/src/ai_upsell_card.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ use std::sync::Arc;
22

33
use client::{Client, UserStore, zed_urls};
44
use cloud_llm_client::{Plan, PlanV1, PlanV2};
5-
use feature_flags::{BillingV2FeatureFlag, FeatureFlagAppExt};
65
use gpui::{AnyElement, App, Entity, IntoElement, RenderOnce, Window};
76
use ui::{CommonAnimationExt, Divider, Vector, VectorName, prelude::*};
87

@@ -50,9 +49,7 @@ impl AiUpsellCard {
5049

5150
impl RenderOnce for AiUpsellCard {
5251
fn render(self, _window: &mut Window, cx: &mut App) -> impl IntoElement {
53-
let is_v2_plan = self
54-
.user_plan
55-
.map_or(cx.has_flag::<BillingV2FeatureFlag>(), |plan| plan.is_v2());
52+
let is_v2_plan = self.user_plan.map_or(true, |plan| plan.is_v2());
5653

5754
let pro_section = v_flex()
5855
.flex_grow()
@@ -175,7 +172,7 @@ impl RenderOnce for AiUpsellCard {
175172
.child(Label::new("Try Zed AI").size(LabelSize::Large))
176173
.map(|this| {
177174
if self.account_too_young {
178-
this.child(YoungAccountBanner::new(is_v2_plan)).child(
175+
this.child(YoungAccountBanner).child(
179176
v_flex()
180177
.mt_2()
181178
.gap_1()

crates/ai_onboarding/src/young_account_banner.rs

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,17 @@ use gpui::{IntoElement, ParentElement};
22
use ui::{Banner, prelude::*};
33

44
#[derive(IntoElement)]
5-
pub struct YoungAccountBanner {
6-
is_v2: bool,
7-
}
8-
9-
impl YoungAccountBanner {
10-
pub fn new(is_v2: bool) -> Self {
11-
Self { is_v2 }
12-
}
13-
}
5+
pub struct YoungAccountBanner;
146

157
impl RenderOnce for YoungAccountBanner {
168
fn render(self, _window: &mut Window, cx: &mut App) -> impl IntoElement {
17-
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. You can request an exception by reaching out to [email protected]";
18-
const YOUNG_ACCOUNT_DISCLAIMER_V2: &str = "To prevent abuse of our service, GitHub accounts created fewer than 30 days ago are not eligible for the Pro trial. You can request an exception by reaching out to [email protected]";
9+
const YOUNG_ACCOUNT_DISCLAIMER: &str = "To prevent abuse of our service, GitHub accounts created fewer than 30 days ago are not eligible for the Pro trial. You can request an exception by reaching out to [email protected]";
1910

2011
let label = div()
2112
.w_full()
2213
.text_sm()
2314
.text_color(cx.theme().colors().text_muted)
24-
.child(if self.is_v2 {
25-
YOUNG_ACCOUNT_DISCLAIMER_V2
26-
} else {
27-
YOUNG_ACCOUNT_DISCLAIMER
28-
});
15+
.child(YOUNG_ACCOUNT_DISCLAIMER);
2916

3017
div()
3118
.max_w_full()

crates/feature_flags/src/flags.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,6 @@ impl FeatureFlag for PredictEditsRateCompletionsFeatureFlag {
66
const NAME: &'static str = "predict-edits-rate-completions";
77
}
88

9-
pub struct BillingV2FeatureFlag {}
10-
11-
impl FeatureFlag for BillingV2FeatureFlag {
12-
const NAME: &'static str = "billing-v2";
13-
14-
fn enabled_for_all() -> bool {
15-
true
16-
}
17-
}
18-
199
pub struct NotebookFeatureFlag;
2010

2111
impl FeatureFlag for NotebookFeatureFlag {

crates/language_models/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ copilot.workspace = true
2929
credentials_provider.workspace = true
3030
deepseek = { workspace = true, features = ["schemars"] }
3131
editor.workspace = true
32-
feature_flags.workspace = true
3332
fs.workspace = true
3433
futures.workspace = true
3534
google_ai = { workspace = true, features = ["schemars"] }

crates/language_models/src/provider/cloud.rs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ use cloud_llm_client::{
1111
SUBSCRIPTION_LIMIT_RESOURCE_HEADER_NAME, TOOL_USE_LIMIT_REACHED_HEADER_NAME,
1212
ZED_VERSION_HEADER_NAME,
1313
};
14-
use feature_flags::{BillingV2FeatureFlag, FeatureFlagAppExt};
1514
use futures::{
1615
AsyncBufReadExt, FutureExt, Stream, StreamExt, future::BoxFuture, stream::BoxStream,
1716
};
@@ -974,13 +973,10 @@ struct ZedAiConfiguration {
974973
}
975974

976975
impl RenderOnce for ZedAiConfiguration {
977-
fn render(self, _window: &mut Window, cx: &mut App) -> impl IntoElement {
976+
fn render(self, _window: &mut Window, _cx: &mut App) -> impl IntoElement {
978977
let is_pro = self.plan.is_some_and(|plan| {
979978
matches!(plan, Plan::V1(PlanV1::ZedPro) | Plan::V2(PlanV2::ZedPro))
980979
});
981-
let is_free_v2 = self
982-
.plan
983-
.is_some_and(|plan| plan == Plan::V2(PlanV2::ZedFree));
984980
let subscription_text = match (self.plan, self.subscription_period) {
985981
(Some(Plan::V1(PlanV1::ZedPro) | Plan::V2(PlanV2::ZedPro)), Some(_)) => {
986982
"You have access to Zed's hosted models through your Pro subscription."
@@ -1047,10 +1043,7 @@ impl RenderOnce for ZedAiConfiguration {
10471043

10481044
v_flex().gap_2().w_full().map(|this| {
10491045
if self.account_too_young {
1050-
this.child(YoungAccountBanner::new(
1051-
is_free_v2 || cx.has_flag::<BillingV2FeatureFlag>(),
1052-
))
1053-
.child(
1046+
this.child(YoungAccountBanner).child(
10541047
Button::new("upgrade", "Upgrade to Pro")
10551048
.style(ui::ButtonStyle::Tinted(ui::TintColor::Accent))
10561049
.full_width()

0 commit comments

Comments
 (0)