From e141abc849c46f708531b3face6df02742e212db Mon Sep 17 00:00:00 2001 From: Linus Rath <139418639+rathlinus@users.noreply.github.com> Date: Sun, 28 Jun 2026 20:31:35 +0200 Subject: [PATCH] feat: add option to hide total message count on folders (#498) --- components/layout/sidebar.tsx | 5 +++-- components/settings/layout-settings.tsx | 9 ++++++++- locales/en/common.json | 4 ++++ stores/settings-store.ts | 3 +++ 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/components/layout/sidebar.tsx b/components/layout/sidebar.tsx index c7a7a99e..6430c728 100644 --- a/components/layout/sidebar.tsx +++ b/components/layout/sidebar.tsx @@ -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 ( - + 0 ? `${unreadCount} unread / ${totalCount} total` : `${unreadCount} unread`}> {unreadNode} {unreadCount > 0 && totalCount > 0 && ( / diff --git a/components/settings/layout-settings.tsx b/components/settings/layout-settings.tsx index d997b94c..14e39d60 100644 --- a/components/settings/layout-settings.tsx +++ b/components/settings/layout-settings.tsx @@ -118,7 +118,7 @@ function MailLayoutPreview({ export function LayoutSettings() { const t = useTranslations('settings.appearance'); const tEmail = useTranslations('settings.email_behavior'); - const { toolbarPosition, showToolbarLabels, hideAccountSwitcher, showRailAccountList, enableUnifiedMailbox, includeGroupInUnified, enableAllMailView, allMailFolderIds, enableCrossUnreadView, enableCrossStarredView, enableCrossAllView, colorfulSidebarIcons, mailLayout, proInterface, updateSetting } = useSettingsStore(); + const { toolbarPosition, showToolbarLabels, hideAccountSwitcher, showRailAccountList, enableUnifiedMailbox, includeGroupInUnified, enableAllMailView, allMailFolderIds, enableCrossUnreadView, enableCrossStarredView, enableCrossAllView, colorfulSidebarIcons, showFolderTotalCount, mailLayout, proInterface, updateSetting } = useSettingsStore(); const { isSettingLocked, isSettingHidden, isFeatureEnabled } = usePolicyStore(); const accounts = useAccountStore(s => s.accounts); const activeAccountId = useAccountStore(s => s.activeAccountId); @@ -217,6 +217,13 @@ export function LayoutSettings() { /> + + updateSetting('showFolderTotalCount', checked)} + /> + + {(accounts.length > 1 || hasGroupInboxes) && !isSettingHidden('enableUnifiedMailbox') && ( ; // mailboxId -> icon name @@ -447,6 +448,7 @@ const DEFAULT_SETTINGS = { // Sidebar colorfulSidebarIcons: true, + showFolderTotalCount: true, // Folders folderIcons: {} as Record, @@ -621,6 +623,7 @@ export const useSettingsStore = create()( senderFavicons: state.senderFavicons, showAvatarsInJunk: state.showAvatarsInJunk, colorfulSidebarIcons: state.colorfulSidebarIcons, + showFolderTotalCount: state.showFolderTotalCount, folderIcons: state.folderIcons, emailKeywords: state.emailKeywords, attachmentReminderEnabled: state.attachmentReminderEnabled,