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


##########
superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/components/RadioButtonControl.tsx:
##########
@@ -17,7 +17,8 @@
  * under the License.
  */
 import { ReactNode } from 'react';
-import { JsonValue, t } from '@superset-ui/core';
+import { t } from '@apache-superset/core';

Review Comment:
   **Suggestion:** Importing the translation helper from the 
application-specific module instead of the shared UI core module couples this 
reusable chart-controls package to the app bundle and can cause runtime module 
resolution errors (or missing peer dependency issues) when 
`@superset-ui/chart-controls` is used outside the main Superset frontend; it 
should continue to import `t` from the shared `@superset-ui/core` package 
instead. [possible bug]
   
   **Severity Level:** Critical 🚨
   ```suggestion
   import { t } from '@superset-ui/core';
   ```
   <details>
   <summary><b>Why it matters? ⭐ </b></summary>
   
   The PR's final file imports t from '@apache-superset/core', which is an 
application-specific package.
   This chart-controls package is intended to be a reusable library; depending 
on the app package will
   couple the library to the superset frontend build and can cause 
resolution/peer-dependency issues for
   external consumers. Importing t from '@superset-ui/core' (the shared UI 
core) is the correct choice
   for a reusable package and fixes a real packaging/runtime coupling problem 
rather than being merely
   cosmetic.
   </details>
   <details>
   <summary><b>Prompt for AI Agent 🤖 </b></summary>
   
   ```mdx
   This is a comment left during a code review.
   
   **Path:** 
superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/components/RadioButtonControl.tsx
   **Line:** 20:20
   **Comment:**
        *Possible Bug: Importing the translation helper from the 
application-specific module instead of the shared UI core module couples this 
reusable chart-controls package to the app bundle and can cause runtime module 
resolution errors (or missing peer dependency issues) when 
`@superset-ui/chart-controls` is used outside the main Superset frontend; it 
should continue to import `t` from the shared `@superset-ui/core` package 
instead.
   
   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.
   ```
   </details>



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