Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Add/improve badge counts in new room list #4734

Merged
merged 6 commits into from
Jun 9, 2020

Conversation

turt2live
Copy link
Member

@turt2live turt2live commented Jun 8, 2020

Based on #4732
Based on #4711 Merged
See pull/4732/head...pull/4734/head for the real diff
For element-hq/element-web#13635

This introduces a new component, NotificationBadge, which takes care of all the counting we don't need to do in different places. The same component file has some helper classes to monitor different states of notification to update the notification badge.

The notification badge simply expects to receive a notification state that updates itself. The caller (in our case, the room tile or sublist) doesn't need to worry about much else - just making sure the notification state has the information it needs. In the case of the room tile, it instantiates it and forgets about it. The sublist instantiates the state and then whenever it updates it dumps the list of rooms into the state for processing.

The styles are a bit weird for the reasons described in the CSS. This also sneaks in an IDLE state for rooms in the room list (rooms without badges aka fully read).

image

@turt2live turt2live requested a review from a team June 8, 2020 19:53
Copy link
Collaborator

@jryans jryans left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall, thanks! 😄

@turt2live turt2live merged commit bed4766 into develop Jun 9, 2020
@turt2live turt2live deleted the travis/room-list/sublist-badges branch June 9, 2020 14:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants