Skip to content

Commit 2858e2d

Browse files
authored
Merge pull request #148 from SableClient/fix/clarify-notif-settings
Fix/clarify notif settings
2 parents 9db31f7 + e124ac1 commit 2858e2d

4 files changed

Lines changed: 46 additions & 23 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
sable: patch
3+
---
4+
5+
Clarify notification settings and functionality once and for all.

src/app/components/unread-badge/UnreadBadge.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,15 @@ export function UnreadBadge({ highlight, count, dm }: UnreadBadgeProps) {
2626
const [badgeCountDMsOnly] = useSetting(settingsAtom, 'badgeCountDMsOnly');
2727
const [showPingCounts] = useSetting(settingsAtom, 'showPingCounts');
2828

29-
// Show count when: (showUnreadCounts OR highlight+showPingCounts) AND (not DM-only mode OR this is a DM)
29+
/**
30+
* Show a number if there is a count and:
31+
* - Its a dm and dm counts are enabled
32+
* - Its a normal room and unread counts are enabled
33+
* - Its a ping and ping counts are enabled
34+
*/
3035
const showNumber =
31-
count > 0 && (showUnreadCounts || (highlight && showPingCounts)) && (!badgeCountDMsOnly || dm);
36+
count > 0 &&
37+
((dm && badgeCountDMsOnly) || (!dm && showUnreadCounts) || (highlight && showPingCounts));
3238

3339
return (
3440
<Badge

src/app/features/settings/notifications/SystemNotification.tsx

Lines changed: 32 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -192,16 +192,33 @@ export function SystemNotification() {
192192

193193
// Describe what the current badge combo actually does so users aren't left guessing.
194194
const badgeBehaviourSummary = (): string => {
195-
if (!showUnreadCounts && !showPingCounts) {
196-
return 'Badges show a plain dot for any unread activity — no numbers displayed.';
197-
}
198-
if (!showUnreadCounts && showPingCounts) {
199-
return 'Badges show a number only when you are directly mentioned; all other unread activity shows a plain dot.';
195+
const showDMs = badgeCountDMsOnly;
196+
const showRooms = showUnreadCounts;
197+
const showPings = showPingCounts;
198+
199+
if (showDMs && showRooms && showPings) {
200+
return 'All unread messages—DMs, Rooms, and mentions—show a number count.';
200201
}
201-
if (showUnreadCounts && badgeCountDMsOnly) {
202-
return 'Only Direct Message badges show a number count. Rooms and spaces show a plain dot instead.';
202+
if (!showDMs && !showRooms && !showPings) {
203+
return 'Badges show a plain dot for all unread activity—no numbers displayed.';
203204
}
204-
return 'All rooms and DMs show a number count for every unread message.';
205+
206+
if (showDMs && !showRooms && !showPings)
207+
return 'Only Direct Messages show a number count. Rooms and mentions show a plain dot.';
208+
if (!showDMs && showRooms && !showPings)
209+
return 'Only Rooms and spaces show a number count. DMs and mentions show a plain dot.';
210+
if (!showDMs && !showRooms && showPings)
211+
return 'Only mentions and keywords show a number count. All other activity shows a plain dot.';
212+
213+
// Case 4: Exactly two are ON
214+
if (showDMs && showRooms && !showPings)
215+
return 'DMs and Rooms show a number count. Mentions show a plain dot.';
216+
if (showDMs && !showRooms && showPings)
217+
return 'DMs and mentions show a number count. Rooms and spaces show a plain dot.';
218+
if (!showDMs && showRooms && showPings)
219+
return 'Rooms and mentions show a number count. Direct Messages show a plain dot.';
220+
221+
return ''; // Fallback
205222
};
206223

207224
return (
@@ -328,8 +345,8 @@ export function SystemNotification() {
328345
gap="400"
329346
>
330347
<SettingTile
331-
title="Show Message Counts"
332-
description="Show a number on room, space, and DM badges for every unread message."
348+
title="Show Room Counts"
349+
description="Displays a number for unread activity in Rooms and Spaces."
333350
after={
334351
<Switch variant="Primary" value={showUnreadCounts} onChange={setShowUnreadCounts} />
335352
}
@@ -342,15 +359,10 @@ export function SystemNotification() {
342359
gap="400"
343360
>
344361
<SettingTile
345-
title="Direct Messages Only"
346-
description="Only DM badges display a count. Room and space badges show a plain dot instead."
362+
title="Show DM Counts"
363+
description="Displays a number for unread Direct Messages."
347364
after={
348-
<Switch
349-
variant="Primary"
350-
value={badgeCountDMsOnly}
351-
onChange={setBadgeCountDMsOnly}
352-
disabled={!showUnreadCounts}
353-
/>
365+
<Switch variant="Primary" value={badgeCountDMsOnly} onChange={setBadgeCountDMsOnly} />
354366
}
355367
/>
356368
</SequenceCard>
@@ -361,8 +373,8 @@ export function SystemNotification() {
361373
gap="400"
362374
>
363375
<SettingTile
364-
title="Always Count Mentions"
365-
description="Show a number on any badge where you were directly mentioned, even if message counts are turned off."
376+
title="Show Mention Counts"
377+
description="Displays a number for mentions and keyword alerts."
366378
after={<Switch variant="Primary" value={showPingCounts} onChange={setShowPingCounts} />}
367379
/>
368380
</SequenceCard>

src/app/state/settings.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ const defaultSettings: Settings = {
160160
hideMembershipInReadOnly: true,
161161
useRightBubbles: false,
162162
showUnreadCounts: false,
163-
badgeCountDMsOnly: false,
163+
badgeCountDMsOnly: true,
164164
showPingCounts: true,
165165
hideReads: false,
166166
emojiSuggestThreshold: 2,

0 commit comments

Comments
 (0)