With the PR #587 comes the possibility to minimize the super productivity window to the tray. If the window is in the tray icon the main window won't be focused for the events "idle notification" and "rememver time tracking" and users won't be reminded that they where idle or forgot to track a task.
Since its hacktober I want to implement notification for those events using the electron notification API.
(I already have a prototype for the timetracking-reminder working here)
Now I have some questions about the behavior of the application:
icon-192x192.png from the assets folder the right one?None :)
Since I only have Linux environments for testing, I can only test the Electron/Browser version on Linux. Mac and Windows users should test it on there environments before merging it into a release.
Thanks for opening this up and offering help too! That's great!
Let me start by saying that this is a tricky subject :) Notifications are handled differently by every OS which makes dealing with them a little tricky. At the same time, I'd like to keep the complexity manageable, so generally, I'd like to avoid too many different states and special handling for the different OSs (and there is also the Web Version to consider).
This being said, I am not against a little bit of special handling for the minimized to tray state, but we have to carefully select the cases for when this makes sense and there should be a good reason to favor showing a notification over showing the application window. I am not sure if I would want to replace the idle dialog with a notification, for example. A notification – depending on what OS and Desktop Environment you are using – may disappear quickly, while the fact that you have been idle and that time tracking is stopped and that you should act on that, should be visible right away when you return to the computer. With "remember time tracking" it's similar, as it requires user interaction too. Could you maybe describe a complete scenario on how notifications should work for those two? And also what other cases did you have in mind.
About 1: Let's focus on sensible default behavior. It's already kind of optional, with the optional minimize to tray and if people complain, we can always add an option.
About 3: assets/icons/icon-128x128.png is currently used, though I just recognized that it is not up to date anymore.
About 4: There already is a notify.service in src/app/core/notify which is responsible for sending notifications. Triggering them might be best handled over a new effect-class (though this depends a bit on what cases we want to handle). For an example you can check: src/app/features/tasks/store/task-ui.effects.ts
Thanks for the quick reply. First I have to say I used toggle Desktop before super productivity and maybe this is why I'm used to the notifications an miss them :)
Could you maybe describe a complete scenario on how notifications should work for those two? And also what other cases did you have in mind.
There is not that much to describe, I'd do it like that for the time tracking reminder:
For the idle handling it is basically the same. One other thing I think would improve the tray functionality is dynamic tray icons based on the state tracking/not-tracking (which is also what toggle Desktop does), but this is a different topic.
For the web version: I think it is also possible to ask for permission and then use the same Notification API but I didn't check this till now.
There already is a notify.service in src/app/core/notify which is responsible for sending notifications. Triggering them might be best handled over a new effect-class (though this depends a bit on what cases we want to handle). For an example you can check: src/app/features/tasks/store/task-ui.effects.ts
OK I'll check that.
Alright :) You're probably much better suited to determine the ideal usability for the minimized to tray use case. For the tracking reminder, the described flow also makes sense to me. For the idle time dialog, I am currently convinced that it should move the application to the foreground, as to me it makes sense to interact with that right away after getting back to the computer after a break or a meeting or something similar. A notification probably will be missed. If you have good arguments for using notifications here as well or any other improvement suggestion, I am all ears!
I'll focus on the time tracking reminder then :)
Bringing the application to foreground to show the idle dialog sounds great and should be easy too, I think I can take a look on that as well.
That's great! Let me know if you need any info.
Most helpful comment
I'll focus on the time tracking reminder then :)
Bringing the application to foreground to show the idle dialog sounds great and should be easy too, I think I can take a look on that as well.