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

   ### SUMMARY
   The dashboard properties "Theme" dropdown fetches `/api/v1/theme/` with an 
`is_system eq false` filter 
(superset-frontend/src/dashboard/components/PropertiesModal/index.tsx), which 
hides the two system themes. Contrary to a GitHub bot comment on the issue 
claiming THEME_DEFAULT/THEME_DARK are "not stored as database rows," 
`SeedSystemThemesCommand` (superset/commands/theme/seed.py) already upserts 
them as `Theme` rows with `is_system=True` on every app start (superset/app.py 
-> `sync_config_to_db`). Since user-created themes are always created with 
`is_system=False` (superset/themes/api.py), the client-side filter is exactly 
what hid the two system themes from the picker — no backend/schema change is 
needed. This PR removes that filter so THEME_DEFAULT/THEME_DARK become 
selectable, letting a dashboard be pinned to a specific theme regardless of a 
viewer's OS/browser dark-mode preference (the reported use case: dashboards 
with custom CSS written for a light theme break when a vie
 wer's system prefers dark).
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   No screenshots captured — this environment has no running Superset instance 
to render the dropdown against. The change and its effect (system themes appear 
as extra options in `dashboard-theme-select`) are covered by the added Jest 
regression test instead.
   
   ### TESTING INSTRUCTIONS
   1. Start Superset with the default config (THEME_DEFAULT/THEME_DARK set, 
ENABLE_UI_THEME_ADMINISTRATION = True).
   2. Open a dashboard -> Edit properties -> Styling -> Theme dropdown.
   3. Before this change: only custom themes created via Settings -> Themes 
appear.
   4. After this change: THEME_DEFAULT and THEME_DARK also appear and can be 
assigned; the dashboard renders with the assigned theme regardless of the 
viewer's dark-mode preference.
   
   ### ADDITIONAL INFORMATION
   - [x] Has associated issue: Fixes #37289
   - [ ] Required feature flags:
   - [x] Changes UI
   - [ ] Includes DB Migration (follow approval process in SIP-59)
     - [ ] 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