feat: Update usage limit modal for Pro users#2399
Merged
Merged
Conversation
Member
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Contributor
What T-Rex did
ArtifactsGenerated UsageLimitModal component test run
Generated UsageLimitModal component tests
Existing usageLimitStore and billing utils test run
Prompt To Fix All With AIFix the following 3 code review issues. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 3
apps/code/src/renderer/features/billing/subscriptions.ts:23-26
**Use event plan**
This threshold event already carries the authoritative `isPro` value from the usage monitor, but this path drops it and leaves the modal to recompute plan state from `useSeat()`. On app startup or after auth changes, the billing subscription can receive a 100% event while the seat fetch is still in flight, so a Pro user can be treated as Free and shown the `See Pro` upgrade CTA. Store the event's plan value with the modal context and use `useSeat()` only for fallback opens that do not come from a threshold event.
### Issue 2 of 3
apps/code/src/renderer/features/billing/components/UsageLimitModal.tsx:38-40
**Handle support failure**
`openExternal.mutate` returns a Promise, but this click handler drops it without `await`, `void`, or `.catch`. If the main process rejects the request or the mail client cannot be opened, the renderer gets an unhandled rejection and the user gets no feedback from the modal.
```suggestion
const handleSupport = () => {
void trpcClient.os.openExternal.mutate({ url: SUPPORT_MAILTO });
};
```
### Issue 3 of 3
apps/code/src/renderer/features/billing/components/UsageLimitModal.tsx:61-63
**Preserve monthly copy**
For Free users on the sustained bucket, the title says they are out of usage for this month, but the body falls through to the generic `Free usage limit` wording. That loses the new bucket-specific message for the monthly cap and makes the modal copy disagree with itself.
```suggestion
: `You've hit your Free ${
isDaily ? "daily" : isMonthly ? "monthly" : "usage"
} limit. Upgrade to Pro for 20x more usage.`;
```
Reviews (1): Last reviewed commit: "Update usage limit modal for Pro users" | Re-trigger Greptile |
233cdcf to
3414316
Compare
adboio
approved these changes
May 28, 2026
Comment on lines
+12
to
+13
| const SUPPORT_MAILTO = | ||
| "mailto:charles@posthog.com?subject=PostHog%20Code%20%E2%80%94%20Pro%20usage%20limit"; |
Contributor
There was a problem hiding this comment.
this would probably be a good place to use the conversations product so we can set up automations (like message -> slack or something)
not blocking but something to consider moving fwd!
Member
Author
Merge activity
|
3414316 to
aadbb5d
Compare
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.

Problem
Pro users hitting the daily cap saw the same "upgrade to Pro" pitch as Free users, treating a normal reset window like a paywall.
Changes
How did you test this?
Manually
Publish to changelog?
no