codeant-ai-for-open-source[bot] commented on code in PR #42815:
URL: https://github.com/apache/superset/pull/42815#discussion_r3737677158


##########
superset-frontend/packages/superset-core/src/theme/Theme.tsx:
##########
@@ -110,12 +119,15 @@ export class Theme {
   }
 
   /**
-   * Update the theme using any theme configuration
-   * Automatically handles both AntdThemeConfig and SerializableThemeConfig
-   * Dark mode should be specified via the algorithm property in the config
+   * Update the theme using any theme configuration, optionally merged over a
+   * base theme. Automatically handles both AntdThemeConfig and
+   * SerializableThemeConfig. Dark mode should be specified via the algorithm
+   * property in the config.
    */
-  setConfig(config: AnyThemeConfig): void {
-    const antdConfig = normalizeThemeConfig(config);
+  setConfig(config: AnyThemeConfig, baseTheme?: AnyThemeConfig): void {
+    const antdConfig = normalizeThemeConfig(
+      Theme.mergeConfig(config, baseTheme) ?? config,

Review Comment:
   **Suggestion:** The merged configuration is used only for Ant Design token 
generation, while the Superset-specific ECharts overrides are still extracted 
from the unmerged `config`. When `baseTheme` provides these overrides and the 
dashboard config does not, the initial `fromConfig` call includes them but 
every later in-place update removes them, causing ECharts charts to lose their 
global or chart-specific customizations. Extract the Superset-specific fields 
from the same merged configuration passed to normalization. [api mismatch]
   
   <details>
   <summary><b>Severity Level:</b> Major ⚠️</summary>
   
   ```mdx
   - ❌ ECharts charts lose inherited global customizations after theme updates.
   - ⚠️ Chart-specific ECharts styling disappears during dashboard theme 
changes.
   ```
   </details>
   
   [![Fix in 
Cursor](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-cursor-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=1209004ea5e94b4e94b669132169a4f1&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
 [![Fix in VSCode 
Claude](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-vscode-claude-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=1209004ea5e94b4e94b669132169a4f1&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
   
   *(Use Cmd/Ctrl + Click for best experience)*
   <details>
   <summary><b>Prompt for AI Agent 🤖 </b></summary>
   
   ```mdx
   This is a comment left during a code review.
   
   **Path:** superset-frontend/packages/superset-core/src/theme/Theme.tsx
   **Line:** 129:129
   **Comment:**
        *Api Mismatch: The merged configuration is used only for Ant Design 
token generation, while the Superset-specific ECharts overrides are still 
extracted from the unmerged `config`. When `baseTheme` provides these overrides 
and the dashboard config does not, the initial `fromConfig` call includes them 
but every later in-place update removes them, causing ECharts charts to lose 
their global or chart-specific customizations. Extract the Superset-specific 
fields from the same merged configuration passed to normalization.
   
   Validate the correctness of the flagged issue. If correct, How can I resolve 
this? If you propose a fix, implement it and please make it concise.
   Once fix is implemented, also check other comments on the same PR, and ask 
user if the user wants to fix the rest of the comments as well. if said yes, 
then fetch all the comments validate the correctness and implement a minimal fix
   ```
   </details>
   <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F42815&comment_hash=2c2a7fa151e31a250157910033856224dc65bacbac9f8cec1ddf974a89effc09&reaction=like'>👍</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F42815&comment_hash=2c2a7fa151e31a250157910033856224dc65bacbac9f8cec1ddf974a89effc09&reaction=dislike'>👎</a>



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