I often leave the window while waiting for something to build, and that’s when I get distracted. Would be cool if leaving the window started a timer, and if I’m not back within five minutes it pops a notice on the screen.
I have Visual Studio play a sound when the build finishes/fails. May not help you if you’re not using Visual Studio, though. I’m not sure is this can be done with VS Code.
Eliminate all loading times from your workflow using incremental and background builds. The computer will constantly do work for you, but the computer is a work horse, not your baby. Get the fastest CPU you can afford, with silent cooling.
There are occasional scenarios where this doesn't work out. The data mapping tool we use (MapStruct) doesn't automatically rebuild with changes in IntelliJ which means I have to manually kick off a compile step any time I have changes in the mapper. Worse still, that compilation doesn't always register in the build as seen by the in-IDE JUnit runner so I sometimes have to run all the tests from maven instead of just the one I care about through the IDE. Fortunately, this isn't a big part of my workflow, but wait times aren't always avoidable.
I don't use VS Code, but I like that there's experimentation in this space -- every X minutes, do something to the UI to remind you to take a break.
I currently use Time Out on Mac and every X minutes it slowly greys out the entire screen. The hardest scenario is if I'm in "the zone" and super focused on fixing a bug, etc. and the notification pops up. I end up feeling antagonistic towards the break reminder.
<shameless plug> I created a browser extension called Remindoro[0] exactly for this purpose. Right now it is available for Chrome and Firefox. It is also open source[1]
Edit: But I really like the idea of this VS Code extension and will definitely try out. As I type this, I just got lost in editor for like 2 hours and a VS Code extension like this would have helped.
So idea is to let you continue for some time and not be intrusive and not change anything (OK, anything important at all). Suggestions like chaning fonts or graying the screen are just not that.
Besides color, what else could be done ? Here is some brainstorming from me:
1. THe more you work, the slower are keys rendered, just as when computer slows down. This allows for some continuation but eventually you will stop to let computer (and yourself) rest.
2. The more your work, the more random, very short, beep sound is inserted on key presses. The same benefits as above unless you turn off the volume in which case the good old BIOS beep could do. This may deconcentrate a bit tho.
3. The more you type the more mouse starts moving on its own. Eventually it just flies around like crazy (until you use it, then when you don't it starts again). Yes you can still continue working like nothing happens.
4. The windows border colors start changing, the more you work, the more frequent it gets. It can be less distracting then mouse flying around.
All of above wont change a thing in your workflow which is important here as you want to allow some continuation and you don't actually want to change anything for user (screen size, font size, brightness changes, etc. are all intrusive and can change word ordering, syntax coloring etc. something you may depend a lot upon ( I do ).
Of course it's intrusive, as are your suggestions, as the whole concept is literally to intrude so you take a break. If you just want a suggestion to take a break try timed notifications.
To me the most intrusive thing is to change things in my environment. Font size for example will change how lines wrap and scroll position. The color will mess with syntax highlighting. Etc.
Something not intrusive will not change my editor but something not important for that type of work. It doesn't mean its not distracting, it should be for this kind of thing.
Mouse movements are defenitelly intrusive in classic IDE, I don't use mouse in vscode.
It is an interesting idea, but I am not sure that a VS code extension is a complete solution - When I code, it is rarely typing in the IDE for 25 straight minutes. It is thinking, taking notes, drawing, testing in the browser, looking at dev tools... and then a few minutes of typing once I have figured out what I want to do.
I also question the wisdom of breaks at specific intervals. Do I really want to get knocked out of flow because a timer expired? I take my breaks when I complete a task. Sometimes that is after 10 minutes, sometimes it is after 2 hours.
If I were in your position, I'd look for a different metric than just time. Maybe measure the rate of activity across all running apps, and provide a notice of, "Your typing speed has dropped, and you are taking more time between mouse movements - if you are slowing down, maybe it is time for a break?"
I like the idea a lot! It seems like people are concerned about this interrupting their flow, maybe add a command that allows user to reset the timer? so that they can keep their flow, but are reminded that they need to take a break.
So, this still allows your valuable zoned-in session to continue and also reminds you that it is time for a break. Taking breaks increases your productivity, in overall, across time. Mainly because you save yourself from the huge dips of exhaustion caused by pushing your organism over its limit. Your body will strike back, believe me.
That is an interesting approach and you might actually be an outlier. However, in a generic context, the idea is that someone needs to take breaks to minimize the risk of exhaustion and other medical problems and it does make a difference in someone's overall productivity when they do not push themselves too much. So, to answer your original question "why would someone want to interrupt their workflow" the answer is: In general, even if someone loses a few of their valuable zoned-in epiphanies, they gain an overall well-being and retain their health, which makes them be productive all year-round.
I feel like for me, this would end up just making me gradually strain my eyes without noticing. I'd prefer it to try doing a gradual change that didn't make it harder to see - maybe increase the font size until I'm working in a 20character wide screen or something, which would be annoying but not bad for me?