feat: add option to hide total message count on folders (#498)

This commit is contained in:
Linus Rath
2026-06-28 20:31:35 +02:00
parent 1f4afe082b
commit e141abc849
4 changed files with 18 additions and 3 deletions
+3 -2
View File
@@ -184,8 +184,9 @@ function SidebarRowCounts({
isSelected: boolean;
onUnreadClick?: () => void;
}) {
const showFolderTotalCount = useSettingsStore(s => s.showFolderTotalCount);
const unreadCount = unread ?? 0;
const totalCount = total ?? 0;
const totalCount = showFolderTotalCount ? (total ?? 0) : 0;
if (unreadCount === 0 && totalCount === 0) return null;
@@ -219,7 +220,7 @@ function SidebarRowCounts({
) : null;
return (
<span className="ml-2 flex-shrink-0 flex items-baseline gap-1" title={`${unreadCount} unread / ${totalCount} total`}>
<span className="ml-2 flex-shrink-0 flex items-baseline gap-1" title={totalCount > 0 ? `${unreadCount} unread / ${totalCount} total` : `${unreadCount} unread`}>
{unreadNode}
{unreadCount > 0 && totalCount > 0 && (
<span className="text-xs text-muted-foreground/60">/</span>