From 497d74eddf1f1dd99d2c6bf9afbf3f0792ee8c01 Mon Sep 17 00:00:00 2001 From: Evie Gauthier Date: Wed, 4 Mar 2026 10:43:15 -0500 Subject: [PATCH] fix(badges): show highlight count on highlighted badges, total on standard The UnreadBadge supports a separate highlight count and total count, but all call sites were only passing the total. Update DirectTab, HomeTab, SpaceTabs, and Search to pass the highlight count when the badge is in highlight state, so @-mention counts are reflected accurately in the sidebar. --- src/app/features/search/Search.tsx | 2 +- src/app/pages/client/sidebar/DirectTab.tsx | 5 ++++- src/app/pages/client/sidebar/HomeTab.tsx | 5 ++++- src/app/pages/client/sidebar/SpaceTabs.tsx | 10 ++++++++-- 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/app/features/search/Search.tsx b/src/app/features/search/Search.tsx index e326bf04..9d4ea351 100644 --- a/src/app/features/search/Search.tsx +++ b/src/app/features/search/Search.tsx @@ -342,7 +342,7 @@ export function Search({ requestClose }: SearchProps) { 0} - count={unread.total} + count={unread.highlight > 0 ? unread.highlight : unread.total} /> )} diff --git a/src/app/pages/client/sidebar/DirectTab.tsx b/src/app/pages/client/sidebar/DirectTab.tsx index 01d7ce3f..37473bf8 100644 --- a/src/app/pages/client/sidebar/DirectTab.tsx +++ b/src/app/pages/client/sidebar/DirectTab.tsx @@ -108,7 +108,10 @@ export function DirectTab() { {directUnread && ( 0}> - 0} count={directUnread.total} /> + 0} + count={directUnread.highlight > 0 ? directUnread.highlight : directUnread.total} + /> )} {menuAnchor && ( diff --git a/src/app/pages/client/sidebar/HomeTab.tsx b/src/app/pages/client/sidebar/HomeTab.tsx index 74f7adfa..a19aee98 100644 --- a/src/app/pages/client/sidebar/HomeTab.tsx +++ b/src/app/pages/client/sidebar/HomeTab.tsx @@ -110,7 +110,10 @@ export function HomeTab() { {homeUnread && ( 0}> - 0} count={homeUnread.total} /> + 0} + count={homeUnread.highlight > 0 ? homeUnread.highlight : homeUnread.total} + /> )} {menuAnchor && ( diff --git a/src/app/pages/client/sidebar/SpaceTabs.tsx b/src/app/pages/client/sidebar/SpaceTabs.tsx index 99f54040..bc3927da 100644 --- a/src/app/pages/client/sidebar/SpaceTabs.tsx +++ b/src/app/pages/client/sidebar/SpaceTabs.tsx @@ -466,7 +466,10 @@ function SpaceTab({ {unread && ( 0}> - 0} count={unread.total} /> + 0} + count={unread.highlight > 0 ? unread.highlight : unread.total} + /> )} {menuAnchor && ( @@ -598,7 +601,10 @@ function ClosedSpaceFolder({ {unread && ( 0}> - 0} count={unread.total} /> + 0} + count={unread.highlight > 0 ? unread.highlight : unread.total} + /> )}