-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
feat(fullScreenTrackingReminder): add fullscreen tracking reminder #4086
base: master
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello there onesvat! 👋
Thank you and congrats 🎉 for opening your first PR on this project! ✨ 💖
We will try to review it soon!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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) { |
Copilot is powered by AI, so mistakes are possible. Review output carefully before use.
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. :) |
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.