Skip to content

The open-source app everyone uses to manage agents at work

fix: show "Unlimited budget" when budget is $0

Forgottenb49fc7451a94
diff --git a/ui/src/pages/Companies.tsx b/ui/src/pages/Companies.tsx
index f6f8a9e215..abf73e0ba9 100644
--- a/ui/src/pages/Companies.tsx
+++ b/ui/src/pages/Companies.tsx
@@ -247,12 +247,11 @@ export function Companies() {
<div className="flex items-center gap-1.5">
<DollarSign className="h-3.5 w-3.5" />
<span>
- {formatCents(company.spentMonthlyCents)} /{" "}
- {formatCents(company.budgetMonthlyCents)}
+ {formatCents(company.spentMonthlyCents)}
+ {company.budgetMonthlyCents > 0
+ ? <> / {formatCents(company.budgetMonthlyCents)} <span className="text-xs">({budgetPct}%)</span></>
+ : <span className="text-xs ml-1">Unlimited budget</span>}
</span>
- {company.budgetMonthlyCents > 0 && (
- <span className="text-xs">({budgetPct}%)</span>
- )}
</div>
<div className="flex items-center gap-1.5 ml-auto">
<Calendar className="h-3.5 w-3.5" />
diff --git a/ui/src/pages/Costs.tsx b/ui/src/pages/Costs.tsx
index e3abcbaef4..e39d6150d7 100644
--- a/ui/src/pages/Costs.tsx
+++ b/ui/src/pages/Costs.tsx
@@ -134,28 +134,34 @@ export function Costs() {
<CardContent className="p-4 space-y-3">
<div className="flex items-center justify-between">
<p className="text-sm text-muted-foreground">{PRESET_LABELS[preset]}</p>
- <p className="text-sm text-muted-foreground">
- {data.summary.utilizationPercent}% utilized
- </p>
+ {data.summary.budgetCents > 0 && (
+ <p className="text-sm text-muted-foreground">
+ {data.summary.utilizationPercent}% utilized
+ </p>
+ )}
</div>
<p className="text-2xl font-bold">
{formatCents(data.summary.spendCents)}{" "}
<span className="text-base font-normal text-muted-foreground">
- / {formatCents(data.summary.budgetCents)}
+ {data.summary.budgetCents > 0
+ ? `/ ${formatCents(data.summary.budgetCents)}`
+ : "Unlimited budget"}
</span>
</p>
- <div className="w-full h-2 bg-muted rounded-full overflow-hidden">
- <div
- className={`h-full rounded-full transition-all ${
- data.summary.utilizationPercent > 90
- ? "bg-red-400"
- : data.summary.utilizationPercent > 70
- ? "bg-yellow-400"
- : "bg-green-400"
- }`}
- style={{ width: `${Math.min(100, data.summary.utilizationPercent)}%` }}
- />
- </div>
+ {data.summary.budgetCents > 0 && (
+ <div className="w-full h-2 bg-muted rounded-full overflow-hidden">
+ <div
+ className={`h-full rounded-full transition-all ${
+ data.summary.utilizationPercent > 90
+ ? "bg-red-400"
+ : data.summary.utilizationPercent > 70
+ ? "bg-yellow-400"
+ : "bg-green-400"
+ }`}
+ style={{ width: `${Math.min(100, data.summary.utilizationPercent)}%` }}
+ />
+ </div>
+ )}
</CardContent>
</Card>
diff --git a/ui/src/pages/Dashboard.tsx b/ui/src/pages/Dashboard.tsx
index 40de97536c..4cd6b7d69e 100644
--- a/ui/src/pages/Dashboard.tsx
+++ b/ui/src/pages/Dashboard.tsx
@@ -211,7 +211,9 @@ export function Dashboard() {
onClick={() => navigate("/costs")}
description={
<span className="cursor-pointer" onClick={() => navigate("/costs")}>
- {data.costs.monthUtilizationPercent}% of {formatCents(data.costs.monthBudgetCents)} budget
+ {data.costs.monthBudgetCents > 0
+ ? `${data.costs.monthUtilizationPercent}% of ${formatCents(data.costs.monthBudgetCents)} budget`
+ : "Unlimited budget"}
</span>
}
/>
diff --git a/ui/src/pages/Inbox.tsx b/ui/src/pages/Inbox.tsx
index 0277b9abbb..35cb92598b 100644
--- a/ui/src/pages/Inbox.tsx
+++ b/ui/src/pages/Inbox.tsx
@@ -195,7 +195,7 @@ export function Inbox() {
!!dashboard && dashboard.agents.error > 0 && !hasRunFailures;
const hasAlerts =
!!dashboard &&
- (showAggregateAgentError || dashboard.costs.monthUtilizationPercent >= 80);
+ (showAggregateAgentError || (dashboard.costs.monthBudgetCents > 0 && dashboard.costs.monthUtilizationPercent >= 80));
const hasStale = staleIssues.length > 0;
const hasContent = hasActionableApprovals || hasRunFailures || hasAlerts || hasStale;
@@ -339,7 +339,7 @@ export function Inbox() {
</span>
</div>
)}
- {dashboard!.costs.monthUtilizationPercent >= 80 && (
+ {dashboard!.costs.monthBudgetCents > 0 && dashboard!.costs.monthUtilizationPercent >= 80 && (
<div
className="flex cursor-pointer items-center gap-3 px-4 py-3 transition-colors hover:bg-accent/50"
onClick={() => navigate("/costs")}