Conversation
Akm0d
commented
Apr 14, 2026
|
@Akm0d I compared Firefox-in-normal-mode side-by-side with Chrome-in-dark-mode. The new code has a few deviations that must be handled before allowing it (in random order):
I'm too lazy to provide screenshots now for these items. Feel free to ask for that, I'll then add them. For new features, at least a few lines must be added to the documentation. Is it commonly expected that people can switch this on/off in the configuration file in an application? I missed the relation with Home Assistant, but you already fixed that by removing it from the title :-) You took care not to touch any existing code.
that would make the situation much more symmetrical. |
Thanks for the feedback! And thank you for such a thorough review. I'll address the things you mentioned right away. I'm using SaltGUI in my home-assisstant add-on so that's where the naming came from -- but it should be more generic for a PR to upstream. |
|
FYI: I've accepted the sonarcloud issue on |
|
A generic review comment: please keep the code changes in this PR limited to the introduction of the dark-mode. |
|
@Akm0d |
|
@Akm0d you can run all tests using just |
|
left = the GitHub logo is only different because I already updated it on the main branch. I'm currently ignoring all issues except styling. once that is done we'll go through the switching logic and so... |
|
converted PR to draft because you are working on it (no hidden meaning here) |
…e text contrast and subtle nodegroup divider
|
the PR stays in draft until all issues are agreed on. |
|
question: |
It would leave the potential for more themes besides light/dark to be added later. But I can remove it to just follow the browser setting for light/dark if that's preferred |
sorry for all the work on that bit, but I want to keep SaltGUI a simple as possible. |
|
I think we need this to fix the double-border-colour in the NodeGroups panel: |
|
With the update of the GitHub logo on the login panel, I added both the light and dark images to SaltGUI. |
|
variable |
The login panel needs some adjustments to bring back the original light mode. and to let its dark mode be consistent with that. Also, after the graphical bits, we'll focus on the code bits... |
| attributeFilter: ["data-theme"], | ||
| attributes: true, | ||
| }); | ||
| img.style = "width: 1em; margin-right: 5px"; |
There was a problem hiding this comment.
took me a few seconds to understand why this is 9 lines of code instead of just 2.
can you add a comment just before "new MutationObserver" with something like "// follow theme changes while the panel is already shown"
| Router.loginPage.login.bootstrapSession(); | ||
| } | ||
|
|
||
| const hash = window.location.hash.replace(/^#/, ""); |
There was a problem hiding this comment.
Is this needed for the datk-theme support in SaltGUI? Or is this only needed to support HA?
In that case please move the change to a next PR.
| this.bootstrapSession(); | ||
|
|
||
| // allow the success message to be seen | ||
| window.setTimeout(() => { | ||
| // erase credentials since we don't do page-refresh | ||
| this.usernameField.value = ""; | ||
| this.passwordField.value = ""; | ||
| if (Utils.getStorageItem("session", "login_response") !== null) { | ||
| // we might have been logged out in this first second | ||
| // e.g. when clock between client and server differs more than the session timout | ||
| const urlParams = new URLSearchParams(window.location.search); | ||
| if (urlParams.get("page")) { | ||
| // a redirect page is specified | ||
| const params = {}; | ||
| for (const pair of urlParams.entries()) { | ||
| params[pair[0]] = pair[1]; | ||
| } | ||
| const page = params["page"]; | ||
| delete params["page"]; | ||
| this.router.goTo(page, params); | ||
| } else { | ||
| this.router.goTo(""); | ||
| } | ||
| } | ||
| }, 1000); | ||
|
|
||
| } | ||
|
|
||
| bootstrapSession () { |
There was a problem hiding this comment.
Is this needed for the datk-theme support in SaltGUI? Or is this only needed to support HA?
In that case please move the change to a next PR.
|
|
||
| ## Theme | ||
| SaltGUI follows the browser color-scheme preference. | ||
| When SaltGUI is embedded, it also uses theme hints from the parent frame when those are available. |
There was a problem hiding this comment.
my preference is to move all HA related additions/variations to a next PR.
the second line fits that.
this is just to show the separation between the requirements.
…theme detection (HA-specific), simplify login logo, remove ingress bootstrapSession
|
| @@ -0,0 +1,20 @@ | |||
| (function initializeTheme () { | |||
| const context = globalThis; | |||
There was a problem hiding this comment.
globalThis is from ES2020, but SaltGUI promises at most ES6/ES2015.
In upcoming change #865, I will set the new policy to ES2020.
Until that time, can you provide an alternative?
|
Are you still working on |











