Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/clarify_notification_settings.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
sable: patch
---

Clarify notification settings and functionality once and for all.
10 changes: 8 additions & 2 deletions src/app/components/unread-badge/UnreadBadge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<Badge
Expand Down
52 changes: 32 additions & 20 deletions src/app/features/settings/notifications/SystemNotification.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -192,16 +192,33 @@ export function SystemNotification() {

// Describe what the current badge combo actually does so users aren't left guessing.
const badgeBehaviourSummary = (): string => {
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 (
Expand Down Expand Up @@ -328,8 +345,8 @@ export function SystemNotification() {
gap="400"
>
<SettingTile
title="Show Message Counts"
description="Show a number on room, space, and DM badges for every unread message."
title="Show Room Counts"
description="Displays a number for unread activity in Rooms and Spaces."
after={
<Switch variant="Primary" value={showUnreadCounts} onChange={setShowUnreadCounts} />
}
Expand All @@ -342,15 +359,10 @@ export function SystemNotification() {
gap="400"
>
<SettingTile
title="Direct Messages Only"
description="Only DM badges display a count. Room and space badges show a plain dot instead."
title="Show DM Counts"
description="Displays a number for unread Direct Messages."
after={
<Switch
variant="Primary"
value={badgeCountDMsOnly}
onChange={setBadgeCountDMsOnly}
disabled={!showUnreadCounts}
/>
<Switch variant="Primary" value={badgeCountDMsOnly} onChange={setBadgeCountDMsOnly} />
}
/>
</SequenceCard>
Expand All @@ -361,8 +373,8 @@ export function SystemNotification() {
gap="400"
>
<SettingTile
title="Always Count Mentions"
description="Show a number on any badge where you were directly mentioned, even if message counts are turned off."
title="Show Mention Counts"
description="Displays a number for mentions and keyword alerts."
after={<Switch variant="Primary" value={showPingCounts} onChange={setShowPingCounts} />}
/>
</SequenceCard>
Expand Down
2 changes: 1 addition & 1 deletion src/app/state/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ const defaultSettings: Settings = {
hideMembershipInReadOnly: true,
useRightBubbles: false,
showUnreadCounts: false,
badgeCountDMsOnly: false,
badgeCountDMsOnly: true,
showPingCounts: true,
hideReads: false,
emojiSuggestThreshold: 2,
Expand Down
Loading