stretchly
stretchly copied to clipboard
Scheduling of breaks - improved approach
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)
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.
there is no pause as you describe currently, everything is reset.
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.
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.
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.
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.
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.
@hovancik : This ticket has been "pinned" (featured for all ITS users) for several months. Is this intentional?
Yes. So that people don't create duplicates.
OK, but duplicates of what? It's unclear which issue this reports.
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?
appExclusions also let me reset the timer. I'd prefer it if the timer resumes from the previous state. Thanks!