fix(billing): trial-aware upgrade-card copy + near-renewal disable - #1145
Open
Navin-S-R wants to merge 3 commits into
Open
fix(billing): trial-aware upgrade-card copy + near-renewal disable#1145Navin-S-R wants to merge 3 commits into
Navin-S-R wants to merge 3 commits into
Conversation
The billing page's upgrade cards now reflect the control-plane upgrade rules:
- a TRIAL customer sees "your free trial moves to this plan, nothing charged
now" on same-cycle targets, and cross-cycle (Annual) targets are disabled
with "available once your free trial converts" (the server refuses them);
- when within 24h of renewal the cards are disabled ("renews within a day")
to mirror the server's UpgradeTooCloseToRenewal refusal, so no dead-end CTA.
Reads account.is_trial + the new account.upgrade_locked_near_renewal flag.
Paid customers keep the "prorated difference" copy. Verified live in-browser
across all four card states.
The upgrade cards promised a trial switch charges nothing, but doUpgrade's confirm dialog still read "Charged now…" with a "Pay ₹0" CTA. Branch the confirm copy on the preview `mode`: a trial_switch shows "No charge now - your free trial moves to this plan; you'll be billed <target> when your trial ends" with a "Switch plan" CTA; a paid upgrade keeps the prorated "Pay ₹…" charge.
upgrade_locked_near_renewal is a server-computed, time-based flag baked into the account snapshot; current_period_end is not re-read as it passes, so a tab left open across renewal kept every upgrade card disabled until a manual reload. Re-read server truth when the tab becomes visible again, and poll (5-min) while the lock is active so a continuously-open tab also clears on its own right after renewal. Both stop once the lock is gone.
kavin-114
approved these changes
Sep 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Makes the billing page's upgrade cards reflect the control-plane upgrade rules (pairs with the jarvis_admin_v2 proration fix).
TrialCrossCycleUnsupportedrefusal — no dead-end CTA.)UpgradeTooCloseToRenewalrefusal, driven by the newaccount.upgrade_locked_near_renewalflag.)Testing
BillingPage.spec.jscovers all four states (copy + native-disabled class): 79/79 vitest green,vite buildclean, prettier@2.7.1 clean. Verified live in real Chrome across all four card states.Notes
Requires the jarvis_admin_v2 PR (returns
upgrade_locked_near_renewal+ the trial/delta upgrade behaviour). OnlyBillingPage.vue+BillingPage.spec.jschanged.