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/fix-page-title-mention-count.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
default: patch
---

Changed the web page title to show the mention count instead of the total unread message count.
12 changes: 6 additions & 6 deletions src/app/pages/client/ClientNonUIFeatures.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,16 +140,16 @@ function getUnreadTotals(roomToUnread: RoomToUnread) {
return { total, highlightTotal, notification, highlight };
}

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

useEffect(() => {
const { total, highlightTotal } = getUnreadTotals(roomToUnread);
const count = faviconForMentionsOnly ? highlightTotal : total;
document.title = count > 0 ? `(${count}) Sable Client` : 'Sable Client';
}, [roomToUnread, faviconForMentionsOnly]);
const { highlightTotal } = getUnreadTotals(roomToUnread);
document.title = highlightTotal > 0 ? `(${highlightTotal}) Sable Client` : 'Sable Client';
}, [roomToUnread]);

return null;
}
Expand Down
Loading