Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Color mode does not take system theme in consideration after initial load #12330

Closed
abhi1693 opened this issue Apr 24, 2023 · 7 comments
Closed
Labels
severity: low Does not significantly disrupt application functionality, or a workaround is available status: blocked Another issue or external requirement is preventing implementation topic: UI/UX User interface or user experience related work type: bug A confirmed report of unexpected behavior in the application

Comments

@abhi1693
Copy link
Member

abhi1693 commented Apr 24, 2023

NetBox version

v3.4.8

Python version

3.10

Steps to Reproduce

  1. Set system theme to dark
  2. Clear brower cache and local storage
  3. Notice the UI shows dark
  4. Change the system theme to light
  5. No change is seen on the UI

Expected Behavior

Theme should work with system theme if user prefers it

Observed Behavior

Theme discards user preference

@abhi1693 abhi1693 added the type: bug A confirmed report of unexpected behavior in the application label Apr 24, 2023
@abhi1693
Copy link
Member Author

abhi1693 commented Apr 24, 2023

I have solved this issue in https://github.com/netbox-community/netbox/tree/fix/color-mode by introducing a new preference called system, when set uses the system theme else uses whatever the user prefers from light or dark. Note that this also considerably reduces the logic simplifying the underlying code.

Currently, the branch is built using feature as it introduces a new variable.

@jeremystretch jeremystretch added the status: accepted This issue has been accepted for implementation label Apr 25, 2023
@abhi1693 abhi1693 linked a pull request May 4, 2023 that will close this issue
@abhi1693 abhi1693 added status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation and removed status: accepted This issue has been accepted for implementation labels Jun 19, 2023
@abhi1693 abhi1693 removed their assignment Jun 19, 2023
@jeremystretch jeremystretch added the severity: low Does not significantly disrupt application functionality, or a workaround is available label Jun 23, 2023
@arthanson
Copy link
Collaborator

@abhi1693 assigning to you as it looks like you have a PR

@abhi1693
Copy link
Member Author

@arthanson The PR I have is incomplete and isn't working as I expected it. I did not want to hold someone else off with this if they had a better solution as I was stuck in getting this fixed.

I can look into this again maybe next week though.

Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Do not attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our contributing guide.

@github-actions github-actions bot added the pending closure Requires immediate attention to avoid being closed for inactivity label Dec 14, 2023
@jeremystretch
Copy link
Member

Marking this as blocked by #12128

@jeremystretch jeremystretch added status: blocked Another issue or external requirement is preventing implementation and removed status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation pending closure Requires immediate attention to avoid being closed for inactivity labels Dec 14, 2023
@jeremystretch jeremystretch added the topic: UI/UX User interface or user experience related work label Dec 27, 2023
@arthanson
Copy link
Collaborator

I think this is a non bug, you have to actually have to clear out "cookies and other site data" for this to work with the reproduction steps above. Doing so will cause you to be logged out and removes the cookie settings, if you refresh the page you will see that you have to log back in and then can change the light/dark mode.

@arthanson
Copy link
Collaborator

This is a non-issue in NB 4, you need to clear the browser cache and cookies which will log you out, when you log back in you will get the color that you have specified in settings. Closing

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
severity: low Does not significantly disrupt application functionality, or a workaround is available status: blocked Another issue or external requirement is preventing implementation topic: UI/UX User interface or user experience related work type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants