opfab / operatorfabric-core

Main operatorfabric program
https://opfab.github.io
Mozilla Public License 2.0
39 stars 27 forks source link

Add the ability to receive desktop notifications #6783

Open eeeple opened 3 months ago

eeeple commented 3 months ago

Operators might not have opfab open as a standalone tab/app all the time but might need to be alerted when new cards arrive.

One possibility to alert the user is to ring a chime, or to show a desktop notification [0].

[0] : https://developer.mozilla.org/en-US/docs/Web/API/Notification

freddidierRTE commented 2 months ago

The idea is that for real-time operations, the application should always be open for the operator. This aligns with how it's currently used in certain production contexts.

Ensuring the application remains open for specific entities is possible by configuring the supervisor to check its status. (See documentation: https://opfab.github.io/documentation/current/reference_doc/#_supervisor)

The application already supports alerts via sound or desktop notifications, which can be configured through the settings menu. However, this also necessitates that the application is open on the user's desktop.

Desktop notifications are implemented using the Web Notification API, as you mentioned.