This repository was archived by the owner on Mar 10, 2026. It is now read-only.
fix(badges): accurate unread counts and dot badge for non-notifying rooms#118
Merged
fix(badges): accurate unread counts and dot badge for non-notifying rooms#118
Conversation
added 4 commits
March 4, 2026 10:54
…ndard The UnreadBadge supports a separate highlight count and total count, but all call sites were only passing the total. Update DirectTab, HomeTab, SpaceTabs, and Search to pass the highlight count when the badge is in highlight state, so @-mention counts are reflected accurately in the sidebar.
…fying rooms - Use highlight count on highlighted badge, total on standard (matching the fix applied to other sidebar call sites) - Add useRoomHasUnread hook that subscribes reactively to RoomEvent.Timeline and RoomEvent.Receipt to detect unread messages independently of push-rule notification counts - When a room has unread messages but no notification count entry (e.g. a mentions-only room with new regular messages), show a dot badge (count=0) rather than no badge at all, matching the behaviour of other Matrix clients - Also bold the room name and restore icon opacity for these rooms
When a DM room is also a child of a space, its unread counts were propagating upward into the space's aggregated badge, causing the space to show a badge even though the unread belonged to a direct message. In the roomToUnreadAtom write function, check mDirectAtom before calling getAllParents: if the room is a DM, use an empty parent set so its unread stays isolated to the direct tab and does not roll up into any space badge.
…main-timeline total getUnreadNotificationCount() aggregates both the room-level counter and all thread notification counters. The stale-clamping logic checked whether the latest main-timeline event was already read and, if so, set total = 0 — this inadvertently wiped out any thread reply counts that were included in the combined total. Fix by reading getRoomUnreadNotificationCount() (main-timeline only) to determine the stale portion, then subtracting only that from total rather than zeroing the whole value. Thread highlight and total counts are preserved.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Changes:
Type of change
Checklist: