From 36e4e67025a3b55c5169a1c70f28dae279d854cf Mon Sep 17 00:00:00 2001 From: hougangdev Date: Sat, 7 Mar 2026 17:38:07 +0800 Subject: [PATCH] fix(sidebar-badges): include approvals in inbox badge count MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When a company has "require board approval for new agents" enabled, hiring an agent creates a pending approval that requires the user (as a board member) to approve before the agent can start working. However, the sidebar inbox badge did not include pending approvals in its count, so there was no visual indicator that action was needed. Users had no way of knowing an approval was waiting unless they happened to open the Inbox page manually. The root cause: the sidebar-badges service correctly included approvals in the inbox total, but the route handler overwrites badges.inbox to add alertsCount and staleIssueCount — and in doing so dropped badges.approvals from the sum. Add badges.approvals to the inbox count recalculation so that pending and revision-requested approvals surface in the sidebar notification badge alongside failed runs, alerts, stale work, and join requests. Affected files: - server/src/routes/sidebar-badges.ts --- server/src/routes/sidebar-badges.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/routes/sidebar-badges.ts b/server/src/routes/sidebar-badges.ts index edf34709..0cd302e5 100644 --- a/server/src/routes/sidebar-badges.ts +++ b/server/src/routes/sidebar-badges.ts @@ -45,7 +45,7 @@ export function sidebarBadgeRoutes(db: Db) { const alertsCount = (summary.agents.error > 0 && !hasFailedRuns ? 1 : 0) + (summary.costs.monthBudgetCents > 0 && summary.costs.monthUtilizationPercent >= 80 ? 1 : 0); - badges.inbox = badges.failedRuns + alertsCount + staleIssueCount + joinRequestCount; + badges.inbox = badges.failedRuns + alertsCount + staleIssueCount + joinRequestCount + badges.approvals; res.json(badges); });