Skip to content

Commit 6fc50a3

Browse files
committed
fix: show mention count instead of total unread in page title
1 parent 62195fc commit 6fc50a3

2 files changed

Lines changed: 11 additions & 6 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
default: patch
3+
---
4+
5+
Changed the web page title to show the mention count instead of the total unread message count.

src/app/pages/client/ClientNonUIFeatures.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -140,16 +140,16 @@ function getUnreadTotals(roomToUnread: RoomToUnread) {
140140
return { total, highlightTotal, notification, highlight };
141141
}
142142

143-
// Updates document.title with an unread count.
143+
// Updates document.title with the mention (highlight) count. Total unread
144+
// is too noisy for a tab title; the OS app badge already uses the same
145+
// highlightTotal value for consistency.
144146
function PageTitleUpdater() {
145147
const roomToUnread = useAtomValue(roomToUnreadAtom);
146-
const [faviconForMentionsOnly] = useSetting(settingsAtom, 'faviconForMentionsOnly');
147148

148149
useEffect(() => {
149-
const { total, highlightTotal } = getUnreadTotals(roomToUnread);
150-
const count = faviconForMentionsOnly ? highlightTotal : total;
151-
document.title = count > 0 ? `(${count}) Sable Client` : 'Sable Client';
152-
}, [roomToUnread, faviconForMentionsOnly]);
150+
const { highlightTotal } = getUnreadTotals(roomToUnread);
151+
document.title = highlightTotal > 0 ? `(${highlightTotal}) Sable Client` : 'Sable Client';
152+
}, [roomToUnread]);
153153

154154
return null;
155155
}

0 commit comments

Comments
 (0)