frontend
frontend copied to clipboard
Map card, new contrasted design: the "the dark_mode" option does not work
Checklist
- [X] I have updated to the latest available Home Assistant version.
- [X] I have cleared the cache of my browser.
- [X] I have tried a different browser to see if it is related to my browser.
Describe the issue you are experiencing
On 2022.8 a new "more contrasted" design was provided for Map card.
The dark_mode
option now works not as it did earlier.
Here is how it works now:
Light default theme:
type: vertical-stack
cards:
- type: map
entities:
- person.ildar
- type: map
entities:
- person.ildar
dark_mode: false
...
dark_mode: true
The bottom map is dark (why?).
Dark default theme:
...
dark_mode: false
The upper map is dark (why?).
The bottom map is less dark (why?).
...
dark_mode: true
The upper map is dark (why?).
Describe the behavior you expected
If the dark_mode
is true
then:
- if theme is in a dark mode -> map is dark
- otherwise -> map is light
If the dark_mode
is false
or not specified then:
- map is light
Steps to reproduce the issue
As described above.
What version of Home Assistant Core has the issue?
2022.8.0
What was the last working version of Home Assistant Core?
2022.7.7
In which browser are you experiencing the issue with?
Chrome 103.0.5060.134
Which operating system are you using to run this browser?
Win10x64
State of relevant entities
No response
Problem-relevant frontend configuration
No response
Javascript errors shown in your browser console/inspector
No response
Additional information
No response
Another explanation.
If the system theme is set to Dark as opposed to Auto or Light, the Map Card, Dark Mode ? toggle switch has no effect on the map theme. It remains in Dark mode theme.
If the system theme is set to Light, then the Dark Mode ? toggle switch does change the map theme between Light or Dark.
Another explanation.
Is it your explanation of THE CURRENT implementation or is it your proposed implementation?
If 1st: then "to Dark as opposed to Auto or Light, the Map Card, Dark Mode ? toggle switch has no effect" is WRONG - seen above, the "default dark theme, dark_mode: false" case.
This is the current method of operation which is incorrect. Dark mode is selected as main theme. Map Card as shown is showing Dark Mode without the toggle being set.
Map Card as shown is showing Dark Mode without the toggle being set.
Note that in dark theme the un-toggled "dark_mode" makes the map more contrasted.
Yes, but that is not the correct function of the toggle switch. It's being mis-used.
I described the expected behaviour in the 1st post.
I suggest you re-read your 1st post. It's not at all clear what you are trying to achieve from it.
The dark mode toggle only works if you are in light mode and want to have the map dark. No other functionality is offered.
Then the toggle should be removed if you are in dark mode.
The dark mode toggle only works if you are in light mode and want to have the map dark
This was the previous functionality which does not work now:
If the dark_mode
is true then:
-- if theme is in a dark mode -> map is dark
-- otherwise -> map is light
If the dark_mode
is false or not specified then:
-- map is light
Isn't it? It WAS working this way. Probably the purpose of this "dark_mode" option was changed on 2022.8.
Update: Check in 2022.7.4:
Strange, the logic here is: if "dark_mode" = undefined -- color = color of theme if "dark_mode" = false -- color = light (in any theme) if "dark_mode" = true -- color = dark (in any theme)
Really strange. According to docs, default value = false. And this is not confirmed by tests below. I guess that some time ago the logic was different and was like I described in the 1st post (repeated in the beginning of this post).
Results of tests in 2022.7.4 are below:
type: vertical-stack
cards:
- type: map
entities:
- person.ildar
- type: map
entities:
- person.ildar
dark_mode: false
dark_mode: true
dark_mode: false
dark_mode: true
As a programmer with 48 years of experience, the toggle should not have been changed. The whole purpose of this update was to first change the Light theme to a more colorful presentation which has been acheived by updating the Leaflet OpenStreetMap. The Leaflet Dark theme ( CARTO.com Dark) still presented a problem as it is really dark, but a workaround was implemented to make it more readable. A user should still have the option to decide which theme they wish to see in the map, regardless of the base OS theme.
This is a Feature Request not an issue.
What exactly is a FR?
- See a difference between 2022.8 & 2022.7.4:
old:
new:
The "dark theme / dark_mode=false" is DIFFERENT. Should it be?
-
According to the docs:
But in both the "2022.7.4" & "2022.8" versions "dark_mode: default" is not the same as "dark_mode: false".
-
As for my thoughts "how it was working long time ago": I may be wrong. Do not have an old HA version to clarify how it was working long time ago.
But even when comparing 2022.7.4 & 2022.8, what I see is: -- the "dark theme / dark_mode=false" case is different; -- in both versions "dark_mode: default" is not the same as "dark_mode: false" - which is specified in the docs.
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.
up
it should be possible to choose a light theme for the map, when the main theme is dark
up
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.
up
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.
up
It's impossible to have white map with dark app interface. This is a bug, that should be fixed. Recent activity is not a reason to ignore it, please disable auto-closing.
It makes sense that, if a user doesn't define a dark_mode setting, the map card follows the theme setting, but if the user specifically specifies dark_mode: false it surely makes sense to respect that? Why not do so?
Fixed by #20541