I ended up coding quite some more than I originally intended. Now, I think it is sufficiently finished.
I have split the whole thing into palatable PRs so that the code can be reviewed easily (or at least easier-ly).
Two first PRs:
https://github.com/FreeCAD/FreeCAD/pull/8350
https://github.com/FreeCAD/FreeCAD/pull/8352
When those are merged, there will still be some 4 or so:
- NotificationArea itself
- The Preferences page controlling all the parameters (preferences) of Notification area
- Intrusive/non-intrusive notification framework (fancy name for a tiny PR with some functions so that WBs can provide intrusive and non-intrusive dialogs based on the preferences of the notification area).
- Sketcher 1: Non-intrusive notifications used in the Sketcher WB for constraints and some relevant solver messages.
In pictures:
1- Non-intrusive notifications next to the "Notification Area":
- Screenshot_20230205_005240.png (60 KiB) Viewed 1268 times
2- Notification area messages (widget with received notifications):
- Screenshot_20230205_005325.png (56.61 KiB) Viewed 1268 times
3- Preferences to adapt it to the taste of users:
- Screenshot_20230205_005157.png (71.07 KiB) Viewed 1268 times
3.1 - Yes, the notification area can be completely disabled if the user wants to. Just as before.
3.2 - Yes, the non-intrusive notifications can be disabled altogether if a user does not want to be bothered, but still wants to have a quick access to notifications. Unread notification counter shows the unread notifications in the widget. New notifications appear in bold within the widget.
3.3 - Yes, the user can regulate the maximum time notifications will stay on the screen. Although notifications disappear before that time (and after the minimum duration) if the user continues working and presses a mouse button anywhere in the screen.
3.4 - Yes, the user can regulate a minimum time notifications will stay on the screen. During this time a notification will only disappear is popped out (clicked inside it). This ensures notification is not dismissed directly before the user having a chance of seeing it due to continue working and clicking.
3.5 - Yes, there is a limit on the number of notifications simultaneously being shown (otherwise the whole screen could be filled in and that would not be much non-intrusive anymore). The amount can be changed to adapt to the screen size.
3.6 - Yes, a limit can be set to the amount of messages stored in the widget. Older messages get discarded.
3.7 - Yes, user notifications (messages to the user about how to use the tools, "the edge already has a horizontal constraint") are not much relevant after the fact. If the "auto-remove" function is checked, after the "Maximum Duration" for notifications lapses, the notification disappears from the message list (from the widget). If you want to track how many times you used a tool incorrectly, you may leave it unchecked.
FAQ:
Q1. But I wanted the intrusive dialogs, are they gone?
A1. No, it depends on how the workbenches will adopt the non-intrusive notifications (those WB which decide to adopt them). The "Intrusive/non-intrusive notification framework" will provide a way to conveniently adopt the facility while allowing intrusive dialogs depending on the preferences (if the non-intrusive notifications are disabled). The Sketcher will use this framework. Those who want the blocking versions (for example for training purposes), they will be there for you.
Q2. I have a macro that produces 50 notifications in one second, what happens with the limit to the number of notifications in preferences?
A2. The first 15 (or other configured number in preferences) will appear as non-emergent on-screen, an indication appears that more notifications were received and that could not be shown. They are available for inspection in the widget.
Of course, I am sure that users will come with more questions, observations or ideas...