dosubot[bot] commented on issue #37289:
URL: https://github.com/apache/superset/issues/37289#issuecomment-3773921629

   <!-- Answer -->
   The fix isn't just a simple backend change—system default themes 
(THEME_DEFAULT and THEME_DARK) are defined in config.py as base themes and are 
not stored as database rows, which is why they don't appear in the dashboard 
theme assignment dropdown. Only themes saved in the database are assignable to 
dashboards via the UI. There’s no explicit filtering; the dropdown just lists 
what's in the css_templates table, so the system themes are never included by 
default.
   
   To make these system themes assignable, you’d need to either (a) materialize 
them as database rows (so they show up like any other theme), or (b) update the 
API/frontend to include config.py themes as special options in the dropdown. 
Either approach would require changes in both backend (theme API/model) and 
frontend (dropdown logic). If you take this on, be sure to test dashboard 
appearance in both light and dark modes, check for regressions in theme 
assignment, and confirm that custom CSS still works as expected. 
   
   This would be a good first issue for someone comfortable tracing both 
backend and frontend code paths, especially around theme management and 
dashboard metadata. For more details on how the theme system is structured, see 
[this merged PR](https://github.com/apache/superset/pull/35220) and [the theme 
DAO logic](https://github.com/apache/superset/pull/35220).
   
   
   <!-- Dosu Comment Footer -->
   *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).*
   
   ---
   <sup>How did I do? 
[Good](https://app.dosu.dev/response-feedback/cbfa01c1-acc2-4432-8889-69f742d8858b?feedback_type=great_response)
 | 
[Irrelevant](https://app.dosu.dev/response-feedback/cbfa01c1-acc2-4432-8889-69f742d8858b?feedback_type=irrelevant_answer)
 | 
[Incorrect](https://app.dosu.dev/response-feedback/cbfa01c1-acc2-4432-8889-69f742d8858b?feedback_type=incorrect_sources)
 | 
[Verbose](https://app.dosu.dev/response-feedback/cbfa01c1-acc2-4432-8889-69f742d8858b?feedback_type=too_verbose)
 | 
[Hallucination](https://app.dosu.dev/response-feedback/cbfa01c1-acc2-4432-8889-69f742d8858b?feedback_type=hallucination)
 | [Report 
🐛](https://app.dosu.dev/response-feedback/cbfa01c1-acc2-4432-8889-69f742d8858b?feedback_type=bug_report)
 | 
[Other](https://app.dosu.dev/response-feedback/cbfa01c1-acc2-4432-8889-69f742d8858b?feedback_type=other)</sup>
   
   [![Chat with 
Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github)&nbsp;[![Open
 in 
Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=The%20fix%20isn%27t%20just%20a%20simple%20backend%20change%E2%80%94system%20default%20themes%20%28THEME_DEFAULT%20and%20THEME_DARK%29%20are%20defined%20in%20config.py%20as%20base%20themes%20and%20are%20not%20stored%20as%20database%20rows%2C%20which%20is%20why%20they%20don%27t%20appear%20in%20the%20dashboard%20theme%20assignment%20dropdown.%20Only%20themes%20saved%20in%20the%20database%20are%20assignable%20to%20dashboards%20via%20the%20UI.%20There%E2%80%99s%20no%20explicit%20filtering%3B%20the%20dropdown%20just%20lists%20what%27s%20in%20the%20css_templates%20table%2C%20so%20the%20system%20themes%20are%20never%20included%20by%20default.%0A%0ATo%20make%20these%20system%20themes%20assignable%2C%20you%E2%80%99d%20need%20to%20either%20%28a%29%20materiali
 
ze%20them%20as%20database%20rows%20%28so%20they%20show%20up%20like%20any%20other%20theme%29%2C%20or%20%28b%29%20update%20the%20API/frontend%20to%20include%20config.py%20themes%20as%20special%20options%20in%20the%20dropdown.%20Either%20approach%20would%20require%20changes%20in%20both%20backend%20%28theme%20API/model%29%20and%20frontend%20%28dropdown%20logic%29.%20If%20you%20take%20this%20on%2C%20be%20sure%20to%20test%20dashboard%20appearance%20in%20both%20light%20and%20dark%20modes%2C%20check%20for%20regressions%20in%20theme%20assignment%2C%20and%20confirm%20that%20custom%20CSS%20still%20works%20as%20expected.%20%0A%0AThis%20would%20be%20a%20good%20first%20issue%20for%20someone%20comfortable%20tracing%20both%20backend%20and%20frontend%20code%20paths%2C%20especially%20around%20theme%20management%20and%20dashboard%20metadata.%20For%20more%20details%20on%20how%20the%20theme%20system%20is%20structured%2C%20see%20%5Bthis%20merged%20PR%5D%28https%3A//github.com/apache/superset/pull/35220%2
 
9%20and%20%5Bthe%20theme%20DAO%20logic%5D%28https%3A//github.com/apache/superset/pull/35220%29.)&nbsp;[![Join
 
Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share
 on 
X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/issues/37289)


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