Skip to content

feat(billing): post-grant upgrade prompt variant for depleted signupGrant#4128

Merged
PierreBrisorgueil merged 3 commits into
masterfrom
feat-billing-post-grant-modal
May 11, 2026
Merged

feat(billing): post-grant upgrade prompt variant for depleted signupGrant#4128
PierreBrisorgueil merged 3 commits into
masterfrom
feat-billing-post-grant-modal

Conversation

@PierreBrisorgueil
Copy link
Copy Markdown
Collaborator

Summary

  • Adds exhaustedAfterGrant Pinia getter to billing store: returns true when plan=free, extrasBalance.balance <= 0, and extrasLedger has a signup_grant entry — null-safe for all edge cases
  • Extends BillingUpgradePromptComponent with a post-grant variant: when the getter is true, renders "Your signup grant is depleted" copy with Boost pack CTA (primary) + Growth/Pro upgrade CTA (secondary text)
  • Pricing card badge already wired via plan.badge — added explicit tests to document the existing behavior
  • i18n keys added in en.js + fr.js

Test plan

  • billing.store.unit.tests.js: 9 new tests for exhaustedAfterGrant getter (all 6 guard conditions + null-safety)
  • billing.upgradePrompt.component.unit.tests.js: 7 new component tests — post-grant variant renders/doesn't render per store state
  • billing.pricingCard.component.unit.tests.js: 2 new tests for badge chip from plan.badge
  • Full suite: 1637 tests pass
  • Manual: set billingStore.subscription.plan = 'free', extrasBalance.balance = 0, extrasLedger.entries = [{ source: 'signup_grant' }] in devtools → upgrade modal shows post-grant copy

Part of

N2 Free Tier Grant plan — Task 5 of 7. WS-B T1/T2/T3/T4 merged upstream (devkit Node).

…rant

Add exhaustedAfterGrant store getter (free plan + balance<=0 + signup_grant ledger entry)
and post-grant copy variant in BillingUpgradePromptComponent with Boost pack CTA first,
upgrade Growth/Pro second. PricingCard badge already wired via plan.badge — add explicit
tests to document. i18n keys added en+fr.
Copilot AI review requested due to automatic review settings May 11, 2026 20:35
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 11, 2026

Warning

Rate limit exceeded

@PierreBrisorgueil has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 35 minutes and 24 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 3abd4706-8b5c-4854-9d1a-077fcbd074d7

📥 Commits

Reviewing files that changed from the base of the PR and between 15fd466 and c96ec08.

📒 Files selected for processing (7)
  • src/modules/billing/components/billing.upgradePrompt.component.vue
  • src/modules/billing/lang/en.js
  • src/modules/billing/lang/fr.js
  • src/modules/billing/stores/billing.store.js
  • src/modules/billing/tests/billing.pricingCard.component.unit.tests.js
  • src/modules/billing/tests/billing.store.unit.tests.js
  • src/modules/billing/tests/billing.upgradePrompt.component.unit.tests.js
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat-billing-post-grant-modal

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a “post-grant” upgrade prompt flow in the billing module, driven by a new Pinia getter that detects when a Free-plan org has depleted its one-shot signup grant, along with i18n strings and unit test coverage to validate the new behavior.

Changes:

  • Added exhaustedAfterGrant getter to useBillingStore to detect “signup grant depleted” state.
  • Extended BillingUpgradePrompt with a post-grant variant UI (new copy + Boost pack CTA + secondary upgrade CTA).
  • Added/extended unit tests and introduced new i18n keys in en.js / fr.js.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/modules/billing/tests/billing.upgradePrompt.component.unit.tests.js Adds unit tests covering the new post-grant rendering/CTAs.
src/modules/billing/tests/billing.store.unit.tests.js Adds unit tests for the new exhaustedAfterGrant getter guard conditions and null-safety.
src/modules/billing/tests/billing.pricingCard.component.unit.tests.js Adds tests documenting existing plan.badge chip rendering behavior.
src/modules/billing/stores/billing.store.js Introduces exhaustedAfterGrant getter to drive post-grant UI logic.
src/modules/billing/lang/fr.js Adds French i18n strings for the post-grant variant.
src/modules/billing/lang/en.js Adds English i18n strings for the post-grant variant.
src/modules/billing/components/billing.upgradePrompt.component.vue Implements the post-grant variant UI and wires it to the billing store getter.

Comment on lines +121 to +126
it('does not render badge chip when plan.badge is absent', () => {
const wrapper = mountComponent({ plan: freePlan });
// freePlan has no badge — verify by checking the text doesn't contain any badge content
expect(wrapper.text()).not.toContain('500 compute @ signup');
expect(wrapper.text()).not.toContain('Most Popular');
});
Comment on lines +2 to +30
<!-- Post-grant variant: signup grant is depleted (Free plan, balance = 0, ledger has signup_grant entry) -->
<div v-if="exhaustedAfterGrant" class="my-4">
<v-alert type="info" variant="tonal" prominent>
<template #text>
<p class="font-weight-bold mb-1">{{ $t('billing.upgradePrompt.postGrantTitle') }}</p>
<p>{{ $t('billing.upgradePrompt.postGrantBody') }}</p>
</template>
<template #append>
<div class="d-flex flex-column ga-2">
<v-btn
data-test="cta-pack"
color="primary"
variant="flat"
size="small"
class="text-none"
@click="$emit('buy-pack')"
>
{{ $t('billing.upgradePrompt.postGrantBuyPack') }}
</v-btn>
<v-btn
data-test="cta-upgrade"
variant="text"
size="small"
class="text-none"
to="/pricing"
>
{{ $t('billing.upgradePrompt.postGrantUpgrade') }}
</v-btn>
</div>
@codecov
Copy link
Copy Markdown

codecov Bot commented May 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.54%. Comparing base (15fd466) to head (c96ec08).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4128   +/-   ##
=======================================
  Coverage   99.54%   99.54%           
=======================================
  Files          31       31           
  Lines        1089     1098    +9     
  Branches      302      308    +6     
=======================================
+ Hits         1084     1093    +9     
  Misses          5        5           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@PierreBrisorgueil PierreBrisorgueil merged commit 0ae8558 into master May 11, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants