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.
This commit is contained in:
Evie Gauthier committed 2026-03-04 10:54:25 -05:00
1 parent a2d61da254
commit 497d74eddf
4 files changed
+17 -5

No files matched your search

+1 -1
View File
@@ -342,7 +342,7 @@ export function Search({ requestClose }: SearchProps) {
<UnreadBadgeCenter>
<UnreadBadge
highlight={unread.highlight > 0}
count={unread.total}
count={unread.highlight > 0 ? unread.highlight : unread.total}
/>
</UnreadBadgeCenter>
)}
+4 -1
View File
@@ -108,7 +108,10 @@ export function DirectTab() {
</SidebarItemTooltip>
{directUnread && (
<SidebarItemBadge hasCount={directUnread.total > 0}>
<UnreadBadge highlight={directUnread.highlight > 0} count={directUnread.total} />
<UnreadBadge
highlight={directUnread.highlight > 0}
count={directUnread.highlight > 0 ? directUnread.highlight : directUnread.total}
/>
</SidebarItemBadge>
)}
{menuAnchor && (
+4 -1
View File
@@ -110,7 +110,10 @@ export function HomeTab() {
</SidebarItemTooltip>
{homeUnread && (
<SidebarItemBadge hasCount={homeUnread.total > 0}>
<UnreadBadge highlight={homeUnread.highlight > 0} count={homeUnread.total} />
<UnreadBadge
highlight={homeUnread.highlight > 0}
count={homeUnread.highlight > 0 ? homeUnread.highlight : homeUnread.total}
/>
</SidebarItemBadge>
)}
{menuAnchor && (
+8 -2
View File
@@ -466,7 +466,10 @@ function SpaceTab({
</SidebarItemTooltip>
{unread && (
<SidebarItemBadge hasCount={unread.total > 0}>
<UnreadBadge highlight={unread.highlight > 0} count={unread.total} />
<UnreadBadge
highlight={unread.highlight > 0}
count={unread.highlight > 0 ? unread.highlight : unread.total}
/>
</SidebarItemBadge>
)}
{menuAnchor && (
@@ -598,7 +601,10 @@ function ClosedSpaceFolder({
</SidebarItemTooltip>
{unread && (
<SidebarItemBadge hasCount={unread.total > 0}>
<UnreadBadge highlight={unread.highlight > 0} count={unread.total} />
<UnreadBadge
highlight={unread.highlight > 0}
count={unread.highlight > 0 ? unread.highlight : unread.total}
/>
</SidebarItemBadge>
)}
</SidebarItem>