Merge pull request #148 from SableClient/fix/clarify-notif-settings
Fix/clarify notif settings
This commit is contained in:
4 files changed
+46
-23
No files matched your search
@@ -0,0 +1,5 @@
|
||||
---
|
||||
sable: patch
|
||||
---
|
||||
|
||||
Clarify notification settings and functionality once and for all.
|
||||
@@ -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
|
||||
|
||||
@@ -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.';
|
||||
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 && showPingCounts) {
|
||||
return 'Badges show a number only when you are directly mentioned; all other unread activity shows a plain dot.';
|
||||
if (!showDMs && !showRooms && !showPings) {
|
||||
return 'Badges show a plain dot for all unread activity—no numbers displayed.';
|
||||
}
|
||||
if (showUnreadCounts && badgeCountDMsOnly) {
|
||||
return 'Only Direct Message badges show a number count. Rooms and spaces show a plain dot instead.';
|
||||
}
|
||||
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"
|
||||
>
|
||||
<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} />
|
||||
}
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
|
||||
@@ -160,7 +160,7 @@ const defaultSettings: Settings = {
|
||||
hideMembershipInReadOnly: true,
|
||||
useRightBubbles: false,
|
||||
showUnreadCounts: false,
|
||||
badgeCountDMsOnly: false,
|
||||
badgeCountDMsOnly: true,
|
||||
showPingCounts: true,
|
||||
hideReads: false,
|
||||
emojiSuggestThreshold: 2,
|
||||
|
||||
Reference in new issue
Block a user