vladimiry / ElectronMail

Unofficial ProtonMail Desktop App
GNU General Public License v3.0
1.5k stars 97 forks source link

Linux - Close notification/update notification when opening mail #486

Closed ErikReider closed 2 years ago

ErikReider commented 2 years ago

Atm the notification stays open until manually closed. Due to the notifications only specifying the unread count, the notification should update the count and remove itself when there are none left.

vladimiry commented 2 years ago

Atm the notification stays open until manually closed.

How long the notification stays open is specified by your system (locate the respective settings).

Due to the notifications only specifying the unread count

It also shows the account index or email adders (if you have specified the "alias" value for the account, see v4.12.8 notes for details).

the notification should update the count and remove itself when there are none left.

Updating already displayed notification is not supported by @electron, see https://www.electronjs.org/docs/latest/api/notification. So the issue like this needs to be raised upstream in https://github.com/electron/electron/issues.

ErikReider commented 2 years ago

How long the notification stays open is specified by your system (locate the respective settings).

I'm referring to the notification center, not the popup notification. It stays there until dismissed unlike Discord and Mailspring which dismisses its notifications when read.

Updating already displayed notification is not supported by @electron, see https://www.electronjs.org/docs/latest/api/notification. So the issue like this needs to be raised upstream in https://github.com/electron/electron/issues.

What discord does is that it replaces the notification with a new one when I receive a new DM.

vladimiry commented 2 years ago

notification center

What is the notification center (a screenshot would be helpful)?

ErikReider commented 2 years ago

It displays past notifications that haven't been dismissed yet.

The one in Gnome: image

The one in Windows 10: image

Or the one that I use: image

vladimiry commented 2 years ago

The app uses the HTML 5 Notification API not the https://www.electronjs.org/docs/latest/api/notification as I originally specified. So the app likely can use https://developer.mozilla.org/en-US/docs/Web/API/Notification/tag and https://developer.mozilla.org/en-US/docs/Web/API/Notification/close to fulfill the need. Besides that, a required change is to merge individual notifications per account into a single one.

vladimiry commented 2 years ago

Besides that, a required change is to merge individual notifications per account into a single one.

Currently when the per-account notification gets clicked the respective account gets activated. So I tend to keep the per-account notifications logic.