netbox-community / netbox

The premier source of truth powering network automation. Open source under Apache 2. Try NetBox Cloud free: https://netboxlabs.com/free-netbox-cloud/
http://netboxlabs.com/oss/netbox/
Apache License 2.0
16.11k stars 2.58k forks source link

Rack elevations stuck in light mode when HTMX navigation is enabled #15819

Open v0tti opened 6 months ago

v0tti commented 6 months ago

Deployment Type

Self-hosted

NetBox Version

v4.0-beta2

Python Version

3.11

Steps to Reproduce

  1. Switch to dark mode
  2. Visit /dcim/rack-elevations/ or any rack directly

Expected Behavior

I expect the racks to be display with a dark background.

Correctly displayed elevations happening some times in my self-hosted NetBox: Screenshot 2024-04-23 at 11-45-11 Rack Elevations NetBox

Observed Behavior

The racks and the numbers to their left are displayed with a light background. Sometimes they are displayed correctly in my self-hosted install, but I could not reproduce when this is happening.

Elevations in light mode while NetBox is in dark mode (NetBox demo page): Light mode elevations at NetBox demo

jeremystretch commented 6 months ago

Thank you for opening a bug report. I was unable to reproduce the reported behavior on NetBox v4.0-beta2. Please see if you can identify steps to reproduce the behavior consistently.

julianstolp commented 6 months ago

I can confirm this issue, also happening the other way around in light mode, image

  1. Enable HTMX Navigation
  2. Go to racks -> open rack
  3. Toggle color theme
  4. Go back to racks -> open rack again
  5. See this image
  6. Bonus: color theme toggle does not work anymore + bottom right corner date, servername and netbox version dissapear
  7. STRG+F5 everything works as expected
v0tti commented 6 months ago

I would like to at that I can also reproduce this issue without HTMX at https://beta-demo.netbox.dev/dcim/rack-elevations/ even without being logged in. Just visit the rack elevations and switch to dark mode and the racks will be displayed with a light background. This also affects my local self-hosted install, but there it changes to dark mode after page load in finished.

arthanson commented 6 months ago

Note: Any fix for this should also check cable trace SVG.

arthanson commented 4 months ago

@v0tti I think this is fixed in the latest releases, can you please re-try in NetBox 4.0.3?

llamafilm commented 4 months ago

This is still a problem in 4.0.5. Refreshing the page fixes it.

v0tti commented 4 months ago

@v0tti I think this is fixed in the latest releases, can you please re-try in NetBox 4.0.3?

It seems to still display the elevations in light mode during page load, but as soon as the page is fully loaded they are displayed correctly: Screenshot from 2024-06-26 16-47-11

After manually switching to light mode they seem to be stuck in the wrong mode: Screenshot 2024-06-26 at 16-40-22 Rack Elevations NetBox

By reloading the page they are properly displayed in light mode (notice the different hue of white behind the unit numbers): Screenshot 2024-06-26 at 16-40-35 Rack Elevations NetBox

arthanson commented 1 month ago

blocked by. #17571