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

Scheduling of breaks - improved approach #1248

Open
hovancik opened this issue Dec 20, 2022 · 7 comments
Open

Scheduling of breaks - improved approach #1248

hovancik opened this issue Dec 20, 2022 · 7 comments

Comments

@hovancik
Copy link
Owner

hovancik commented Dec 20, 2022

this comment will be updated with the latest thinking

Stretchly should update timers right away, when preferences are updated.

  • so that we do not get Mini Break after they are disabled

There should be option to remember current times passed when Stretchly is being paused/dnd/idle/sleep.

  • so that after resume we continue with state right before pause (breaks are not reset)
@naught101
Copy link

I think there maybe need to be more options for the suspend/lock situation:

  • ignore (continue with the original break schedule)
  • pause (if you were 10 mins into a 15 min break cycle, then the next break will be 5 mins after unlock)
  • reset (this is the one I would much prefer - I only sleep/lock if I walk away from the computer for more than a few minutes, so I really don't need a break to start 2 minutes after I resume work).

I see the option at https://github.com/hovancik/stretchly#pause-breaks-on-suspendlock-, but it doesn't seem to include a reset option.

@hovancik
Copy link
Owner Author

hovancik commented Nov 7, 2024

there is no pause as you describe currently, everything is reset.

@naught101
Copy link

Hrm. I guess there is a bug then? Because I have my minor breaks set to 15 mins and my major breaks set to 45mins, and I OFTEN see a minor break within a minute or two of opening my macbook lid after shutting it for a few minutes.

@hovancik
Copy link
Owner Author

Each OS works differently with closing lids, also this preference might change behavior https://github.com/hovancik/stretchly?tab=readme-ov-file#pause-breaks-on-suspendlock- . To be sure, check logs which should tell you what happens.

@naught101
Copy link

OK, here is a weird example from the logs:

[2024-11-19 18:46:40.669] [info]  System: suspend or lock
[2024-11-19 18:46:40.672] [info]  Stretchly: not pausing for suspendOrLock because paused already
[2024-11-19 18:46:40.863] [info]  System: suspend or lock
[2024-11-19 18:46:40.864] [info]  Stretchly: not pausing for suspendOrLock because paused already
[2024-11-20 00:34:07.234] [info]  Stretchly: resuming breaks
[2024-11-20 02:02:53.225] [info]  Stretchly: showing Mini Break notification
[2024-11-20 02:20:09.997] [info]  Stretchly: ready-to-show fired
[2024-11-20 02:20:10.002] [info]  Stretchly: Mini Break window loaded
[2024-11-20 02:20:10.005] [info]  Stretchly: showing window 1 of 1
[2024-11-20 02:20:10.005] [info]  Stretchly: starting Mini Break
[2024-11-20 02:40:32.498] [info]  Stretchly: finishing Mini Break (shouldPlanNext: true)
[2024-11-20 04:08:51.501] [info]  Stretchly: showing Mini Break notification
[2024-11-20 05:24:02.062] [info]  Stretchly: ready-to-show fired
[2024-11-20 05:24:02.070] [info]  Stretchly: Mini Break window loaded
[2024-11-20 05:24:02.072] [info]  Stretchly: showing window 1 of 1
[2024-11-20 05:24:02.072] [info]  Stretchly: starting Mini Break
[2024-11-20 05:24:22.138] [info]  Stretchly: finishing Mini Break (shouldPlanNext: true)
[2024-11-20 06:37:32.188] [info]  Stretchly: showing Long Break notification
[2024-11-20 08:05:46.843] [info]  Stretchly: ready-to-show fired
[2024-11-20 08:05:46.852] [info]  Stretchly: Long Break window loaded
[2024-11-20 08:05:46.854] [info]  Stretchly: showing window 1 of 1
[2024-11-20 08:05:46.854] [info]  Stretchly: starting Long Break
[2024-11-20 08:22:09.177] [info]  Stretchly: finishing Long Break (shouldPlanNext: true)
[2024-11-20 08:38:31.887] [info]  Stretchly: showing Mini Break notification
[2024-11-20 09:04:44.381] [info]  System: resume or unlock
[2024-11-20 09:04:44.751] [info]  Stretchly: ready-to-show fired
[2024-11-20 09:04:44.759] [info]  Stretchly: Mini Break window loaded
[2024-11-20 09:04:44.760] [info]  Stretchly: showing window 1 of 1
[2024-11-20 09:04:44.760] [info]  Stretchly: starting Mini Break
[2024-11-20 09:04:49.452] [info]  System: resume or unlock
[2024-11-20 09:05:04.776] [info]  Stretchly: finishing Mini Break (shouldPlanNext: true)
  • I shut the laptop lid at 6:45pm last night
  • I didn't open it again until 9:04 this morning
  • Immediately when I unlocked it, I was shown a (partially complete) mini break screen.

I don't understand how all those events are happening in between. I didn't touch the laptop at any of those times. I guess suspend on a macbook works differently to how I expected.

@hovancik
Copy link
Owner Author

It seems that when you were locking your laptop, Stretchly was paused already, this it did not pause for lock: Stretchly: not pausing for suspendOrLock because paused already. At 00:34:07 breaks we resumed.

@naught101
Copy link

OK, that makes some sense. It still seems like a bug, since obviously there is no benefit in resuming breaks while the laptop is asleep. Would make sense to prevent the resume until the laptop wakes.

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

No branches or pull requests

2 participants