villebro commented on code in PR #41007:
URL: https://github.com/apache/superset/pull/41007#discussion_r3532170134
##########
superset/config.py:
##########
@@ -1128,6 +1128,10 @@ def sync_theme_logo_href(
# Enable UI-based theme administration for admins
ENABLE_UI_THEME_ADMINISTRATION = True # Allows admins to set system themes
via UI
+# Default theme mode for sessions without a saved user preference.
+# Valid values: "default" (light), "dark", "system" (follows OS preference)
+THEME_DEFAULT_MODE: str = "default"
+
Review Comment:
This should be explicit string literals:
```suggestion
# Default theme mode for sessions without a saved user preference.
THEME_DEFAULT_MODE: Literal["default", "dark", "system"] = "default"
```
##########
superset/views/base.py:
##########
@@ -431,6 +431,9 @@ def get_theme_bootstrap_data() -> dict[str, Any]:
"theme": {
"default": default_theme,
"dark": dark_theme,
+ "defaultMode": app.config["THEME_DEFAULT_MODE"]
+ if app.config["THEME_DEFAULT_MODE"] in ("default", "dark",
"system")
+ else "default",
Review Comment:
We should be able to assume `THEME_DEFAULT_MODE` is a valid value:
```suggestion
"defaultMode": app.config["THEME_DEFAULT_MODE"],
``
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]