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


##########
superset-frontend/src/features/home/LanguagePicker.tsx:
##########
@@ -16,12 +16,14 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-import { useMemo } from 'react';
+import { useEffect, useMemo } from 'react';
 import { MenuItem } from '@superset-ui/core/components/Menu';
 import { t } from '@apache-superset/core/translation';
 import { styled } from '@apache-superset/core/theme';
 import { Icons } from '@superset-ui/core/components/Icons';
 import { Typography } from '@superset-ui/core/components/Typography';
+import { DirectionType } from 'antd/es/config-provider';

Review Comment:
   **Suggestion:** Replace the direct `antd` type import with an approved type 
source from `@superset-ui/core` (or an existing project wrapper type) so 
frontend UI code does not depend on `antd` directly. [custom_rule]
   
   **Severity Level:** Minor ⚠️
   <details>
   <summary><b>Why it matters? 🤔 </b></summary>
   
   The final file state contains a direct import from 
`antd/es/config-provider`, which violates the rule against direct Ant Design 
imports in frontend UI code. The suggestion correctly identifies this as a real 
rule violation and recommends using an approved Superset abstraction or wrapper 
instead.
   </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=703186caa889486f86e478dfc27225ee&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=703186caa889486f86e478dfc27225ee&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/src/features/home/LanguagePicker.tsx
   **Line:** 25:25
   **Comment:**
        *Custom Rule: Replace the direct `antd` type import with an approved 
type source from `@superset-ui/core` (or an existing project wrapper type) so 
frontend UI code does not depend on `antd` directly.
   
   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%2F34629&comment_hash=80d7dad636c189d688ef483419d618bcca926fa0c499ee57691fb66b26bce11d&reaction=like'>👍</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F34629&comment_hash=80d7dad636c189d688ef483419d618bcca926fa0c499ee57691fb66b26bce11d&reaction=dislike'>👎</a>



##########
superset-frontend/src/features/home/LanguagePicker.test.tsx:
##########
@@ -18,6 +18,7 @@
  */
 import { render, screen, userEvent } from 'spec/helpers/testing-library';
 import { Menu } from '@superset-ui/core/components/Menu';
+import type { DirectionType } from 'antd/es/config-provider';

Review Comment:
   **Suggestion:** Remove the direct `antd` type import and use a 
Superset-owned type (for example `TextDirection` from locale utilities) or a 
local `'ltr' | 'rtl'` union for `setDirection` so the test does not depend on 
Ant Design internals. [custom_rule]
   
   **Severity Level:** Minor ⚠️
   <details>
   <summary><b>Why it matters? 🤔 </b></summary>
   
   The test file directly imports a type from `antd/es/config-provider`, which 
is exactly the kind of direct Ant Design import the rule forbids in frontend UI 
code. A Superset-owned type or a local union should be used instead.
   </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=cf5c9bfef3b746e88405122022359f9e&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=cf5c9bfef3b746e88405122022359f9e&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/src/features/home/LanguagePicker.test.tsx
   **Line:** 21:21
   **Comment:**
        *Custom Rule: Remove the direct `antd` type import and use a 
Superset-owned type (for example `TextDirection` from locale utilities) or a 
local `'ltr' | 'rtl'` union for `setDirection` so the test does not depend on 
Ant Design internals.
   
   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%2F34629&comment_hash=9dc75735ff4eff41a270c0f86f60a408ad08d8d601a6e8b9047c02865439735f&reaction=like'>👍</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F34629&comment_hash=9dc75735ff4eff41a270c0f86f60a408ad08d8d601a6e8b9047c02865439735f&reaction=dislike'>👎</a>



##########
superset-frontend/src/features/home/LanguagePicker.stories.tsx:
##########
@@ -17,18 +17,25 @@
  * under the License.
  */
 import { Menu } from '@superset-ui/core/components/Menu';
+import type { DirectionType } from 'antd/es/config-provider';

Review Comment:
   **Suggestion:** Replace the direct `antd` type import with an 
internal/shared type (for example a local `'ltr' | 'rtl'` union or a type 
re-exported from approved Superset UI modules) so this story does not import 
from `antd` directly. [custom_rule]
   
   **Severity Level:** Minor ⚠️
   <details>
   <summary><b>Why it matters? 🤔 </b></summary>
   
   This file is frontend UI code, and it directly imports a type from 
`antd/es/config-provider`. The rule explicitly flags direct Ant Design imports 
in frontend UI code, so this is a real violation.
   </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=f522f0a2e533467b903d62e087a7a6c0&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=f522f0a2e533467b903d62e087a7a6c0&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/src/features/home/LanguagePicker.stories.tsx
   **Line:** 20:20
   **Comment:**
        *Custom Rule: Replace the direct `antd` type import with an 
internal/shared type (for example a local `'ltr' | 'rtl'` union or a type 
re-exported from approved Superset UI modules) so this story does not import 
from `antd` directly.
   
   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%2F34629&comment_hash=61bad6ce454b4c89bba425027d691355f3316ca05bb316413c18685ba40765e6&reaction=like'>👍</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F34629&comment_hash=61bad6ce454b4c89bba425027d691355f3316ca05bb316413c18685ba40765e6&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