Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

onesvat
Copy link

@onesvat onesvat commented Mar 6, 2025

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.

…dow and trigger and focus main window when no tracking for minutes defined (same as reminder tracking banner)
Copy link

@github-actions github-actions bot left a 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!

@johannesjo johannesjo requested a review from Copilot March 7, 2025 13:50
Copy link

@Copilot Copilot AI left a 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.

Comment on lines +202 to +203
this._cfg$.pipe(take(1)).subscribe((cfg) => {
if (IS_ELECTRON && this._isFullscreenActive && cfg.isFullScreenTrackingReminder) {
Copy link
Preview

Copilot AI Mar 7, 2025

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.

Suggested change
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.

Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
@johannesjo
Copy link
Owner

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. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants