Skip to content

Commit 95307ba

Browse files
authored
fix(webapp): tidy Usage page credits display (#4322)
Two small corrections to the organization **Usage** page credits display. ### 1. Label the credits panel "Credits" (was "Promo credits") The panel surfaces any credit balance, not only promo-code redemptions, so "Promo credits" is misleading when the credits come from another source. Renamed the heading to "Credits". ### 2. Don't show "Included usage" for Enterprise orgs Enterprise inherits the Pro plan's `includedUsage` value, so the Usage bar rendered an "Included usage: $50" tier marker for Enterprise organizations. Enterprise bills against prepaid credits rather than a per-month included-usage tier, so the marker was misleading. The `tierLimit` marker is now suppressed for Enterprise (`plan.type === "enterprise"`). Verified with `pnpm run typecheck --filter webapp`.
1 parent 0b29194 commit 95307ba

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

  • apps/webapp/app/routes/_app.orgs.$organizationSlug.settings.usage

apps/webapp/app/routes/_app.orgs.$organizationSlug.settings.usage/route.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,9 @@ export default function Page() {
114114
const currentPlan = useCurrentPlan();
115115
const billingLimit = useBillingLimit();
116116
const planLimitCents = currentPlan?.v3Subscription?.plan?.limits.includedUsage ?? 0;
117+
// Enterprise bills against prepaid credits, not a per-month included-usage tier,
118+
// so the "Included usage" marker doesn't apply.
119+
const isEnterprise = currentPlan?.v3Subscription?.plan?.type === "enterprise";
117120
const billingLimitDollars = isCurrentMonth
118121
? getUsageBarBillingLimitDollars(billingLimit, planLimitCents)
119122
: undefined;
@@ -157,7 +160,7 @@ export default function Page() {
157160
<div className="flex flex-col gap-1 border-t border-grid-dimmed p-3">
158161
<div className="flex items-end gap-8">
159162
<div className="flex flex-col gap-1">
160-
<Header2 className="whitespace-nowrap">Promo credits</Header2>
163+
<Header2 className="whitespace-nowrap">Credits</Header2>
161164
<p className="whitespace-nowrap text-3xl font-medium text-text-bright">
162165
{formatCurrency(promoCredits.remainingCents / 100, false)}
163166
</p>
@@ -215,7 +218,9 @@ export default function Page() {
215218
<UsageBar
216219
current={usage.overall.current}
217220
isPaying={currentPlan?.v3Subscription?.isPaying ?? false}
218-
tierLimit={isCurrentMonth ? planLimitCents / 100 : undefined}
221+
tierLimit={
222+
isCurrentMonth && !isEnterprise ? planLimitCents / 100 : undefined
223+
}
219224
billingLimit={billingLimitDollars}
220225
/>
221226
</div>

0 commit comments

Comments
 (0)