Skip to content

Commit 5cbfd82

Browse files
committed
fix(team-inbox): hide filter unread counts
1 parent 9ed23b4 commit 5cbfd82

2 files changed

Lines changed: 46 additions & 38 deletions

File tree

src/modules/MainApp/TeamInbox/__tests__/TeamInboxList.test.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,28 @@ describe("TeamInboxList pagination", () => {
123123
expect(markup).not.toContain("teamInbox.search.");
124124
});
125125

126+
it("does not render unread count bubbles on inbox filters", () => {
127+
const markup = renderToStaticMarkup(
128+
createElement(TeamInboxList, {
129+
filter: "all",
130+
items: [],
131+
selectedItemId: null,
132+
totalUnread: 6,
133+
unreadCounts: { all: 6, mentions: 2, assigned: 4 },
134+
query: "",
135+
loading: false,
136+
onQueryChange: vi.fn(),
137+
onFilterChange: vi.fn(),
138+
onSelectItem: vi.fn(),
139+
})
140+
);
141+
142+
expect(markup).not.toContain("rounded-full bg-primary-6");
143+
expect(markup).not.toContain(">6</span>");
144+
expect(markup).not.toContain(">2</span>");
145+
expect(markup).not.toContain(">4</span>");
146+
});
147+
126148
it("shows one reusable progress line below search while loading", () => {
127149
const markup = renderEmptyList("", true);
128150

src/modules/MainApp/TeamInbox/components/TeamInboxList.tsx

Lines changed: 24 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -168,18 +168,6 @@ function TeamInboxListSection({
168168
);
169169
}
170170

171-
function FilterUnreadBadge({ count }: { count: number }): React.ReactNode {
172-
if (count <= 0) return null;
173-
return (
174-
<span
175-
aria-hidden
176-
className="pointer-events-none absolute -right-1 -top-1 z-10 min-w-4 rounded-full bg-primary-6 px-1 text-center text-xs font-semibold leading-4 text-white"
177-
>
178-
{count > 99 ? "99+" : count}
179-
</span>
180-
);
181-
}
182-
183171
const TeamInboxList: React.FC<TeamInboxListProps> = ({
184172
filter,
185173
items,
@@ -517,32 +505,30 @@ const TeamInboxList: React.FC<TeamInboxListProps> = ({
517505
})}`
518506
: filterTab.label;
519507
return (
520-
<span key={filterTab.key} className="relative inline-flex">
521-
<Button
522-
htmlType="button"
523-
variant="tertiary"
524-
size="small"
525-
icon={
526-
<span
527-
className={
528-
filterTab.key === "all" && isActive
529-
? "text-primary-6"
530-
: filterTab.iconClassName
531-
}
532-
>
533-
{filterTab.icon}
534-
</span>
535-
}
536-
iconOnly
537-
className={`h-7 w-7 ${isActive ? "!bg-fill-2 !text-text-1" : ""}`}
538-
aria-label={unreadLabel}
539-
aria-pressed={isActive}
540-
title={unreadLabel}
541-
data-testid={`team-inbox-filter-${filterTab.key}`}
542-
onClick={() => onFilterChange(filterTab.key)}
543-
/>
544-
<FilterUnreadBadge count={filterTab.unreadCount} />
545-
</span>
508+
<Button
509+
key={filterTab.key}
510+
htmlType="button"
511+
variant="tertiary"
512+
size="small"
513+
icon={
514+
<span
515+
className={
516+
filterTab.key === "all" && isActive
517+
? "text-primary-6"
518+
: filterTab.iconClassName
519+
}
520+
>
521+
{filterTab.icon}
522+
</span>
523+
}
524+
iconOnly
525+
className={`h-7 w-7 ${isActive ? "!bg-fill-2 !text-text-1" : ""}`}
526+
aria-label={unreadLabel}
527+
aria-pressed={isActive}
528+
title={unreadLabel}
529+
data-testid={`team-inbox-filter-${filterTab.key}`}
530+
onClick={() => onFilterChange(filterTab.key)}
531+
/>
546532
);
547533
})}
548534
</div>

0 commit comments

Comments
 (0)