diff --git a/.changeset/clarify_notification_settings.md b/.changeset/clarify_notification_settings.md new file mode 100644 index 000000000..5023bfd42 --- /dev/null +++ b/.changeset/clarify_notification_settings.md @@ -0,0 +1,5 @@ +--- +sable: patch +--- + +Clarify notification settings and functionality once and for all. diff --git a/src/app/components/unread-badge/UnreadBadge.tsx b/src/app/components/unread-badge/UnreadBadge.tsx index 4648ae053..1ad2605ab 100644 --- a/src/app/components/unread-badge/UnreadBadge.tsx +++ b/src/app/components/unread-badge/UnreadBadge.tsx @@ -26,9 +26,15 @@ export function UnreadBadge({ highlight, count, dm }: UnreadBadgeProps) { const [badgeCountDMsOnly] = useSetting(settingsAtom, 'badgeCountDMsOnly'); const [showPingCounts] = useSetting(settingsAtom, 'showPingCounts'); - // Show count when: (showUnreadCounts OR highlight+showPingCounts) AND (not DM-only mode OR this is a DM) + /** + * Show a number if there is a count and: + * - Its a dm and dm counts are enabled + * - Its a normal room and unread counts are enabled + * - Its a ping and ping counts are enabled + */ const showNumber = - count > 0 && (showUnreadCounts || (highlight && showPingCounts)) && (!badgeCountDMsOnly || dm); + count > 0 && + ((dm && badgeCountDMsOnly) || (!dm && showUnreadCounts) || (highlight && showPingCounts)); return ( { - if (!showUnreadCounts && !showPingCounts) { - return 'Badges show a plain dot for any unread activity — no numbers displayed.'; - } - if (!showUnreadCounts && showPingCounts) { - return 'Badges show a number only when you are directly mentioned; all other unread activity shows a plain dot.'; + const showDMs = badgeCountDMsOnly; + const showRooms = showUnreadCounts; + const showPings = showPingCounts; + + if (showDMs && showRooms && showPings) { + return 'All unread messages—DMs, Rooms, and mentions—show a number count.'; } - if (showUnreadCounts && badgeCountDMsOnly) { - return 'Only Direct Message badges show a number count. Rooms and spaces show a plain dot instead.'; + if (!showDMs && !showRooms && !showPings) { + return 'Badges show a plain dot for all unread activity—no numbers displayed.'; } - return 'All rooms and DMs show a number count for every unread message.'; + + if (showDMs && !showRooms && !showPings) + return 'Only Direct Messages show a number count. Rooms and mentions show a plain dot.'; + if (!showDMs && showRooms && !showPings) + return 'Only Rooms and spaces show a number count. DMs and mentions show a plain dot.'; + if (!showDMs && !showRooms && showPings) + return 'Only mentions and keywords show a number count. All other activity shows a plain dot.'; + + // Case 4: Exactly two are ON + if (showDMs && showRooms && !showPings) + return 'DMs and Rooms show a number count. Mentions show a plain dot.'; + if (showDMs && !showRooms && showPings) + return 'DMs and mentions show a number count. Rooms and spaces show a plain dot.'; + if (!showDMs && showRooms && showPings) + return 'Rooms and mentions show a number count. Direct Messages show a plain dot.'; + + return ''; // Fallback }; return ( @@ -328,8 +345,8 @@ export function SystemNotification() { gap="400" > } @@ -342,15 +359,10 @@ export function SystemNotification() { gap="400" > + } /> @@ -361,8 +373,8 @@ export function SystemNotification() { gap="400" > } /> diff --git a/src/app/state/settings.ts b/src/app/state/settings.ts index 29bea6897..ab4d6ef18 100644 --- a/src/app/state/settings.ts +++ b/src/app/state/settings.ts @@ -160,7 +160,7 @@ const defaultSettings: Settings = { hideMembershipInReadOnly: true, useRightBubbles: false, showUnreadCounts: false, - badgeCountDMsOnly: false, + badgeCountDMsOnly: true, showPingCounts: true, hideReads: false, emojiSuggestThreshold: 2,