netbox icon indicating copy to clipboard operation
netbox copied to clipboard

Rack elevations stuck in light mode when HTMX navigation is enabled

Open v0tti opened this issue 10 months ago • 7 comments

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

v0tti avatar Apr 23 '24 10:04 v0tti

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.

jeremystretch avatar Apr 23 '24 12:04 jeremystretch

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

julianstolp avatar Apr 23 '24 12:04 julianstolp

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.

v0tti avatar Apr 24 '24 06:04 v0tti

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

arthanson avatar Apr 26 '24 18:04 arthanson

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

arthanson avatar Jun 17 '24 15:06 arthanson

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

llamafilm avatar Jun 26 '24 14:06 llamafilm

@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

v0tti avatar Jun 26 '24 14:06 v0tti