Skip to content

Commit 7f70993

Browse files
cloud_api_types: Add ZedVip variant to Plan (#59443) (cherry-pick to preview) (#59715)
Cherry-pick of #59443 to preview ---- This PR adds a new `ZedVip` variant to the `Plan` enum. Closes CLO-881. Release Notes: - N/A Co-authored-by: Marshall Bowers <git@maxdeviant.com>
1 parent 37679b9 commit 7f70993

9 files changed

Lines changed: 46 additions & 0 deletions

File tree

assets/images/vip_stamp.svg

Lines changed: 1 addition & 0 deletions
Loading

crates/agent_ui/src/agent_configuration.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,7 @@ impl AgentConfiguration {
506506
Plan::ZedProTrial => ("Pro Trial", Color::Accent, pro_chip_bg),
507507
Plan::ZedPro => ("Pro", Color::Accent, pro_chip_bg),
508508
Plan::ZedBusiness => ("Business", Color::Accent, pro_chip_bg),
509+
Plan::ZedVip => ("VIP", Color::Accent, pro_chip_bg),
509510
Plan::ZedStudent => ("Student", Color::Accent, pro_chip_bg),
510511
};
511512

crates/ai_onboarding/src/ai_onboarding.rs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,13 @@ impl ZedAiOnboarding {
115115
)
116116
}
117117

118+
fn vip_stamp(cx: &App) -> impl IntoElement {
119+
div().absolute().bottom_1().right_1().child(
120+
Vector::new(VectorName::VipStamp, rems_from_px(156.), rems_from_px(60.))
121+
.color(Color::Custom(cx.theme().colors().text.alpha(0.8))),
122+
)
123+
}
124+
118125
fn student_stamp(cx: &App) -> impl IntoElement {
119126
div().absolute().bottom_1().right_1().child(
120127
Vector::new(
@@ -332,6 +339,23 @@ impl ZedAiOnboarding {
332339
.into_any_element()
333340
}
334341

342+
fn render_vip_plan_state(&self, cx: &mut App) -> AnyElement {
343+
v_flex()
344+
.w_full()
345+
.relative()
346+
.gap_1()
347+
.child(Self::vip_stamp(cx))
348+
.child(Headline::new("Welcome to Zed VIP"))
349+
.child(
350+
Label::new("Here's what you get:")
351+
.color(Color::Muted)
352+
.mb_2(),
353+
)
354+
.child(PlanDefinitions.vip_plan())
355+
.children(self.render_dismiss_button())
356+
.into_any_element()
357+
}
358+
335359
fn render_student_plan_state(&self, cx: &mut App) -> AnyElement {
336360
v_flex()
337361
.w_full()
@@ -359,6 +383,7 @@ impl RenderOnce for ZedAiOnboarding {
359383
Some(Plan::ZedProTrial) => self.render_trial_state(cx),
360384
Some(Plan::ZedPro) => self.render_pro_plan_state(cx),
361385
Some(Plan::ZedBusiness) => self.render_business_plan_state(cx),
386+
Some(Plan::ZedVip) => self.render_vip_plan_state(cx),
362387
Some(Plan::ZedStudent) => self.render_student_plan_state(cx),
363388
}
364389
} else {
@@ -436,6 +461,10 @@ impl Component for ZedAiOnboarding {
436461
"Business Plan",
437462
onboarding(SignInStatus::SignedIn, Some(Plan::ZedBusiness), false),
438463
),
464+
single_example(
465+
"VIP Plan",
466+
onboarding(SignInStatus::SignedIn, Some(Plan::ZedVip), false),
467+
),
439468
single_example(
440469
"Student Plan",
441470
onboarding(SignInStatus::SignedIn, Some(Plan::ZedStudent), false),

crates/ai_onboarding/src/plan_definitions.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,12 @@ impl PlanDefinitions {
4545
.child(ListBulletItem::new("Usage-based billing"))
4646
}
4747

48+
pub fn vip_plan(&self) -> impl IntoElement {
49+
List::new()
50+
.child(ListBulletItem::new("Unlimited edit predictions"))
51+
.child(ListBulletItem::new("Tokens in the Zed agent"))
52+
}
53+
4854
pub fn student_plan(&self) -> impl IntoElement {
4955
List::new()
5056
.child(ListBulletItem::new("Unlimited edit predictions"))

crates/cloud_api_types/src/plan.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ pub enum Plan {
1010
ZedPro,
1111
ZedProTrial,
1212
ZedBusiness,
13+
ZedVip,
1314
ZedStudent,
1415
}
1516

crates/language_models/src/provider/cloud.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,11 @@ impl RenderOnce for ZedAiConfiguration {
439439
},
440440
true,
441441
),
442+
Some(Plan::ZedVip) => (
443+
"You have access to Zed's hosted models through your VIP subscription.",
444+
true,
445+
),
446+
442447
Some(Plan::ZedFree) | None => (
443448
if self.eligible_for_trial {
444449
"Subscribe for access to Zed's hosted models. Start with a 14 day free trial."

crates/onboarding/src/onboarding.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,7 @@ impl Onboarding {
237237
Some(Plan::ZedPro) => "pro",
238238
Some(Plan::ZedProTrial) => "trial",
239239
Some(Plan::ZedBusiness) => "business",
240+
Some(Plan::ZedVip) => "vip",
240241
Some(Plan::ZedStudent) => "student",
241242
Some(Plan::ZedFree) | None => "free",
242243
}

crates/title_bar/src/plan_chip.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ impl RenderOnce for PlanChip {
3434
Plan::ZedProTrial => ("Pro Trial", Color::Accent, pro_chip_bg),
3535
Plan::ZedPro => ("Pro", Color::Accent, pro_chip_bg),
3636
Plan::ZedBusiness => ("Business", Color::Accent, pro_chip_bg),
37+
Plan::ZedVip => ("VIP", Color::Accent, pro_chip_bg),
3738
Plan::ZedStudent => ("Student", Color::Accent, pro_chip_bg),
3839
};
3940

crates/ui/src/components/image.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ use crate::traits::transformable::Transformable;
1414
#[strum(serialize_all = "snake_case")]
1515
pub enum VectorName {
1616
BusinessStamp,
17+
VipStamp,
1718
Grid,
1819
ProTrialStamp,
1920
ProUserStamp,

0 commit comments

Comments
 (0)