Skip to content

Commit 42bc4b8

Browse files
committed
chore(webapp): tighten comments
1 parent d20df98 commit 42bc4b8

3 files changed

Lines changed: 3 additions & 13 deletions

File tree

apps/webapp/app/components/billing/BillingLimitConfigSection.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ export function isBillingLimitFormDirty(input: {
5555
customAmount: string;
5656
cancelInProgressRuns: boolean;
5757
}): boolean {
58-
// No mode selected yet (unconfigured limit) — nothing to save.
5958
if (input.mode === "") {
6059
return false;
6160
}
@@ -116,7 +115,7 @@ export function BillingLimitConfigSection({
116115
: "";
117116
const savedCancelInProgressRuns = billingLimit.isConfigured && billingLimit.cancelInProgressRuns;
118117

119-
// When no limit is configured yet, start with no radio option selected.
118+
// Unconfigured limit starts with nothing selected.
120119
const resetMode: "" | "none" | "plan" | "custom" = billingLimit.isConfigured ? savedMode : "";
121120

122121
const [mode, setMode] = useState<"" | "none" | "plan" | "custom">(resetMode);

apps/webapp/app/components/billing/OrgBanner.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,6 @@ export function OrgBanner() {
6363
case OrgBannerKind.LimitGrace:
6464
return hideBillingLimitBanner ? null : <LimitGraceBanner />;
6565
case OrgBannerKind.NoLimitConfigured:
66-
// On the billing-limits page we still surface the warning, but without the
67-
// "Configure billing limit" action — the form is already on the page.
6866
return <NoLimitConfiguredBanner onBillingLimitsPage={hideBillingLimitBanner} />;
6967
case OrgBannerKind.Upgrade:
7068
return organization ? <UpgradeBanner /> : null;
@@ -147,7 +145,6 @@ function NoLimitConfiguredBanner({ onBillingLimitsPage }: { onBillingLimitsPage:
147145
const organization = useOrganization();
148146
const canManageBillingLimits = useCanManageBillingLimits();
149147

150-
// Users who can't manage billing limits can't act on this — no banner for them.
151148
if (!canManageBillingLimits) {
152149
return null;
153150
}

apps/webapp/app/services/billingAlertsDefaults.server.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,8 @@ import { ABSOLUTE_ALERT_BASE_CENTS } from "~/components/billing/billingAlertsFor
55
const DEFAULT_ALERT_THRESHOLD_DOLLARS = [5, 100, 500, 1000, 2500];
66

77
/**
8-
* Build the default billing alerts for an org that has none configured.
9-
*
10-
* The platform evaluates alerts as `usage / amount >= level`. Setting `amount`
11-
* to the $1 base (100 cents) turns `alertLevels` into absolute dollar thresholds,
12-
* which is what the current "no limit configured" UI expects.
13-
*
14-
* Emails are left empty: the platform falls back to org admin/member addresses
15-
* when no recipients are configured.
8+
* Alerts fire at `usage / amount >= level`; amount = 100 cents makes levels
9+
* absolute dollar thresholds. Empty emails fall back to org admins.
1610
*/
1711
export function buildDefaultBillingAlerts(): UpdateBillingAlertsRequest {
1812
return {

0 commit comments

Comments
 (0)