fix(billing): explain the merged usage limit as $20 included + org spend limit#3509
Conversation
|
😎 Merged successfully - details. |
|
React Doctor found 1 issue in 1 file · 1 warning. 1 warning
Reviewed by React Doctor for commit |
|
✅ Visual changes approved by @adboio — baseline updated in 10 new. |
…spend limit
A subscribed org's ai_credits.limit_usd arrives from the gateway as one
merged number: the $20 included monthly allowance plus the configured
spend limit. The plans-page meter and title-bar card rendered it raw, so
an org on the default limit saw a total matching nothing it configured,
and the billing announcement modal misquoted the merged number as the
org's spend limit.
Derive the breakdown in codeUsageMeter (via codeOrgSpendLimitUsd), spell
it out under both meters ("$20 included + $50 org spend limit"), notch
the plans-page bar where the included allowance ends, and quote the
recovered spend limit in the announcement modal.
Generated-By: PostHog Code
Task-Id: b24f71e2-3751-4a6b-b5d8-a24147c4c067
c8d104e to
4b698f8
Compare
This stack of pull requests is managed by Graphite. Learn more about stacking. |
|
Reviews (1): Last reviewed commit: "feat(billing): segment the usage bar int..." | Re-trigger Greptile |
…tions The 1px notch marking where the included allowance ends was barely visible in either theme. Replace it with a physically segmented bar: the $20 included allowance and the org spend limit render as separate gap-divided segments, usage fills the included segment green before pouring into the accent spend-limit segment, and a dot legend names each amount. Exceeded turns both segments and dots red; a $0 spend limit collapses to the included segment alone; the free tier keeps the plain single-track bar. Generated-By: PostHog Code Task-Id: b24f71e2-3751-4a6b-b5d8-a24147c4c067
4b698f8 to
82b3e9c
Compare
There was a problem hiding this comment.
Gates denied this PR because it touches billing code. Additionally, there is an unresolved correctness concern: the code hardcodes a $20 included allowance constant to back-calculate the org spend limit from a merged API value, which will report incorrect spend limits for plans where the included allowance differs from $20. The author acknowledged this as a known issue deferred to a follow-up, meaning the bug ships with this PR.
10 updated Run: 31ffb0f9-8ac6-42a7-9d0d-21c01935161b Co-authored-by: adboio <23323033+adboio@users.noreply.github.com>
Merge activity
|

Problem
usage bar does not make it clear what's free vs. what's paid usage (up to org limit)
Changes
segments the bar to show this better :)
How did you test this?
usageDisplay.test.ts(pnpm --filter @posthog/core test— 2406 passing) and the full@posthog/uisuite (1682 passing).turbo typecheckfor@posthog/core+@posthog/ui;biome checkclean;biome lint packages/coreshows zeronoRestrictedImports.Automatic notifications
Created with PostHog Code