-
Notifications
You must be signed in to change notification settings - Fork 243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create User Notification System #1695
Comments
The NotificationManager (storing all notifications and managing their status) should ideally be separated from the Notification-UI-Manager (which display the notifications, e.g. Notifications_API (docs), flask -flash, Javascript Notifications). This separation would allow fall-back Notification-UI-manager if the default is not available, or even user-defined preferences. The specter internal notification data structure could include include also fields like (icon, image, ...). We could stick close to the datastructure: https://notifications.spec.whatwg.org/#api This NotificationManager and Notification-UI-Manager would be a great building block for: #778 which shows proof-of-concept Notifications_API and Javascript Notifications |
Good points. However, i'm not sure we should implement the full blown API-Spec. Let's start small here but try to stick to the conventions in the Spec as much as possible. |
I started working on this: https://github.com/relativisticelectron/specter-desktop/tree/20220616_notification_system I included several UINotifications, such as LoggingNotifications, JSLoggingNotifications, FlaskNotifications, JSNotifications.
Call Graph: Here is shown how the fallback mechanism works:
@k9ert What do you mean by the GenericManager? |
At some point i refactored all persisting functionality into the persistence-module and AFAIK all persisting functionality (should) use that (otherwise the Some managers also have their dedicated single json-file and it's worth sharing that functionality in the
So currently have two of them using that:
|
For different reasons, it might be usefull to notify users of events which are asnc, e.g.:
To implement this, we should create a Notificationsmanager which derives from the GenericManager so that it can persist notifications on disk. So field could be something like:
The NotificationManager should then have methods like:
From a UI/UX perspective, we should implement this is stages. The easiest stage would be to check the NotificationManager with each and every request from the browser whether new notifications are there and immediately flash them (and delete them).
This could be done via @app.before_request (see
controller.py
).In a second stage, we could let the browser poll via API.
In further stages, we could create a UI for managing notification to read older ones and delete them finally.
The text was updated successfully, but these errors were encountered: