gabotorresruiz opened a new pull request, #34321:
URL: https://github.com/apache/superset/pull/34321

   <!---
   Please write the PR title following the conventions at 
https://www.conventionalcommits.org/en/v1.0.0/
   Example:
   fix(dashboard): load charts correctly
   -->
   
   ### SUMMARY
   <!--- Describe the change below, including rationale and design decisions -->
   This PR fixes a critical issue where users providing partial Bootstrap theme 
configurations (e.g., only THEME_DEFAULT defined with empty THEME_DARK) 
couldn't switch to dark mode (nothing got changed since it wasn't a 
`THEME_DARK` been set. The solution was to implement a fallback logic that uses 
Superset's built-in themes with proper Ant Design algorithms when Bootstrap 
themes are incomplete or missing.
   
   Also I've replaced the `THEME_ENABLE_DARK_THEME_SWITCH` feature flag to 
start using the `THEME_SETTINGS` approach.
   
     Changes:
     - Replaced `THEME_ENABLE_DARK_THEME_SWITCH` feature flag with 
`THEME_SETTINGS.allowSwitching`
     - Updated `RightMenu.tsx` to use theme context's `canSetThemeMode()` 
instead of feature flag checks
     - Added `canSetThemeMode()` method to theme context interface
   
   ### TESTING INSTRUCTIONS
   <!--- Required! What steps can be taken to manually verify the changes? -->
   1. Go to `superset/config.py` and only define a `THEME_DEFAULT`.
   E.g.:
   ```
   THEME_DEFAULT: Theme = {"token": {"brandLogoUrl": 
"https://picsum.photos/200"}}
   ```
   2. Since the default for `THEME_SETTINGS.allowSwitching` is `true` if no 
theme settings are defined
   3. Reload the UI and change the theme mode to dark mode
   4. You should see how the UI defaults to the superset dark mode theme since 
we didn't pass a `THEME_DARK` from configs
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   


-- 
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]

Reply via email to