From 2e92343df8ad2fbd533a43e0619e1256540c6d75 Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Sat, 10 May 2025 16:52:38 -0400 Subject: [PATCH] title_bar: Hide plans without a subscription period (#30478) This PR updates the plan display in the user menu in the title bar to hide plans that do not have a subscription period. Release Notes: - Improved the displaying of the plan in the user menu. --- crates/title_bar/src/title_bar.rs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/crates/title_bar/src/title_bar.rs b/crates/title_bar/src/title_bar.rs index 6e19e87d16aec1fa52cb4677b348509c15363dfd..4078a0dfb9c69a9ca2bba8b43d8577bab8b29026 100644 --- a/crates/title_bar/src/title_bar.rs +++ b/crates/title_bar/src/title_bar.rs @@ -657,7 +657,11 @@ impl TitleBar { pub fn render_user_menu_button(&mut self, cx: &mut Context) -> impl Element { let user_store = self.user_store.read(cx); if let Some(user) = user_store.current_user() { - let plan = user_store.current_plan(); + let has_subscription_period = self.user_store.read(cx).subscription_period().is_some(); + let plan = self.user_store.read(cx).current_plan().filter(|_| { + // Since the user might be on the legacy free plan we filter based on whether we have a subscription period. + has_subscription_period + }); PopoverMenu::new("user-menu") .anchor(Corner::TopRight) .menu(move |window, cx| { @@ -666,10 +670,10 @@ impl TitleBar { format!( "Current Plan: {}", match plan { - None => "", - Some(proto::Plan::Free) => "Free", - Some(proto::Plan::ZedPro) => "Pro", - Some(proto::Plan::ZedProTrial) => "Pro (Trial)", + None => "None", + Some(proto::Plan::Free) => "Zed Free", + Some(proto::Plan::ZedPro) => "Zed Pro", + Some(proto::Plan::ZedProTrial) => "Zed Pro (Trial)", } ), zed_actions::OpenAccountSettings.boxed_clone(),