From c4d8c365024d7fc4443c3e1a3475fe6f418bd2e8 Mon Sep 17 00:00:00 2001 From: Andrew Maguire Date: Thu, 18 Jun 2026 11:43:12 +0100 Subject: [PATCH] Make inbox sidebar badge follow active filters The left sidebar inbox badge called useInboxAllReports({ ignoreFilters: true }), so it always showed the total pull-request count regardless of the source (e.g. Scouts), priority, or search filters the user applied in the inbox. That left the badge contradicting the count next to the Pull requests tab, which is confusing. Drop ignoreFilters so the badge tracks the same filtered count the Pull requests tab shows. Scope (For you / Entire project) already followed the user's choice and still does. Generated-By: PostHog Code Task-Id: 8109cd32-837e-42f2-929e-b762c683b86e --- .../ui/src/features/inbox/hooks/useInboxAllReports.ts | 4 ++-- .../features/sidebar/components/SidebarNavSection.tsx | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/packages/ui/src/features/inbox/hooks/useInboxAllReports.ts b/packages/ui/src/features/inbox/hooks/useInboxAllReports.ts index 276cfe94c..eb5b4e607 100644 --- a/packages/ui/src/features/inbox/hooks/useInboxAllReports.ts +++ b/packages/ui/src/features/inbox/hooks/useInboxAllReports.ts @@ -113,8 +113,8 @@ export function useInboxAllReports(options?: { status: INBOX_PIPELINE_STATUS_FILTER, has_implementation_pr: true, // Mirror the list query's active filters so the badge matches the tab - // body. These are empty when `ignoreFilters` is set (sidebar usage), so - // the count stays scope-only there. + // body. These are empty when `ignoreFilters` is set (e.g. the Runs tab), + // so the count stays scope-only there. source_product: sourceProductFilter.length > 0 ? sourceProductFilter.join(",") diff --git a/packages/ui/src/features/sidebar/components/SidebarNavSection.tsx b/packages/ui/src/features/sidebar/components/SidebarNavSection.tsx index b13a01201..8ced0fe42 100644 --- a/packages/ui/src/features/sidebar/components/SidebarNavSection.tsx +++ b/packages/ui/src/features/sidebar/components/SidebarNavSection.tsx @@ -82,10 +82,11 @@ export function SidebarNavSection({ const isMcpServersActive = view.type === "mcp-servers"; // Open pull requests in the inbox — the main CTA, and the same count the inbox - // Pull requests tab shows, so the badge and the tab always agree. - // `ignoreFilters` keeps the badge stable against the inbox's filter chrome; - // scope still follows the user's For-you / project choice. - const { counts: inboxCounts } = useInboxAllReports({ ignoreFilters: true }); + // Pull requests tab shows, so the badge and the tab always agree. The badge + // tracks the inbox's active source/priority/search filters (and the user's + // For-you / project scope) so it never shows a total that contradicts the + // filtered list the user is looking at. + const { counts: inboxCounts } = useInboxAllReports(); const inboxPullRequestCount = inboxCounts.pulls; // Only subscribe to the task list when a parent hasn't already supplied the