-
Notifications
You must be signed in to change notification settings - Fork 889
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
Don't blind dark theme users (Dark loading screen) #1502
Conversation
It is better to start the temporary background dark so it doesnt flashbang dark theme users late at night. Just happened to me 😢 This makes the loading background color the normal dark theme background color.
Is this only for dark theme? Or both dark and night theme? |
I don't think theme variables can be called from the electron js file. a dark theme is miles better than light for loading in any case. most users use dark so black is not overly important |
I agree with the idea! Very useful! But I think it should be something like hiding the entire body content right before the page loads, then when it does, depending on the dark/light mode it will change dynamically. Here's an example: Before Page Loads
After Page Loads
On the current implementation what could be targeted is |
Dragos, I don't think you understand, no css is used to set loading color, just a hex code in the electron js file inside browserwindow backgroundclor |
Alright, I get you now. I still think that there could be a way to make that dynamic, not sure how tho. That css for setting the color and opacity was from a platform I built in the past, none of it is in freetube. My point was the idea, not the code necessarily. JS can inject css too or change values like |
look at the commit so you get an idea of what changed |
I did lol... before as well... you changed the color, it's one small change |
I think that here you commented on the wrong one lol. But I added what you said. |
no i didnt haha. I was being a bot and adding this line to almost every PR that didn't link the issue properly. |
ohhhhh my bad. I forgot it was @peepopoggers who created this pr for a second, so I was confused lmao |
I do not know this project and electron's capabilities enough to know if this is possible (or needed, effort-wise) but for now this change helps alot. If a way is found then this pr could be a temporary fix. The way to make the background consistent with whatever theme would be reading the css variables into the js file (the commit is in) and then making the background color a variable based on the hex code for the background. As I said, idk how settings & variables are stored, but it might be possible. |
It does, I feel ya. If you wanna target the theme with js, then there's a localstorage variable called I haven't checked the order in which css and js load, cuz it could be that the some things load after and before that line, but when I tested your version a few seconds ago it was opening with the dark background, but then it was light for 1s... that's freetube figuring out what theme is set (cuz light is the default while it recognizes your localstorage variable's value)... and then went dark again, which is normal cuz I was on dark... which means your change works, but only 1/3 times. The other time it doesn't work is if I refresh the app, then it spends 1 second again in light mode figuring out what theme I have. Although to be fair, I don't think that most users refresh the app. So then your change works 1/2 times haha |
I think the best solution would be to have the background colour be set based on which base theme is set. |
@PrestonN What about the issue mentioned by dragos? Might have to look into that. The way to make the bg color not inconsistent would be to load the color when app is not yet open |
Yes, My solution addresses that.
|
Thanks for this. Was about to submit one myself. The app always blinds me when I open it haha. |
I think light being theme loading color needs to change too. |
The reason this happens is due to two issues:
|
Updated and there is no white flash for me anymore (except for some weird cases). I tried to use localstorage in index.js but FreeTube would not launch without showing any errors, so I used the default dark mode for the beginning launch. The main change is moving the checkThemeSettings() to before the other functions so that it is not delayed. I would appreciate testers. Edit: I also think that there may be a tiny white flash the first time you use the app, but nearly every other time it does not flash. It is weird because I think if there is some interruption while starting, there is a possibility of a flash. Is created() the earliest function available to check for themes? It's annoying because it is not consistent enough for this to be ready to be merged :< |
I will document the flashing difference with dev and without dev if any later today |
With that change it looks consistent when built but it needs testing |
With this change the app flash issue has become at least less noticeable. |
@peepopoggers Edit: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One change left for https://github.com/FreeTubeApp/FreeTube/blob/development/src/index.ejs#L19 to fix the flash
light mainRed secBlue
incomplete.mov
dark mainRed secBlue
complete.mov
@PikachuEXE I did not see that change! My mistake. Will change promptly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested via npm run debug
Screen.Recording.2021-09-30.at.10.20.45.AM.mov
1 more to go! |
@efb4f5ff-1298-471a-8973-3d47447115dc Could you test this :) |
already did waiting for approval to merge this |
It is better to start the temporary background dark so it doesnt flashbang dark theme users late at night.
Just happened to me 😢
This makes the loading background color the normal dark theme background color.
Dark Introduction when loading
Pull Request Type
Please select what type of pull request this is:
Related issue
closes #1107
Description
Changes loading background color to dark.
Testing (for code that is not small enough to be easily understandable)
Has this pull request been tested?
Changes Color