Merge pull request #161 from 7w1/unread-pings-toggle

add show unread ping counts toggle to optionally still show ping coun…
This commit is contained in:
7w1 authored and GitHub committed 2026-03-05 16:15:00 -06:00
commit 661ef460ae
5 files changed
+20 -12

No files matched your search

+5
View File
@@ -0,0 +1,5 @@
---
sable: patch
---
Added an additional toggle, Show Unread Ping Counts, to override the Show Unread Counts allowing for only pings to have counts.
@@ -20,8 +20,11 @@ export function UnreadBadgeCenter({ children }: { children: ReactNode }) {
}
export function UnreadBadge({ highlight, count }: UnreadBadgeProps) {
const [showCounts] = useSetting(settingsAtom, 'showUnreadCounts');
const showNumber = showCounts && count > 0;
const [showUnreadCounts] = useSetting(settingsAtom, 'showUnreadCounts');
const [showPingCounts] = useSetting(settingsAtom, 'showPingCounts');
const showNumber = count > 0 && (showUnreadCounts || (highlight && showPingCounts));
return (
<Badge
variant={highlight ? 'Success' : 'Secondary'}
@@ -173,7 +173,6 @@ function IdentityCosmetics() {
const [renderRoomFonts, setRenderRoomFonts] = useSetting(settingsAtom, 'renderRoomFonts');
const [uniformIcons, setUniformIcons] = useSetting(settingsAtom, 'uniformIcons');
const [rightBubbles, setRightBubbles] = useSetting(settingsAtom, 'useRightBubbles');
const [showUnreadCounts, setShowUnreadCounts] = useSetting(settingsAtom, 'showUnreadCounts');
return (
<Box direction="Column" gap="100">
@@ -237,15 +236,6 @@ function IdentityCosmetics() {
after={<Switch variant="Primary" value={rightBubbles} onChange={setRightBubbles} />}
/>
</SequenceCard>
<SequenceCard className={SequenceCardStyle} variant="SurfaceVariant" direction="Column">
<SettingTile
title="Show Unread Counts"
description="Display the number of unread messages on room and sidebar badges."
after={
<Switch variant="Primary" value={showUnreadCounts} onChange={setShowUnreadCounts} />
}
/>
</SequenceCard>
</Box>
);
}
@@ -328,6 +328,7 @@ function PageZoomInput() {
export function Appearance() {
const [twitterEmoji, setTwitterEmoji] = useSetting(settingsAtom, 'twitterEmoji');
const [showUnreadCounts, setShowUnreadCounts] = useSetting(settingsAtom, 'showUnreadCounts');
const [showPingCounts, setShowPingCounts] = useSetting(settingsAtom, 'showPingCounts');
return (
<Box direction="Column" gap="700">
@@ -356,6 +357,13 @@ export function Appearance() {
}
/>
</SequenceCard>
<SequenceCard className={SequenceCardStyle} variant="SurfaceVariant" direction="Column">
<SettingTile
title="Show Unread Ping Counts"
description="When enabled overrides Show Unread Counts to still display counts."
after={<Switch variant="Primary" value={showPingCounts} onChange={setShowPingCounts} />}
/>
</SequenceCard>
</Box>
</Box>
);
+2
View File
@@ -72,6 +72,7 @@ export interface Settings {
hideMembershipInReadOnly: boolean;
useRightBubbles: boolean;
showUnreadCounts: boolean;
showPingCounts: boolean;
}
const defaultSettings: Settings = {
@@ -128,6 +129,7 @@ const defaultSettings: Settings = {
hideMembershipInReadOnly: true,
useRightBubbles: false,
showUnreadCounts: true,
showPingCounts: true,
};
export const getSettings = () => {