hacs / integration

HACS gives you a powerful UI to handle downloads of all your custom needs.
https://hacs.xyz
MIT License
5.18k stars 1.25k forks source link

Pending restart text unreadable in dark mode (default theme). #2698

Closed jazzyisj closed 2 years ago

jazzyisj commented 2 years ago

Web browser

Chrome

Web browser version

Version 102.0.5005.63 (Official Build) (64-bit)

System Health details

System Health

version: core-2022.5.5 installation_type: Home Assistant OS dev: false hassio: true docker: true user: root virtualenv: false python_version: 3.9.9 os_name: Linux os_version: 5.15.41 arch: aarch64 timezone: America/Toronto

GitHub API: ok GitHub Content: ok GitHub Web: ok GitHub API Calls Remaining: 4447 Installed Version: 1.25.1 Stage: running Available Repositories: 1146 Downloaded Repositories: 66

logged_in: true subscription_expiration: June 7, 2022, 8:00 PM relayer_connected: true remote_enabled: true remote_connected: true alexa_enabled: false google_enabled: true remote_server: us-east-1-1.ui.nabu.casa can_reach_cert_server: ok can_reach_cloud_auth: ok can_reach_cloud: ok

host_os: Home Assistant OS 8.1 update_channel: beta supervisor_version: supervisor-2022.05.3 docker_version: 20.10.14 disk_total: 113.9 GB disk_used: 40.4 GB healthy: true supported: true board: odroid-n2 supervisor_api: ok version_api: ok installed_addons: Samba share (9.6.1), Mosquitto broker (6.1.2), Studio Code Server (4.2.0), Glances (0.15.0), phpMyAdmin (0.7.1), Check Home Assistant configuration (3.10.0), Home Assistant Google Drive Backup (0.107.2), File editor (5.3.3), Log Viewer (0.13.0), InfluxDB (4.4.1), Grafana (7.5.2), ZeroTier One (0.13.2), Z-Wave JS (0.1.60), chrony (2.3.0), Frigate NVR (3.1), VLC (0.1.3), Z-Wave JS to MQTT (0.37.0), WeatherFlow to MQTT (3.0.7), RTSPtoWeb - WebRTC (1.2.2), MaryTTS (1.5.0), SSH & Web Terminal (10.1.1), MariaDB (2.4.0), UniFi Network Application (2.1.0), Mopidy (2.1.1)

dashboards: 8 resources: 37 views: 40 mode: yaml

api_endpoint_reachable: ok

Checklist

Describe the issue

Pending update instructions on main HACS page are unreadable in dark mode. I think this happened in last update. Did not notice it before.

Reproduction steps

  1. Update integration with HACS
  2. Switch profile to dark mode theme
  3. View HACS main menu ...

Screenshots

Default Theme Light Mode image

Default Theme Dark Mode image

Javascript logs from your browser console

card-mod.js:5 CARD-MOD 3.1.4 IS INSTALLED
card-mod.js:5 Card-mod is loaded as a module
f7a68b41.js:1 [Violation] Avoid using document.write(). https://developers.google.com/web/updates/2016/08/removing-document-write
value @ f7a68b41.js:1
value @ f7a68b41.js:1
performUpdate @ styles.ts:368
scheduleUpdate @ styles.ts:368
_$EC @ styles.ts:368
browser_mod.js:145 BROWSER_MOD 1.5.3 IS INSTALLED    DeviceID: b054fb55-7973f0e8
card-tools.js:90 CARD-TOOLS 2.1.2 IS INSTALLED  DeviceID: b054fb55-7973f0e8
state-switch.js:139 STATE-SWITCH 1.9.3 IS INSTALLED 
auto-entities.js:172 AUTO-ENTITIES 1.11.0 IS INSTALLED
hui-element.js:1 HUI-ELEMENT 1.1.2 IS INSTALLED 
swipe-card.js:21    SWIPE-CARD   Version 4.0.0 
layout-card.js:228 LAYOUT-CARD 2.4.2 IS INSTALLED
template-entity-row.js:51 TEMPLATE-ENTITY-ROW 1.3.0 IS INSTALLED 
slider-entity-row.js:1 The main 'lit-element' module entrypoint is deprecated. Please update your imports to use the 'lit' package: 'lit' and 'lit/decorators.ts' or import from 'lit-element/lit-element.ts'. See https://lit.dev/msg/deprecated-import-path for more information.
(anonymous) @ slider-entity-row.js:1
slider-entity-row.js:59 SLIDER-ENTITY-ROW 17.2.1 IS INSTALLED 
button-card.js:425   BUTTON-CARD   Version 3.4.2 
fold-entity-row.js:86 FOLD-ENTITY-ROW 20.0.12 IS INSTALLED 
bar-card.js:4855   BAR-CARD   Version 3.1.7    
time-picker-card.js:430   TIME-PICKER-CARD    Version 1.2.1    
github-entity-row.js:81  GITHUB-ENTITY-ROW  2.1.0 
swipe-navigation.js:51 ≡ swipe-navigation      ⋮ 
version 1.3.6            
utils.ts:1  BATTERY-STATE-CARD  2.1.1
entities.js:28   SPOTIFY-CARD   Version 2.4.0    
stack-in-card.js:200  STACK-IN-CARD    Version 0.2.0   
roku-card.js:187   ROKU-CARD       Version 1.3.0 
multiple-entity-row.js:1  MULTIPLE-ENTITY-ROW  4.4.1 
timer-bar-card.js:170  TIMER-BAR-CARD  Version 1.17.0 
lovelace-home-feed-card.js:243   HOME-FEED-CARD   Version 0.6.3    
apexcharts-card.js:835  APEXCHARTS-CARD  v2.0.1 
numberbox-card.js:3 NUMBERBOX_CARD 3.10
frigate-hass-card.js:21563   FRIGATE-HASS-CARD   Version 3.0.0    
digital-clock.js:186   Digital-Clock   Version 1.2.1    
history-explorer-card.js:66  HISTORY-EXPLORER-CARD  Version 1.0.22
DevTools failed to load source map: Could not load content for http://homeassistant.local:8123/hacsfiles/lovelace-home-feed-card/lovelace-home-feed-card.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
plotly-graph-card.js:12  PLOTLY-GRAPH  1.3.1 production

Diagnostics dump

No response

hacs-bot[bot] commented 2 years ago

Make sure you have read the issue guidelines and that you filled out the entire template.

If you have an issue identical to this, do not add comments like "same here", "i have this too", instead add a :+1: reaction to the issue description. Thanks! :+1:

ludeeus commented 2 years ago

image With default dark theme

jazzyisj commented 2 years ago

I've restarted HA, cleared cache, hard reload, restart Chrome.

Edge. image

Firefox image

It's fine on android mobile app. Screenshot_20220525-094718

ludeeus commented 2 years ago

You have a lot of custom cards, maybe one of them is interfering.

jazzyisj commented 2 years ago

OK. I'll try to narrow it down.

jazzyisj commented 2 years ago

Lovelace config.

lovelace: 
  mode: yaml

ui-lovelace.yaml

title: 'Home'
views:
  - title: 'Test'
    icon: mdi:ab-testing
    path: test
    cards:
      - type: entities
        entities:
          - entity: sensor.uptime

Console log:

f7a68b41.js:1 [Violation] Avoid using document.write(). https://developers.google.com/web/updates/2016/08/removing-document-write
value @ f7a68b41.js:1
value @ f7a68b41.js:1
performUpdate @ styles.ts:368
scheduleUpdate @ styles.ts:368
_$EC @ styles.ts:368

I can provide styles from console for the element if it will help?

jazzyisj commented 2 years ago

Noticed this one too on the last restart (background pending tasks notification) image This also displays as expected on the kiosk browser.

krisnoble commented 2 years ago

Not sure if this is related or not, I have a similar issue with light mode that only started happening recently, I think the last couple of HACS updates.

Looking in the dev tools it seems like in my case the issue is caused by the fact that I'm using the light HA theme but my OS setting is dark mode, so the "prefers dark mode" media query is setting the font colour to be a light one to contrast with the dark theme and not being properly overridden by my actual HA theme preference.

Screenshot 2022-05-27 at 13 33 11 Screenshot 2022-05-27 at 13 36 14
ludeeus commented 2 years ago

If that is the case you should have the same issue all places this element is used in the Home Assistant frontend

jk1993 commented 2 years ago

Same issue here. OS is light mode by default but using a dark theme in home assistant. Tried with the default dark theme as well as multiple custom dark ones e.g. Google Dark Theme and the issue persists. If it is being caused by the prefers-color-scheme media query that would make sense, as the text colour should be decided by the currently selected application theme, rather than your device's default preference.

To confirm that this is probably the cause, in Windows if I switch the "Default App mode" to "Dark" rather than light, the text in HACS fixes itself in real time and becomes readable again and the reverse is true if I switch it back to light.

ludeeus commented 2 years ago

Right, but there are only 2 media queries in the HACS frontend:

jk1993 commented 2 years ago

Can you think of anywhere else in home assistant that uses those alerts? Or a way of showing them? I can't find any anywhere on my instance. If we could reproduce it elsewhere then we could confirm that it's not a HACS issue at all and raise an issue on the home-assistant repo

ludeeus commented 2 years ago

The issue is in the HA frontend https://github.com/home-assistant/frontend/blob/dev/src/entrypoints/custom-panel.ts#L55-L60 Will override in HACS https://github.com/hacs/frontend/pull/597 until fixed there