zeta: Update onboarding modal with subscription info (#30439)

This PR updates the edit prediction onboarding modal with steps about
subscribing to a plan.

When the user is not subscribed to a plan, we display a link to the
account page to sign up for one:

<img width="612" alt="Screenshot 2025-05-09 at 6 04 05 PM"
src="https://github.com/user-attachments/assets/0300194a-c419-43d9-8214-080674d31e12"
/>

If the user is already subscribed to a plan we indicate which plan they
are on and how many edit predictions they get with it:

<img width="616" alt="Screenshot 2025-05-09 at 6 03 16 PM"
src="https://github.com/user-attachments/assets/e2506096-e499-41f2-ba1f-fca768cb48b9"
/>

<img width="595" alt="Screenshot 2025-05-09 at 5 46 18 PM"
src="https://github.com/user-attachments/assets/de82f8c2-cad8-45fb-8988-26606a8dc3e1"
/>

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2025-05-09 18:46:10 -04:00 committed by GitHub
parent bff259731f
commit fbeee1f832
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 57 additions and 4 deletions

View file

@ -237,11 +237,17 @@ impl Render for InlineCompletionButton {
let current_user_terms_accepted =
self.user_store.read(cx).current_user_has_accepted_terms();
let has_subscription = self.user_store.read(cx).current_plan().is_some()
&& self.user_store.read(cx).subscription_period().is_some();
if !current_user_terms_accepted.unwrap_or(false) {
if !has_subscription || !current_user_terms_accepted.unwrap_or(false) {
let signed_in = current_user_terms_accepted.is_some();
let tooltip_meta = if signed_in {
"Read Terms of Service"
if has_subscription {
"Read Terms of Service"
} else {
"Choose a Plan"
}
} else {
"Sign in to use"
};