feat(fullScreenTrackingReminder): add fullscreen tracking reminder#4086
feat(fullScreenTrackingReminder): add fullscreen tracking reminder#4086onesvat wants to merge 1 commit intosuper-productivity:masterfrom
Conversation
…dow and trigger and focus main window when no tracking for minutes defined (same as reminder tracking banner)
There was a problem hiding this comment.
PR Overview
This PR adds a fullscreen tracking reminder feature that forces the application’s main window into fullscreen mode when time tracking is inactive, helping users stay focused. Key changes include:
- Adding new properties and event listeners in the tracking reminder service to track window focus and fullscreen status.
- Introducing a new IPC event and preload API in Electron to control fullscreen behavior.
- Updating configuration files and translation constants to support the new fullscreen tracking reminder option.
Reviewed Changes
| File | Description |
|---|---|
| src/app/features/tracking-reminder/tracking-reminder.service.ts | Added properties, event listeners, and logic to trigger and restore fullscreen mode based on the config |
| electron/ipc-handler.ts | Added an IPC listener to update the fullscreen state of the main window |
| electron/preload.ts | Exposed a new API function to send fullscreen commands to the main process |
| src/app/features/config/default-global-config.const.ts | Updated default global configuration to include the new fullscreen reminder flag |
| src/app/features/config/form-cfgs/time-tracking-form.const.ts | Updated form configuration to support toggling the new fullscreen reminder option |
| src/app/features/config/global-config.model.ts | Extended the TimeTrackingConfig model with the fullscreen reminder property |
| src/app/features/config/migrate-global-config.util.ts | Updated migration to set the new fullscreen reminder property |
| electron/shared-with-frontend/ipc-events.const.ts | Added a new IPC event constant for setting fullscreen |
| src/app/t.const.ts | Added a new translation key for the fullscreen tracking reminder option |
Copilot reviewed 31 out of 31 changed files in this pull request and generated 1 comment.
| this._cfg$.pipe(take(1)).subscribe((cfg) => { | ||
| if (IS_ELECTRON && this._isFullscreenActive && cfg.isFullScreenTrackingReminder) { |
There was a problem hiding this comment.
In the _restoreWindowState method, relying on cfg.isFullScreenTrackingReminder to restore the window state may prevent the fullscreen mode from being turned off if the configuration is later disabled. Consider removing or revising the config check to ensure the window always exits fullscreen when _isFullscreenActive is true.
| this._cfg$.pipe(take(1)).subscribe((cfg) => { | |
| if (IS_ELECTRON && this._isFullscreenActive && cfg.isFullScreenTrackingReminder) { | |
| this._cfg$.pipe(take(1)).subscribe(() => { | |
| if (IS_ELECTRON && this._isFullscreenActive) { |
|
Thank you very much! I will test and review this and get back to you. As a general remark: Since it is a new feature with a lot of changes usually it is better to discuss this in advance to avoid unnecessary work and changes. :) |
|
I've tested this on Ubuntu with gnome and I am not able to leave the full screen mode in a couple, when I reload the app and also when I dismiss the banner. I am also find it a bit drastic. The time tracking reminder is not meant to be a focus tool, but rather just a friendly reminder when the other is working already, but forgot to track. Imho it's more important that the user is working, than that he is tracking (he can also add the time after working). Can you maybe elaborate why this is useful to you? As an alternative: Would maybe reducing this to just flashing and focusing the window enough? |
|
Thank you for your feedback! You’re absolutely right—I should have opened an issue to discuss this beforehand. However, I thought implementing it first might better illustrate the idea in practice. Initially, my goal was to ensure I stayed focused on planned tasks rather than getting distracted, but I now realize the fullscreen approach is too drastic and intrusive. I completely agree that a less aggressive solution—such as a notification and flashing the window, similar to the break reminder—would be more appropriate. The new approach works as follows: When the configured time to wait before showing the tracking reminder banner is reached, a notification with sound will be triggered, similar to the break reminder. Then, every X minutes (which we should probably make configurable in the settings), the notification will sound again and the window will flash to ensure visibility. Would you suggest making this behavior optional via a checkbox in the settings, or should it always be enabled by default? If that sounds good to you, I’m happy to discard this PR and submit a new one with the necessary adjustments. Let me know what you think! |
|
I’ve created a new PR (#4168) with a less intrusive approach. |
feat(fullScreenTrackingReminder): add fullscreen control for main window and trigger and focus main window when no tracking for minutes defined (same as reminder tracking banner)
Description
This PR introduces a feature designed to help maintain focus by automatically switching the main window to fullscreen mode when time tracking is inactive and a predefined duration has elapsed. This behavior mimics the reminder tracking banner and is intended to prevent distractions—such as browsing social media—when no task is being actively tracked.
When the fullscreen reminder is active (as enabled in the settings with a specified duration), the application forces focus to prompt the user to select a task and start tracking. Once a task is selected and tracking begins, the application reverts to its normal state. Users also have the option to dismiss the reminder if they prefer.
Note: This feature is only available on the desktop version. It has been tested on macOS but follows the same code structure as the fullscreen break reminder, so it should work on other platforms as well.