Super-productivity: Discussion: Notification handling

Created on 18 Oct 2020  Â·  5Comments  Â·  Source: johannesjo/super-productivity

Problem Discussion Statement

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.

:grey_question: Possible Solution

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:

  1. Should it be possible to enable/disable Notification Handling in the settings? (I don't know if it is good to have too many settings)
  2. Should the notification handling coupled with the "Minimize to tray" option? I think it would also be a great feature independant from the Minimize setting.
  3. Which Icon file should be used in the notifications? Is icon-192x192.png from the assets folder the right one?
  4. I'd add a new service for the notification handling. In which subfolder should the files be located?

:arrow_heading_up: Describe alternatives you've considered

None :)

:heavy_plus_sign: Additional context

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.

enhancement

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.

All 5 comments

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:

  • super productivity is minimized to tray (maybe because it is automatically started on boot/login)
  • after the specified time sp checks that currently no task is tracked
  • a notification "You have not been tracking time for {{time}}" pops up

    • I would let the OS take care of the notification time

  • if the user clicks on the notification sp is restored from tray and shows the default timetracking-reminder dialog (add to task, dismiss)
  • if the user clicks on "dismiss" in the sp window, the notification is closed

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

IT-Tool picture IT-Tool  Â·  3Comments

alexanderadam picture alexanderadam  Â·  3Comments

Kl4tch picture Kl4tch  Â·  3Comments

wimel picture wimel  Â·  3Comments

NPReport picture NPReport  Â·  3Comments