gabotorresruiz opened a new pull request, #44173:
URL: https://github.com/apache/superset/pull/44173
### SUMMARY
`ThemeController.setThemeConfig` unconditionally set `themeConfigOverride =
true`.
`CrudThemeProvider` skips a dashboard's own assigned theme whenever
`hasThemeConfigOverride()` is true, so precedence was meant to let an explicit
host theme win for branding.
The problem is the embedded flow: a host that forwards the workspace default
theme into every iframe (for example through the Embedded SDK `setThemeConfig`)
tripped the override even though nothing genuinely differed from the workspace
default.
The result was that an embedded dashboard with its own `theme_id` showed the
workspace default instead of its assigned theme, while the normal logged in
view honored it.
The fix treats the config as an explicit override only when it genuinely
differs from the current workspace default.
A real host branding theme still wins; an auto forwarded default no longer
suppresses the dashboard theme.
```ts
const isExplicitOverride =
!isEqual(config.theme_default, this.defaultTheme) ||
!isEqual(config.theme_dark || null, this.darkTheme);
```
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Not applicable (behavioral fix; see testing instructions).
### TESTING INSTRUCTIONS
1. Assign a non default theme to a dashboard.
2. Embed that dashboard via a host that forwards the workspace default theme
config into the iframe.
3. Before: the embedded dashboard renders the workspace default theme.
4. After: the embedded dashboard renders its own assigned theme, while a
host that forwards a genuinely different theme still overrides it.
Unit tests: `ThemeController.test.ts` covers both directions (a forwarded
workspace default does not flag an override; a distinct SDK/host theme does),
plus the existing refresh precedence tests updated to use a genuine override.
### ADDITIONAL INFORMATION
- [ ] Has associated issue:
- [ ] Required feature flags:
- [x] Changes UI
- [ ] Includes DB Migration (follow approval process in
[SIP-59](https://github.com/apache/superset/issues/13351))
- [ ] 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]