Skip to content

Comments

feat(fullScreenTrackingReminder): add fullscreen tracking reminder#4086

Closed
onesvat wants to merge 1 commit intosuper-productivity:masterfrom
onesvat:feat/fullScreenTrackingReminder
Closed

feat(fullScreenTrackingReminder): add fullscreen tracking reminder#4086
onesvat wants to merge 1 commit intosuper-productivity:masterfrom
onesvat:feat/fullScreenTrackingReminder

Conversation

@onesvat
Copy link
Contributor

@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
Contributor

@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
Contributor

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

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 uses AI. Check for mistakes.
@johannesjo
Copy link
Collaborator

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

@johannesjo
Copy link
Collaborator

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?

@onesvat
Copy link
Contributor Author

onesvat commented Mar 13, 2025

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!

@onesvat
Copy link
Contributor Author

onesvat commented Mar 24, 2025

I’ve created a new PR (#4168) with a less intrusive approach.

@onesvat onesvat closed this Mar 24, 2025
@onesvat onesvat deleted the feat/fullScreenTrackingReminder branch March 24, 2025 08:39
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