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


##########
superset-frontend/packages/superset-core/src/theme/types.ts:
##########
@@ -268,6 +268,11 @@ export interface SupersetSpecificTokens {
   resultsGridHeaderFontSize?: number;
   resultsGridBorderRadius?: number;
   resultsGridNoStriping?: boolean;
+  // Login page customization
+  loginPageBackgroundImageUrl?: string;
+  loginFormBrandLogoUrl?: string;
+  loginPageBackgroundOverlayColor?: string;
+  loginPageBackgroundBlur?: string;

Review Comment:
   **Suggestion:** These new theme tokens were added to type definitions, but 
the theme token validation allowlist was not updated, so they are treated as 
unknown in theme validation and flagged as “may be ignored.” This creates a 
broken integration where officially documented tokens trigger warnings in the 
theme editor; add these keys to the custom token registry used by validation. 
[incomplete implementation]
   
   <details>
   <summary><b>Severity Level:</b> Major ⚠️</summary>
   
   ```mdx
   ⚠️ Theme editor warns valid login branding tokens.
   ⚠️ Documented login tokens reported as unknown in UI.
   ```
   </details>
   <details>
   <summary><b>Steps of Reproduction ✅ </b></summary>
   
   ```mdx
   1. Open the Themes list page routed via `routes.tsx:163-165`, which 
lazy-loads `ThemeList`
   from `superset-frontend/src/pages/ThemeList/index.tsx`.
   
   2. From `ThemeList/index.tsx:22-32` create a new theme (Theme button) or 
edit an existing
   one (`handleThemeEdit` at 200-12), which opens `ThemeModal` (`ThemeModal` 
rendered at
   69-80).
   
   3. In `ThemeModal.tsx:160-163`, the current theme JSON is passed to 
`useThemeValidation`
   from `src/theme/hooks/useThemeValidation.ts`, which calls `validateTheme`
   (`useThemeValidation.ts:113-116`).
   
   4. `validateTheme` in `themeStructureValidation.ts:17-23` iterates over 
`config.token` and
   calls `isValidTokenName` for each key; because `loginPageBackgroundImageUrl`,
   `loginFormBrandLogoUrl`, `loginPageBackgroundOverlayColor`, and 
`loginPageBackgroundBlur`
   are missing from `SUPERSET_CUSTOM_TOKENS` in 
`src/theme/utils/antdTokenNames.ts:6-91`,
   `isValidTokenName` returns false, and `validateTheme` pushes a warning 
`Unknown token '…'
   - may be ignored by Ant Design` (`themeStructureValidation.ts:18-23`), which
   `useThemeValidation` converts into warning annotations 
(`useThemeValidation.ts:129-137`)
   shown in the editor even though these tokens are documented and used by
   `SupersetSpecificTokens` (`types.ts:112-36`) and the login page
   (`src/pages/Login/index.tsx:83-88).
   ```
   </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=b878aee86ba04513a2c44ea3107df753&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=b878aee86ba04513a2c44ea3107df753&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/types.ts
   **Line:** 272:275
   **Comment:**
        *Incomplete Implementation: These new theme tokens were added to type 
definitions, but the theme token validation allowlist was not updated, so they 
are treated as unknown in theme validation and flagged as “may be ignored.” 
This creates a broken integration where officially documented tokens trigger 
warnings in the theme editor; add these keys to the custom token registry used 
by validation.
   
   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%2F34640&comment_hash=8511a49bdfb77df59118f2505e506592b1e6b7f98c34d550d73a8914f55b0c29&reaction=like'>👍</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F34640&comment_hash=8511a49bdfb77df59118f2505e506592b1e6b7f98c34d550d73a8914f55b0c29&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