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


##########
superset-frontend/packages/superset-ui-core/src/components/ListViewCard/index.tsx:
##########
@@ -95,10 +95,12 @@ const TitleLink = styled.span`
 const TitleRight = styled.span`
   ${({ theme }) => css`
     position: absolute;
-    right: -1px;
     font-weight: 400;
     bottom: ${theme.sizeUnit * 3}px;
-    right: ${theme.sizeUnit * 2}px;
+    /* emit a physical fallback matching the theme direction for deterministic 
positioning */
+    ${theme.direction === 'rtl'
+      ? `left: ${theme.sizeUnit * 2}px;`
+      : `right: ${theme.sizeUnit * 2}px;`}

Review Comment:
   **Suggestion:** This manual `left`/`right` switch conflicts with the global 
RTL processing in the theme layer (`stylis-plugin-rtl`), which already flips 
physical directional properties in RTL mode. In RTL, emitting `left` here gets 
flipped back to `right`, so the element is pinned to the wrong side. Use a 
single LTR physical property and let the RTL plugin transform it. [logic error]
   
   <details>
   <summary><b>Severity Level:</b> Major ⚠️</summary>
   
   ```mdx
   - ⚠️ Dashboard `PublishedLabel` appears on wrong side in RTL.
   - ⚠️ RTL card header alignment becomes visually inconsistent.
   ```
   </details>
   
   ```suggestion
       right: ${theme.sizeUnit * 2}px;
   ```
   <details>
   <summary><b>Steps of Reproduction ✅ </b></summary>
   
   ```mdx
   1. Open Superset with theme context enabled via `RootContextProviders`
   (`superset-frontend/src/views/RootContextProviders.tsx:43-68`) so all styled 
components
   use the active Emotion cache.
   
   2. Enable/select an RTL language from header menu (`RightMenu` includes 
language picker at
   `superset-frontend/src/features/home/RightMenu.tsx:76-77`; language 
selection sets
   direction in `useLanguageMenuItems` at
   `superset-frontend/src/features/home/LanguagePicker.tsx:63-67`).
   
   3. This calls `setDirection` through `ThemeProvider`
   (`superset-frontend/src/theme/ThemeProvider.tsx:75-77`) into
   `ThemeController.setDirection` 
(`superset-frontend/src/theme/ThemeController.ts:38-42`),
   which activates RTL cache using `stylis-plugin-rtl`
   (`superset-frontend/packages/superset-core/src/theme/Theme.tsx:100-103,226`).
   
   4. Visit a page rendering dashboard cards (e.g., home/dashboard list): 
`DashboardCard`
   passes `titleRight` 
(`superset-frontend/src/features/dashboards/DashboardCard.tsx:166`)
   into `ListViewCard`, where `TitleRight` emits `left` in RTL
   
(`superset-frontend/packages/superset-ui-core/src/components/ListViewCard/index.tsx:101-103`);
   RTL stylis flips it, so the badge is positioned on the opposite side.
   ```
   </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-core/src/components/ListViewCard/index.tsx
   **Line:** 101:103
   **Comment:**
        *Logic Error: This manual `left`/`right` switch conflicts with the 
global RTL processing in the theme layer (`stylis-plugin-rtl`), which already 
flips physical directional properties in RTL mode. In RTL, emitting `left` here 
gets flipped back to `right`, so the element is pinned to the wrong side. Use a 
single LTR physical property and let the RTL plugin transform it.
   
   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>
   <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F34629&comment_hash=61afda7dc869d523b1aa171df25890230eef90e58450d65902fcee83cd557a1d&reaction=like'>👍</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F34629&comment_hash=61afda7dc869d523b1aa171df25890230eef90e58450d65902fcee83cd557a1d&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