hovancik / stretchly

The break time reminder app
https://hovancik.net/stretchly
BSD 2-Clause "Simplified" License
4.62k stars 444 forks source link

[Bug]: Entire screen displays "gray" before transparent chosen background color. #1367

Closed nathana212 closed 8 months ago

nathana212 commented 1 year ago

Version

Known issues

Existing issues

Advanced Preferences

What operating system are you using?

Windows

Operating System Version

12.2.1

Reproduction steps

  1. Start the application
  2. Wait for break
  3. First the entire screen goes to gray. (see screenshot)
  4. Then it goes to the chosen transparent color. (see screenshot)
Screen Shot 2023-08-04 at 12 19 41 PM Screen Shot 2023-08-04 at 2 27 42 PM

Expected Behavior

Display goes immediately to chosen transparent color, not gray.

Actual Behavior

Displays entire screen of gray for a split-second before going to correct color.

Relevant log output

No response

Preferences

microbreakDuration  60000
microbreakInterval  1200000
breakDuration   1200000
breakInterval   4
breakNotification   true
microbreakNotification  true
breakNotificationInterval   30000
microbreakNotificationInterval  10000
microbreak  true
break   true
microbreakStrictMode    false
breakStrictMode false
morningHour 6
microbreakPostpone  true
breakPostpone   true
microbreakPostponeTime  120000
breakPostponeTime   300000
microbreakPostponesLimit    2
microbreakPostponableDurationPercent    30
breakPostponesLimit 2
breakPostponableDurationPercent 30
mainColor   "#1D1F21"
miniBreakColor  "#1D1F21"
transparentMode true
opacity 0.4
audio   "crystal-glass"
miniBreakAudio  "crystal-glass"
volume  1
fullscreen  false
ideas   true
naturalBreaks   true
naturalBreaksInactivityResetTime    300000
allScreens  true
useIdeasFromSettings    false
language    "en"
notifyNewVersion    true
isFirstRun  false
posLatitude 0
posLongitude    0
useMonochromeTrayIcon   true
useMonochromeInvertedTrayIcon   false
silentNotifications true
monitorDnd  true
microbreakStartSoundPlaying false
breakStartSoundPlaying  false
themeSource "system"
endBreakShortcut    "CmdOrCtrl+X"
breakWindowWidth    0.99
breakWindowHeight   0.99
checkNewVersion false
breakIdeas  
0   
data    
0   "Not alone"
1   "Do you find it hard to take a break alone? Try to do it with a co-worker. Aside from making it easier to stick to breaks, you will have a chance to get to know them better. Taking breaks together increases productivity."
enabled true
1   
data    
0   "Step away"
1   "Do you ever notice how your brain can figure things out by itself? All it takes is to step away from the computer and take a break to think about something totally unrelated."
enabled true
2   
data    
0   "Microbreaks"
1   "Rest is a key component in ensuring the performance of the musculoskeletal system. Frequent breaks can decrease the duration of a task and help lower the exposure to ergonomic injury risk."
enabled true
3   
data    
0   "Meditation"
1   "Research studies suggest that mindfulness-based exercises help decrease anxiety, depression, stress, and pain, and help improve general health, mental health, and quality of life. Not sure how to start? There are numerous apps to help you out."
enabled true
4   
data    
0   "Blink"
1   "Looking at screens for a long time causes you to blink less, thus exposing your eyes to the air. Blink rapidly for a few seconds to refresh the tear film and clear dust from the eye surface."
enabled true
5   
data    
0   "Ergonomics"
1   "Improper height and angle of the keyboard, mouse, monitor or working surface can cause health problems. Take some time to read about desk ergonomics."
enabled true
6   
data    
0   "Move"
1   "There are a lot of ways you can exercise within your office. Try marching in place or doing desk push-ups."
enabled true
7   
data    
0   "Change"
1   "Do you have a stability ball or standing work desk? Consider replacing your desk chair with them for a while."
enabled true
8   
data    
0   "Notice"
1   "Are you daydreaming or having trouble focusing? It is a sign that you need to take a break."
enabled true
9   
data    
0   "Tech"
1   "How about taking a no-tech walk?"
enabled true
10  
data    
0   "Metabolism"
1   "Emerging research shows that sitting for long periods of time contributes to risk of metabolic syndrome, heart attack and stroke risk and overall death risk, among others. Taking regular walking breaks can help your circulation, working to counteract some of those problems."
enabled true
11  
data    
0   "Active Meetings"
1   "How about moving meetings from the conference room to the concourse? Walking not only burns calories but it may even foster a sense of collaboration."
enabled true
12  
data    
0   "Fruit"
1   "Take your time and eat some fruit. Slowly. Notice the flavor, the texture, the freshness."
enabled true
13  
data    
0   "Bathrooms"
1   "Walk to the farthest bathroom in the worksite facility when going to the restroom."
enabled true
14  
data    
0   "Coffee break"
1   "Going on coffee break? Consider doing a 5-minute walk every time you go for one."
enabled true
15  
data    
0   "Colleagues"
1   "Do not email or message office colleagues, walk to their desks to communicate with them."
enabled true
16  
data    
0   "Learning"
1   "In a study of healthy volunteers, NIH researchers found that taking short breaks, early and often, may help our brains learn new skills."
enabled true
17  
data    
0   "Exercise"
1   "Evidence suggests small amounts of regular exercise can bring dramatic health benefits, including measurably reducing stress."
enabled true
18  
data    
0   "Repeat"
1   "Have you found your stretch-ly-routine? Do not forget to repeat it for more than once to better fight effects of prolonged sitting."
enabled true
19  
data    
0   "Wrist and forearm"
1   "Extend your arms with the palms facing towards you, then slowly rotate the hands four times clockwise, then four times counter-clockwise."
enabled true
20  
data    
0   "Back stretching"
1   "Join your hands behind your head, then lift them together up above your head ending with your palms facing upward."
enabled true
21  
data    
0   "Mobilize"
1   "For every thirty minutes of stagnation, you should have at least one minute of stimulation."
enabled true
22  
data    
0   "7 Minute Workout"
1   "This workout packs in a full-body exercise routine in a fraction of the time. But as with any exercise, be careful. There are numerous apps to get you started."
enabled true
23  
data    
0   "Pulse"
1   " Raise your pulse rate to 120 beats per minute for 20 straight minutes four or five times a week doing anything you enjoy. Regularly raising your heart rate results in improved cardiovascular health."
enabled true
24  
data    
0   "Take the stairs "
1   "Studies have shown that stair climbing, which is considered vigorous-intensity physical activity, burns more calories per minute than jogging."
enabled true
25  
data    
0   "Make art"
1   "Art therapy is known to have great mental health benefits, especially when it comes to stress management. How about writing a quick poem, taking a picture or painting something small?"
enabled true
26  
data    
0   "Declutter"
1   "A clean space helps your focus at work and is often linked to positive emotions like happiness."
enabled true
27  
data    
0   "Lunch outside"
1   "Nature is linked to positive emotions and decreased stress and anxiety. Whenever possible, try to take your daily lunch break outside, surrounded by some greenery."
enabled true
28  
data    
0   "Public transport"
1   "If you use public transport regularly, you can stand instead of sitting. If it is possible, try to replace as many of your daily trips as possible with walking or cycling."
enabled true
29  
data    
0   "Yawning"
1   "Yawning can be really helpful, as it produces tears to help moisten and lubricate the eyes."
enabled true
30  
data    
0   "Focus change"
1   "Hold one finger close to the eye and focus on it. Slowly move the finger away, focus far into the distance and then back to the finger. Bring the finger back and focus on something far away."
enabled true
31  
data    
0   "Palming"
1   "While seated, brace elbows on the desk and close to the desk edge. Let your weight fall forward and cup hands over eyes. Close your eyes and inhale slowly through nose and hold for few seconds. Continue deep breathing."
enabled true
32  
data    
0   "Hand squeezes"
1   "Squeeze a pair of balled-up socks or a soft rubber ball, hold for 5 seconds. Repeat whole process few times."
enabled true
microbreakIdeas 
0   
data    "Go grab a glass of water."
enabled true
1   
data    "Slowly look all the way left, then right."
enabled true
2   
data    "Slowly look all the way up, then down."
enabled true
3   
data    "Close your eyes and take few deep breaths."
enabled true
4   
data    "Close your eyes and relax."
enabled true
5   
data    "Stretch your legs."
enabled true
6   
data    "Stretch your arms."
enabled true
7   
data    "Is your sitting posture correct?"
enabled true
8   
data    "Slowly turn head to side and hold for 10 seconds."
enabled true
9   
data    "Slowly tilt head to side and hold for 5-10 seconds."
enabled true
10  
data    "Stand from your chair and stretch."
enabled true
11  
data    "Refocus your eyes on an object at least 20 meters away."
enabled true
12  
data    "Take a moment to think about something you appreciate."
enabled true
13  
data    "Take a moment to smile at being alive."
enabled true
14  
data    "A truly ergonomic workstation is one that you regularly push away from."
enabled true
15  
data    "Close your eyes and count your breaths."
enabled true
16  
data    "Close your eyes and name the things you hear."
enabled true
17  
data    "Place your fingertips on your shoulders. Roll your shoulders forward for 10 seconds, then backward."
enabled true
18  
data    "Raise your right arm, stretch it over your head to the left, and hold for 10 seconds. Repeat on the other side."
enabled true
19  
data    "With your right hand, grab each finger of your left hand in turn and squeeze. Repeat on the other side."
enabled true
20  
data    "Stand up and do a lunge. Hold for 10 seconds, then do the other leg."
enabled true
21  
data    "Close your eyes and simply notice whatever arises in current moment, without judgement."
enabled true
22  
data    "Focus every 20 minutes for 20 seconds on an object at 20 feet distance."
enabled true
23  
data    "If you need help, ask for it."
enabled true
24  
data    "Do one thing at a time."
enabled true
25  
data    "Is your attention spent wisely?"
enabled true
26  
data    "Change your sitting posture."
enabled true
27  
data    "Expose your eyes to natural light."
enabled true
28  
data    "With your eyes closed, slowly and gently raise your eyes to the ceiling and back down to the floor."
enabled true
29  
data    "With your eyes closed, slowly and gently move your eyes to the left, then slowly to the right."
enabled true
30  
data    "Shake your hands out to get some relief."
enabled true
31  
data    "One at a time, touch the tip of each finger to the tip of your thumb so they make an O-shape."
enabled true
32  
data    "Make a fist and then slide your fingers up until they point toward the ceiling, like you're telling someone to stop."
enabled true
33  
data    "Make a fist and then fan your fingers out and stretch them as far as you can."
enabled true
showBreaksAsRegularWindows  false
appExclusions   
0   
rule    "pause"
active  true
commands    
0   "zoom.us"
1   "FaceTime.app"
appExclusionsCheckInterval  1000
pauseForSuspendOrLock   true
pauseBreaksToggleShortcut   ""
screen  "primary"
timeToBreakInTray   false
currentTimeInBreaks false
showTrayIcon    true
pauseBreaksShortcut ""
resumeBreaksShortcut    ""
__internal__    
migrations  
version "1.14.1"

Additional information

I have remained on version 1.7.0 as that has been the latest stable version for me - every other later release has some kind of bug or issue and version 1.7.0 works exactly as expected.

Code of Conduct

hovancik commented 1 year ago

Hi @nathana212 and thanks for the report. This is a known electron behavior where it takes some time to show the correct colors. I have some workarounds in code but I guess they are not enough. Not sure if I can make it better ;/

nathana212 commented 1 year ago

Thanks @hovancik. As noted, the process still works perfectly in 1.7.0 (and that's the last version it seems to work correctly), so is there something from the code that could be pulled from that version?

I understand for most this may not be not an issue, but I'm an audiobook narrator and even when the break starts, it's nice that I can still see through the color and finish the current sentence without having to immediately restart (because it flashes an opaque gray first).

hovancik commented 8 months ago

Hey, sorry for not replying @nathana212 . Too many issues :(

I have no idea if there would be any help trying to get code from 1.7.0 because Electron had many updates meanwhile and I remember I did rather big changes because of some bugs in that area.

Is this still similar with latest Stretchly? I can try looking into code again, maybe I will come up with something

nathana212 commented 8 months ago

Thanks for checking in on this. Just tried latest version, 1.15.1, and the same momentary opaque issue is still happening before the transparent effect. Looks like I'll just keep using 1.7 for now.

hovancik commented 8 months ago

Ok, I think this is the change: https://github.com/hovancik/stretchly/pull/978. Funny enough, it was to address the bug where there was blank break window.

hovancik commented 8 months ago

@nathana212 are you able to test #1442 locally? I don't have supported mac machine, but it seems to help (but not always) with your issue.

nathana212 commented 8 months ago

If you can walk me through how to test that, sure. I've only ever downloaded the .dmg packages to install

hovancik commented 8 months ago

No worries, I was able to make a new build: can you try? https://conta.noho.st/nextcloud/s/YfWsZma6yA7e33f

nathana212 commented 8 months ago

Tried this out. It seems to usually be fine and not present the problem, but every now and then, the gray screen still flashes before transparency. I reduced the opacity to .3 and that seemed to create the gray flash, but then I changed it back to .4 (my original setting), then back to .3 and the gray flash is sporadic. I can't seem to consistently re-create it, though at higher opacities (> .5), I don't notice it as much. Might the opacity have an impact on this behavior?

I'll also note that when it does work correctly (no gray flash, just transparency) the transition to the break seems a little stronger than 1.7. I'd have to re-install and check that (might just be remembering it differently), but would anything have changed with how the screen loads from 1.7 to 1.15.99?

hovancik commented 8 months ago

Transparency in Electron is not working well, so yeah, it is because of it :)

What do you mean that transitions seems a little stronger?

What I changed is the time when I show the break window (it is hidden by default and I try to show it when it should be ready loading all the things). Before I was waiting for some electron event telling me that break window is ready/done loading, and now I am not trusting the event, but show the Break only when my code tells me that all the changes I am doing for break window are done. Non is perfect.