diff --git a/.changeset/fix-page-title-mention-count.md b/.changeset/fix-page-title-mention-count.md new file mode 100644 index 0000000000..1dffb5b20f --- /dev/null +++ b/.changeset/fix-page-title-mention-count.md @@ -0,0 +1,5 @@ +--- +default: patch +--- + +Changed the web page title to show the mention count instead of the total unread message count. diff --git a/src/app/pages/client/ClientNonUIFeatures.tsx b/src/app/pages/client/ClientNonUIFeatures.tsx index b39ec15123..8bed823bad 100644 --- a/src/app/pages/client/ClientNonUIFeatures.tsx +++ b/src/app/pages/client/ClientNonUIFeatures.tsx @@ -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; }