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

Status- and Navigation bars are not being colored anymore on Core 2021.12.0b3 #1997

Closed
LasseRosenow opened this issue Dec 9, 2021 · 9 comments · Fixed by #2000
Closed

Status- and Navigation bars are not being colored anymore on Core 2021.12.0b3 #1997

LasseRosenow opened this issue Dec 9, 2021 · 9 comments · Fixed by #2000
Labels
bug Something isn't working webview

Comments

@LasseRosenow
Copy link
Contributor

LasseRosenow commented Dec 9, 2021

Home Assistant Android version: 2021.10.0-full

Android version: 11

Phone model: Xiaomi Mi 9T Pro

Home Assistant version: 2021.12.0b5

Last working Home Assistant release (if known): 2021.11.5

Description of problem:
I just updated to Home Assistant 2021.12.0b5 and realised, that the status and navigation bars are not getting colored anymore. This is especially visible in light mode, where they just stay black instead of getting colored blue.

I did some debugging and figured, that the android app is listening on a json object post with the type config/get which used to be send after the web app loaded. But it is not being send anymore. But when you open the Frontend Settings page, it is loaded, and the status and navigation bar are getting their colors.
But of course this is not how it is supposed to be.

I also opened an Issue on the frontend repo, though I'm not really sure, where this post request comes from etc., so I'm not even sure if thats the right place and also nobody is answering issues on the frontend recently it seems like.
See: home-assistant/frontend/issues/10823

I figured that the android app team would be interested in this issue and might help reaching out to the people who are able to fix it :)

@LasseRosenow LasseRosenow added the bug Something isn't working label Dec 9, 2021
@dshokouhi
Copy link
Member

Can you check on b5 as that was released 4 hours ago? Also for beta issues like this we should communicate in #beta on discord

@LasseRosenow
Copy link
Contributor Author

LasseRosenow commented Dec 9, 2021

Also for beta issues like this we should communicate in #beta on discord

Okay thank you, I fill remember that for the future :)

Can you check on b5 as that was released 4 hours ago?

Yes I just updated and I can confirm, that this issue still remains

@dshokouhi
Copy link
Member

So looks like HA core no longer sends config/get upon loading the sidebar as its done in the config screen in this new release. I think we may need to use a websocket call to get the config now. Now that we have websockets in the app we should be able to migrate this.

https://developers.home-assistant.io/docs/api/websocket#fetching-config

@LasseRosenow
Copy link
Contributor Author

LasseRosenow commented Dec 9, 2021

What I was just wondering about: Wouldn't it be a great Idea, if the websocket api of homeassistant had an endpoint to query the actual theme colors? like theme/get or maybe as a property of what ever config/get returns? This way we wouldn't need to rely on executing hacky javascript to get the theme variables out of the webview at a point in time at which we hope they do have the correct values ;)

@balloob
Copy link
Member

balloob commented Dec 9, 2021

That's possible. This is how we fetch themes and subscribe to updates: https://github.com/home-assistant/frontend/blob/dev/src/data/ws-themes.ts#L30-L39

@LasseRosenow
Copy link
Contributor Author

LasseRosenow commented Dec 10, 2021

I actually thought about using the socket api again and Maybe its not ideal, because it would have the drawback of taking more time then just fetching the variables from the webview.

I just played around with the new theme-update external event type (introduced in home-assistant/frontend/pull/10819) and its just amazing, because now when the app starts, the status and navigation bar get its color exactly the same time as the webview, so the transition between theme changes is as smooth as it could ever be :)

See: #2000

@LasseRosenow
Copy link
Contributor Author

What would you think about adding the theme colors as payload to the "theme-update" event? @balloob?

@balloob
Copy link
Member

balloob commented Dec 10, 2021

I decided to not include it, because we can't predict what data the mobile app will need in the future so better to let the mobile app gather it themselves.

@LasseRosenow
Copy link
Contributor Author

My thought is that because its only a message, that is only send through the external bus and not through the network or something, it should be fine to just send the whole theme (meaning all the official home assistant base colors.. not stuff like checkbox-color or something). That should not be too large to cause problems in my opinion 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working webview
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants