White flash on page refresh #654
Labels
No labels
_CRITICAL_
API
app
backEnd
Blocked, waiting for further changes
bug
cleanup
close
design
duplicate
enhancement
feature request
frontEnd
help wanted
invalid
low priority
needs input
needs review
project documentation
question
research
reviewed
script
security
SQL
style
testing
topLevel
wontfix
No milestone
No project
No assignees
5 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Andras/BoundlessFlowCampus2K#654
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
When refreshing the page, there is a quick flash of white, most noticeable when using dark mode. This needs to be fixed
This issue needs more information. Browser? Operating system? Device? Is the browser in dark/light mode?
Oh, sorry. After testing having tested on different devices, I noticed the issue when using firefox on ubuntu and firefox and edge on windows. I could not see the flash when using chrome on ubuntu. The browser was in dark mode for all tests.
Directly (like "directly-when-pressing-the-button" directly) after hitting refresh? Can it be that the page is loading in and the CSS hasn't loaded in yet? I imagine that a webpage loads the HTML structure first, then applies CSS. Then the bright flash might be the body defaulting to white.
Yeah, I suspect this is the problem
A white flash is usually a rendering + CSS timing problem, sometimes influenced by the browser. The browser paints the page before CSS/theme styles are fully applied, which is what you guys suspected.
Firefox tends to paint earlier which causes a more visible flash while Chromium (Chrome/Edge) may delay paint slightly. I only got the problem on firefox when I tested, and fixed the white flash's color by fixing a reference to the theme.css that was broken (it now flashes the chosen themes bg color). But I do not think it will be possible to fix the whole flashing issue. The login modal also uses a different colored background which will make it more apparent when reloading.
What professionals do to avoid flashing light: split up the rendering into two stages, the necessary (background, theme, layout) and the secondary (other components), renders a skeleton first before the actual stuff (skeleton components) and sets rules to prevent performance issues. Maybe some rules should be set here to keep the performance low?
@b24idalu I think you can write an issue for this for what you have researched. Otherwise if that is complicated one method is to have an simple text informing the customer that the page is loading with text information then we can show the page after 2s delays.
When the issue is created I can close this issue.
I am currently creating a skeleton for the issue, that should be able to cover the flash. Will create a PR when it is done.
the pr is merged I close this issue.