stretchly icon indicating copy to clipboard operation
stretchly copied to clipboard

Scheduling of breaks - improved approach

Open hovancik opened this issue 2 years ago • 12 comments
trafficstars

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)

hovancik avatar Dec 20 '22 14:12 hovancik

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.

naught101 avatar Nov 06 '24 23:11 naught101

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

hovancik avatar Nov 07 '24 13:11 hovancik

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.

naught101 avatar Nov 09 '24 11:11 naught101

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.

hovancik avatar Nov 11 '24 10:11 hovancik

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.

naught101 avatar Nov 19 '24 22:11 naught101

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.

hovancik avatar Nov 25 '24 19:11 hovancik

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.

naught101 avatar Nov 28 '24 04:11 naught101

@hovancik : This ticket has been "pinned" (featured for all ITS users) for several months. Is this intentional?

Chealer avatar Feb 12 '25 23:02 Chealer

Yes. So that people don't create duplicates.

hovancik avatar Feb 28 '25 10:02 hovancik

OK, but duplicates of what? It's unclear which issue this reports.

Chealer avatar Feb 28 '25 15:02 Chealer

Another consideration that's probably not worth making a separate bug for:

Currently there is a "Monitor system idle time (breaks are paused if system is idle)." option. From the text, I'd guess that this means that if I take a 4 minute break 8 minutes into a 10 minute short-break cycle, then when I come back and interact with the computer, I'll get another break in 2 minutes. I'm fairly certain I've seen this behaviour (or else the pausing is not working properly.

An alternative behaviour that I'd appreciate would be:

  • If the computer is inactive for less than the length of a short break, ignore
  • If it's inactive for more than the length of a short break, then consider that break done, and reset the short-break cycle.
  • If it's inactive for more than the length of a long break, then treat that as a long break, and reset all breaks.

To me this seems like a good standard behaviour, but I guess others might prefer different behaviours, so perhaps as an option?

naught101 avatar Mar 03 '25 23:03 naught101

appExclusions also let me reset the timer. I'd prefer it if the timer resumes from the previous state. Thanks!

herrbrixter avatar Mar 05 '25 05:03 herrbrixter