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


##########
superset-frontend/src/features/queries/QueryPreviewModal.tsx:
##########
@@ -44,7 +44,7 @@ const QueryViewToggle = styled.div`
   display: flex;
 `;
 
-const TabButton = styled.div`
+const TabButton = styled.button`

Review Comment:
   **Suggestion:** `TabButton` was switched to a native `button` element but 
its styles do not reset the browser's default button chrome (`border`, default 
background/appearance). This will cause visible style regressions (unexpected 
borders/background and spacing) compared with the previous inline tab toggle 
appearance. Add explicit button resets (for example transparent background, no 
border, inherited font/color, and consistent cursor) so the toggle keeps the 
intended layout. [css layout issue]
   
   <details>
   <summary><b>Severity Level:</b> Major ⚠️</summary>
   
   ```mdx
   - ❌ Query preview tab buttons show unexpected borders/background.
   - ⚠️ Query History preview modal appears visually inconsistent.
   ```
   </details>
   <details>
   <summary><b>Steps of Reproduction ✅ </b></summary>
   
   ```mdx
   1. Open the Query History list page, which renders the `QueryList` component 
in
   `superset-frontend/src/pages/QueryHistoryList/index.tsx:480-519`; note that
   `queryCurrentlyPreviewing` controls rendering of `<QueryPreviewModal>` at
   `index.tsx:491-498`.
   
   2. In the Query History table, click the SQL snippet cell for any row, 
rendered by the
   `Cell` component at 
`superset-frontend/src/pages/QueryHistoryList/index.tsx:360-389`,
   where the `<div data-test="open-sql-preview-\${id}">` calls
   `setQueryCurrentlyPreviewing(original)` on click, causing 
`QueryPreviewModal` to open.
   
   3. In the modal, inspect the "User query" and "Executed query" tab toggles 
rendered via
   `<TabButton>` in 
`superset-frontend/src/features/queries/QueryPreviewModal.tsx:146-165`;
   `TabButton` is defined as `styled.button` at lines `47-63` without `border: 
none`,
   `background: transparent`, or a reset like `all: unset`, so the browser's 
default button
   border/background are applied, producing visible chrome and spacing 
different from the
   previous `div`-based tabs.
   
   4. Compare with other styled buttons intended to be visually unstyled, e.g. 
`SelectorLabel
   = styled.button` in
   
`superset-frontend/src/explore/components/controls/VizTypeControl/VizTypeGallery.tsx:155-184`,
   which uses `all: unset` and explicit layout styles; the absence of similar 
resets on
   `TabButton` confirms a UI regression and inconsistent tab appearance in the 
Query Preview
   modal.
   ```
   </details>
   
   [Fix in 
Cursor](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt=This%20is%20a%20comment%20left%20during%20a%20code%20review.%0A%0A%2A%2APath%3A%2A%2A%20superset-frontend%2Fsrc%2Ffeatures%2Fqueries%2FQueryPreviewModal.tsx%0A%2A%2ALine%3A%2A%2A%2047%3A63%0A%2A%2AComment%3A%2A%2A%0A%09%2ACss%20Layout%20Issue%3A%20%60TabButton%60%20was%20switched%20to%20a%20native%20%60button%60%20element%20but%20its%20styles%20do%20not%20reset%20the%20browser%27s%20default%20button%20chrome%20%28%60border%60%2C%20default%20background%2Fappearance%29.%20This%20will%20cause%20visible%20style%20regressions%20%28unexpected%20borders%2Fbackground%20and%20spacing%29%20compared%20with%20the%20previous%20inline%20tab%20toggle%20appearance.%20Add%20explicit%20button%20resets%20%28for%20example%20transparent%20background%2C%20no%20border%2C%20inherited%20font%2Fcolor%2C%20and%20consistent%20cursor%29%20so%20the%20toggle%20keeps%20the%20intended%20layout.%0A%0AValidate%20the%20correctness%20of%20the%20flag
 
ged%20issue.%20If%20correct%2C%20How%20can%20I%20resolve%20this%3F%20If%20you%20propose%20a%20fix%2C%20implement%20it%20and%20please%20make%20it%20concise.%0AOnce%20fix%20is%20implemented%2C%20also%20check%20other%20comments%20on%20the%20same%20PR%2C%20and%20ask%20user%20if%20the%20user%20wants%20to%20fix%20the%20rest%20of%20the%20comments%20as%20well.%20if%20said%20yes%2C%20then%20fetch%20all%20the%20comments%20validate%20the%20correctness%20and%20implement%20a%20minimal%20fix%0A)
 | [Fix in VSCode 
Claude](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt=This%20is%20a%20comment%20left%20during%20a%20code%20review.%0A%0A%2A%2APath%3A%2A%2A%20superset-frontend%2Fsrc%2Ffeatures%2Fqueries%2FQueryPreviewModal.tsx%0A%2A%2ALine%3A%2A%2A%2047%3A63%0A%2A%2AComment%3A%2A%2A%0A%09%2ACss%20Layout%20Issue%3A%20%60TabButton%60%20was%20switched%20to%20a%20native%20%60button%60%20element%20but%20its%20styles%20do%20not%20reset%20the%20browser%27s%20default%20button%20chrome%20%28%60borde
 
r%60%2C%20default%20background%2Fappearance%29.%20This%20will%20cause%20visible%20style%20regressions%20%28unexpected%20borders%2Fbackground%20and%20spacing%29%20compared%20with%20the%20previous%20inline%20tab%20toggle%20appearance.%20Add%20explicit%20button%20resets%20%28for%20example%20transparent%20background%2C%20no%20border%2C%20inherited%20font%2Fcolor%2C%20and%20consistent%20cursor%29%20so%20the%20toggle%20keeps%20the%20intended%20layout.%0A%0AValidate%20the%20correctness%20of%20the%20flagged%20issue.%20If%20correct%2C%20How%20can%20I%20resolve%20this%3F%20If%20you%20propose%20a%20fix%2C%20implement%20it%20and%20please%20make%20it%20concise.%0AOnce%20fix%20is%20implemented%2C%20also%20check%20other%20comments%20on%20the%20same%20PR%2C%20and%20ask%20user%20if%20the%20user%20wants%20to%20fix%20the%20rest%20of%20the%20comments%20as%20well.%20if%20said%20yes%2C%20then%20fetch%20all%20the%20comments%20validate%20the%20correctness%20and%20implement%20a%20minimal%20fix%0A)
   
   *(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/queries/QueryPreviewModal.tsx
   **Line:** 47:63
   **Comment:**
        *Css Layout Issue: `TabButton` was switched to a native `button` 
element but its styles do not reset the browser's default button chrome 
(`border`, default background/appearance). This will cause visible style 
regressions (unexpected borders/background and spacing) compared with the 
previous inline tab toggle appearance. Add explicit button resets (for example 
transparent background, no border, inherited font/color, and consistent cursor) 
so the toggle keeps the intended layout.
   
   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%2F40062&comment_hash=243298af664fdb87de08c753ef0945007ed2683a5c3abbff574a37f0730dacc1&reaction=like'>👍</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F40062&comment_hash=243298af664fdb87de08c753ef0945007ed2683a5c3abbff574a37f0730dacc1&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