bito-code-review[bot] commented on code in PR #41007:
URL: https://github.com/apache/superset/pull/41007#discussion_r3532521156


##########
superset-frontend/src/theme/ThemeController.ts:
##########
@@ -696,9 +702,21 @@ export class ThemeController {
       hasValidDefault && !this.isEmptyTheme(defaultTheme);
     const hasCustomDark = hasValidDark && !this.isEmptyTheme(darkTheme);
 
+    const modeMap: Record<string, ThemeMode> = {
+      light: ThemeMode.DEFAULT,

Review Comment:
   <div>
   
   
   <div id="suggestion">
   <div id="issue"><b>CWE-εΊ“ι‡Œ: Bootstrap Config Lookup Broken</b></div>
   <div id="fix">
   
   Changing the modeMap key from `'default'` to `'light'` breaks the lookup for 
`defaultMode: 'default'`. Users with `defaultMode: 'default'` in bootstrap 
config will fall through to the fallback `ThemeMode.SYSTEM` instead of getting 
light theme. The embedded SDK README documents `'light'` as valid, but the 
existing codebase (including ThemeMode enum: `DEFAULT = 'default'`) uses 
`'default'` as the string value. This change creates a semantic gap: bootstrap 
config accepts `'default'` but the map doesn't handle it. Additionally, no test 
case exists for `defaultMode: 'default'` β€” the test suite covers `'light'`, 
`'dark'`, `'system'`, and invalid values, but not the `'default'` key.
   </div>
   
   
   </div>
   
   
   
   
   <small><i>Code Review Run #be71f3</i></small>
   </div>
   
   ---
   Should Bito avoid suggestions like this for future reviews? (<a 
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
   - [ ] Yes, avoid them



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