Skip to content
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

Loading screen shows white background in dark mode #6607

Closed
3 tasks done
mountainsandcode opened this issue Aug 12, 2020 · 10 comments
Closed
3 tasks done

Loading screen shows white background in dark mode #6607

mountainsandcode opened this issue Aug 12, 2020 · 10 comments
Labels
Bug Current Bug in UI - Extra Attention UX User experience related bug

Comments

@mountainsandcode
Copy link

mountainsandcode commented Aug 12, 2020

Checklist

  • I have updated to the latest available Home Assistant version.
  • I have cleared the cache of my browser.
  • I have tried a different browser to see if it is related to my browser.

The problem

  • Using default theme, dark mode
  • Reloading the page in browser or the mobile app, the reloading screen is fully white, while the app is in dark mode, which creates a kind of “flash”

E5BDA20F-E216-4DF7-A403-C19510E2B50A
5D83218D-13A3-49C3-8FAB-1502A4BBD87A

Expected behavior

Background of the page to be black/ gray if the theme is set to dark mode

Steps to reproduce

  • Activate dark mode
  • Pull-to-refresh or refresh the page in browser
  • See white “flash”

Environment

  • Home Assistant release with the issue: 0.114.0
  • Last working Home Assistant release (if known): n/a
  • Browser and browser version: Safari on iPad, iOS App
  • Operating system: iPadOS, iOS

State of relevant entities

Problem-relevant configuration

Javascript errors shown in your browser console/inspector

Additional information

@mountainsandcode mountainsandcode added the Bug Current Bug in UI - Extra Attention label Aug 12, 2020
@bramkragten
Copy link
Member

Is your device in dark mode or have you manually set dark mode?

@mountainsandcode
Copy link
Author

Is your device in dark mode or have you manually set dark mode?

The device is in dark mode (iPhone/iPad)

@balintkozma
Copy link

The same for me on Windows 10 and Android 10 on Samsung. Dark mode enabled on both operating systems.

@ludeeus
Copy link
Member

ludeeus commented Aug 15, 2020

I'm not able to reproduce this
image

@ludeeus ludeeus added UX User experience related bug dark-theme labels Aug 15, 2020
@spacegaier
Copy link
Member

spacegaier commented Aug 28, 2020

@ludeeus The flash happens for me before that loading screen is shown (Firefox on Win 10). Once I see the "Loading data" text and the progress ring, it has the proper black background.

But at least for me the flash exists with all themes (HA default white as well as 3rd party ones). With dark ones such as HA default dark it is just more visible and more jarring.

@spacegaier
Copy link
Member

spacegaier commented Aug 28, 2020

I played around a bit with manually triggering a page refresh in Firefox and then immediately pressing stop in Firefox. I then ended up on the following white page (<ha-init-page>), but not sure if that is just because I stopped the proper loading of the page or whether that is actually the white flash that can be seen.

Note: The text "Unable to connect to Home Assistant" is in the DOM, but is rendered white, which leads me to believe that it is attempting to use the dark theme, where text is white, but just not consistently across the whole init page [saw that it is white in the normal default light theme as well, so never visible?].
At this point in time, primary-background-color is still set to white, as is text-primary-color.

image

@bramkragten
Copy link
Member

It is because we add our default styles before we load the selected user theme/dark theme.

https://github.com/home-assistant/frontend/blob/dev/src/entrypoints/app.ts#L3

@spacegaier
Copy link
Member

Yes, I had played around a bit by setting background-color: var(--primary-background-color) in the ha-init-page.ts, but that is still resolving to the normal white background at runtime, since the adjusted darkStyles colors are not yet applied.

=> So is that something that falls in the category "cannot / won't solve" or do you see an option to adjust here something?

@spacegaier
Copy link
Member

I found a way how to prevent the white flashes. PR is coming in the next minutes.

@spacegaier
Copy link
Member

This PR #6815 fixes the flashing for the main content area.

@github-actions github-actions bot locked and limited conversation to collaborators Jul 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Current Bug in UI - Extra Attention UX User experience related bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants