element-hq / element-web

A glossy Matrix collaboration client for the web.
https://element.io
GNU Affero General Public License v3.0
11.13k stars 1.98k forks source link

Make use of icon overlay in taskbar button on Windows #13920

Closed assarbad closed 4 years ago

assarbad commented 4 years ago

I am requesting this feature on behalf of a colleague. The idea seems sound and currently does not seem to be implemented in Riot.


Is your suggestion related to a problem? Please describe.

The problem is that the TNA icon does not reliably show information about new unread messages and such. The taskbar button, which seems to be always available, could be a nice visual indication of unread messages (possibly in a way that lets the user deactivate the setting).

Describe the solution you'd like

It would be great if a similar feature to the one shown above for Microsoft Teams was available in Riot.

A cursory look at the master branch of Electron shows that this may already be available through Electron:

$ rg ITaskbarList3 .
./shell/browser/ui/win/taskbar_host.h
73:  Microsoft::WRL::ComPtr<ITaskbarList3> taskbar_;

The interface in question is ITaskbarList3 and the methods are ITaskbarList3::SetProgressState and ITaskbarList3::SetOverlayIcon. The former of which should allow you to set the yellow color of the taskbar button (perhaps TBPF_INDETERMINATE or TBPF_PAUSED was used in case of Teams?) and the latter of which should allow to set an overlay icon, like that white 1 on red background.

These seem to be implemented in taskbar_host.cc (and its corresponding header) as TaskbarHost::SetProgressBar and TaskbarHost::SetOverlayIcon.

Describe alternatives you've considered

The only alternatives I can see are:

So the taskbar button would be a nice place to give a visual indication of the unread message or messages.

Additional context

In Microsoft Teams the taskbar button shows as follows with unread messages.

Taskbar buttons

t3chguy commented 4 years ago

It is already implemented but by updating the underlying icon to be more cross-compatible.

image

It could be done using the Windows specific https://github.com/electron/electron/blob/master/docs/api/browser-window.md#winsetoverlayiconoverlay-description-windows electron API but that then means having to write a load of code for something which already works cross-platform.

assarbad commented 4 years ago

@t3chguy thanks a bunch for the swift response. So basically, if I understand you correctly, the feature is already there, as per your screenshot?

I don't observe this behavior on Windows 10. What gives? Is this some internal build or a non-release build? And if so, is it available to try out from somewhere? Going by the screenshot this is some nightly build? Or some private build? (We're using the most recent released version, i.e. latest available updates applied)

Btw: I wasn't suggesting to implement this in a platform-specific way. I was simply trying to point the developers to the information I knew and to the fact that Electron itself appears to have an idea about how to do it. Whether there is an abstraction that is less platform-specific is beyond me.

t3chguy commented 4 years ago

the feature is already there, as per your screenshot?

Yup and has been for over a year.

I don't observe this behavior on Windows 10. What gives?

What are your in-app notification settings like?

Is this some internal build or a non-release build? And if so, is it available to try out from somewhere?

As above, has been in the stable app for over a year, but yes this is a Nightly build available at https://packages.riot.im/nightly/install/win32/x64/


The counter on the icon is the aggregation of all the counts in your room list, like these: image

Are you seeing any of those?

image image

t3chguy commented 4 years ago

The way we do it is consistent with the webapp riot.im/app which generates the favicon. Our electron code takes this favicon and updates the window and tray icons with it. So you should try it on the webapp too to see if you observe it in your tab icons.

image

assarbad commented 4 years ago

I don't observe this behavior on Windows 10. What gives?

What are your in-app notification settings like?

All (account, session, show message, audible notifications) enabled. For the detailed settings it's split between On and Noisy.

As above, has been in the stable app for over a year, but yes this is a Nightly build available at https://packages.riot.im/nightly/install/win32/x64/

Wow, that's surprising as neither I nor my colleague gets to see this on Windows 10. I have multiple clients, but to my knowledge he hasn't.

The counter on the icon is the aggregation of all the counts in your room list, like these: image

This appears consistently. No problems there.

Are you seeing any of those?

image image

Nope, not reliably. I tested it and it's about 50:50 whether or not I get to see that overlay icon.

2020-06-04 15_09_21-

2020-06-04 15_04_28-

The [1] in the title appears consistently, though. The TNA icon behaves exactly like the one on the taskbar (i.e. both either show the overlay or they don't). I think the second screenshot goes to show that at the very least there's an issue with the overlay icon, because the title shows there are unread messages (which there were at the time) but no overlay icon is shown.

Similarly taskbar buttons on a secondary taskbar (multi-monitor setup), where they usually are shown without title (just icon) behave like the taskbar button on the primary taskbar.

So this appears to be some sort of Heisenbug.

t3chguy commented 4 years ago

Ah, so you're hitting the unreliability bug, that'll be fixed in 1.6.3 which is due today :D

I thought you were never seeing it!

https://github.com/vector-im/riot-web/pull/13649 is the PR which fixes it.

assarbad commented 4 years ago

@t3chguy awesome. Thanks. I'll let my colleague know. Actually two colleagues by now, because another one also saw it and was wondering when I brought up the topic.