frontend icon indicating copy to clipboard operation
frontend copied to clipboard

Map card, new contrasted design: the "the dark_mode" option does not work

Open ildar170975 opened this issue 1 year ago • 23 comments

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

image


    ...
    dark_mode: true

The bottom map is dark (why?). image


Dark default theme:

    ...
    dark_mode: false

The upper map is dark (why?). The bottom map is less dark (why?). image


    ...
    dark_mode: true

The upper map is dark (why?). image

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

ildar170975 avatar Aug 03 '22 20:08 ildar170975

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.

New Map Card

Kertz1954 avatar Aug 03 '22 21:08 Kertz1954

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.

ildar170975 avatar Aug 03 '22 21:08 ildar170975

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.

Kertz1954 avatar Aug 03 '22 22:08 Kertz1954

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.

ildar170975 avatar Aug 03 '22 22:08 ildar170975

Yes, but that is not the correct function of the toggle switch. It's being mis-used.

Kertz1954 avatar Aug 03 '22 22:08 Kertz1954

I described the expected behaviour in the 1st post.

ildar170975 avatar Aug 03 '22 22:08 ildar170975

I suggest you re-read your 1st post. It's not at all clear what you are trying to achieve from it.

Kertz1954 avatar Aug 03 '22 23:08 Kertz1954

The dark mode toggle only works if you are in light mode and want to have the map dark. No other functionality is offered.

zsarnett avatar Aug 03 '22 23:08 zsarnett

Then the toggle should be removed if you are in dark mode.

Kertz1954 avatar Aug 03 '22 23:08 Kertz1954

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

image


    dark_mode: true

image


    dark_mode: false

image


    dark_mode: true

image

ildar170975 avatar Aug 03 '22 23:08 ildar170975

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.

Kertz1954 avatar Aug 03 '22 23:08 Kertz1954

This is a Feature Request not an issue.

zsarnett avatar Aug 04 '22 00:08 zsarnett

What exactly is a FR?

  1. See a difference between 2022.8 & 2022.7.4: old: image new: image

The "dark theme / dark_mode=false" is DIFFERENT. Should it be?

  1. According to the docs: image But in both the "2022.7.4" & "2022.8" versions "dark_mode: default" is not the same as "dark_mode: false".

  2. 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.

ildar170975 avatar Aug 04 '22 04:08 ildar170975

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.

github-actions[bot] avatar Nov 02 '22 05:11 github-actions[bot]

up

ildar170975 avatar Nov 02 '22 09:11 ildar170975

it should be possible to choose a light theme for the map, when the main theme is dark

arduiacob avatar Jan 13 '23 05:01 arduiacob

up

mikulik86 avatar May 15 '23 19:05 mikulik86

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.

github-actions[bot] avatar Aug 19 '23 01:08 github-actions[bot]

up

ildar170975 avatar Aug 19 '23 01:08 ildar170975

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.

github-actions[bot] avatar Nov 17 '23 02:11 github-actions[bot]

up

ildar170975 avatar Nov 23 '23 17:11 ildar170975

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.

532910 avatar Feb 18 '24 10:02 532910

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?

nickelliott avatar Feb 23 '24 13:02 nickelliott

Fixed by #20541

karwosts avatar Apr 24 '24 13:04 karwosts