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

Show the number of unread notifications above the bell on the right #2336

Merged
merged 2 commits into from
Dec 13, 2018

Commits on Dec 6, 2018

  1. Show the number of unread notifications above the bell on the right

    Fixes element-hq/element-web#3383
    
    This achieves the result by counting up the number of highlights across all rooms and setting that as the badge above the icon. If there are no highlights, nothing is displayed. The red highlight on the bell is done by abusing how the Tinter works: because it has access to the properties of the SVG that we'd need to override it, we give it a collection of colors it should use instead of the theme/tint it is trying to apply. This results in the Tinter using our warning color instead of whatever it was going to apply.
    
    The RightPanel now listens for events to update the count too, otherwise when the user receives a ping they'd have to switch rooms to see the change.
    turt2live committed Dec 6, 2018
    Configuration menu
    Copy the full SHA
    173669b View commit details
    Browse the repository at this point in the history

Commits on Dec 7, 2018

  1. Fix tinting of notification icon and use a more reliable notification…

    … source
    
    The js-sdk's placement of the notification change was unreliable and could cause stuck notifications. The new location (piggybacking the Notifier) is a lot more reliable.
    
    The tinting has been changed fairly invasively in order to support the changing of the `fill` attribute. What was happening before was the `fill` property would happily get set to the forced color value, but when it came time to reset it it wouldn't be part of the colors array and fail the check, therefore never being changed back. By using a second field we can ensure we are checking the not-forced value where possible, falling back to the potentially forced value if needed. 
    
    In addition to fixing which color the Tinter was checking against, something noticed during development is that `this.colors` might not always be a set of hex color codes. This is problematic when the attribute we're looking to replace is a rgb color code but we're only looking at `keyHex` - the value won't be reset. It appears as though this happens when people use custom tinting in places as `this.colors` often gets set to the rgb values throughout the file. To fix it, we just check against `keyHex` and `keyRgb`.
    turt2live committed Dec 7, 2018
    Configuration menu
    Copy the full SHA
    95d15b7 View commit details
    Browse the repository at this point in the history