From 6fc50a375515bdde9e1ddf4401b17811298d565c Mon Sep 17 00:00:00 2001 From: Erwan Leboucher Date: Thu, 23 Jul 2026 13:29:27 +0200 Subject: [PATCH] fix: show mention count instead of total unread in page title --- .changeset/fix-page-title-mention-count.md | 5 +++++ src/app/pages/client/ClientNonUIFeatures.tsx | 12 ++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) create mode 100644 .changeset/fix-page-title-mention-count.md 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; }