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


##########
superset-frontend/src/components/GridTable/index.tsx:
##########
@@ -138,18 +139,20 @@ export function GridTable<RecordType extends object>({
     [columnReorderable, enableActions, sortable],
   );
 
-  const rowHeight = theme.sizeUnit * (size === GridSize.Middle ? 9 : 7);
+  const defaultRowHeight = theme.sizeUnit * (size === GridSize.Middle ? 9 : 7);
+  const rowHeight = themeOverrides?.rowHeight ?? defaultRowHeight;
+  const headerHeight = themeOverrides?.headerHeight ?? rowHeight;

Review Comment:
   **Suggestion:** Defaulting `headerHeight` to `rowHeight` forces a fixed 
header size even when no header override was requested, which changes baseline 
rendering and can clip headers when only font tokens are customized. Preserve 
AG Grid theme-driven header sizing by leaving header height undefined unless an 
explicit override is provided. [logic error]
   
   <details>
   <summary><b>Severity Level:</b> Major ⚠️</summary>
   
   ```mdx
   ⚠️ SQL Lab results grid headers may clip larger fonts.
   ⚠️ Explore data sample tables inherit forced header height.
   ⚠️ Theming flexibility reduced when adjusting header typography only.
   ```
   </details>
   <details>
   <summary><b>Steps of Reproduction ✅ </b></summary>
   
   ```mdx
   1. Create a custom Superset theme that sets only `resultsGridHeaderFontSize` 
(e.g. 18) and
   optionally `resultsGridHeaderFontWeight`, leaving `resultsGridRowHeight` and
   `resultsGridBorderRadius` unset; these tokens are defined in 
`SupersetSpecificTokens` in
   `superset-frontend/packages/superset-core/src/theme/types.ts:245-249`.
   
   2. Load SQL Lab, run any query to produce results, and observe that 
`ResultSet` in
   `superset-frontend/src/SqlLab/components/ResultSet/index.tsx:218-223` calls
   `buildResultsGridThemeOverrides(theme)`, which returns an overrides object 
containing only
   `headerFontSize`/`headerFontWeight` (lines 27-32 in 
`buildResultsGridThemeOverrides.ts`),
   with no `rowHeight` or `headerHeight` keys.
   
   3. `ResultSet` passes these theme overrides into `FilterableTable` via 
`tableProps` at
   `superset-frontend/src/SqlLab/components/ResultSet/index.tsx:713-720`, which 
in turn
   forwards `themeOverrides` to `GridTable` in
   `superset-frontend/src/components/FilterableTable/index.tsx:64-77`.
   
   4. Inside `GridTable` in 
`superset-frontend/src/components/GridTable/index.tsx:142-155`,
   `rowHeight` is computed as `themeOverrides?.rowHeight ?? defaultRowHeight`, 
but
   `headerHeight` is unconditionally derived as `themeOverrides?.headerHeight 
?? rowHeight`
   (line 144), so even when no header override was requested, the component 
always sets a
   fixed `headerHeight` equal to the row height in `gridOptions` (lines 
146-154) and passes
   it to `ThemedAgGridReact` (lines 196-207); this overrides AG Grid’s default 
header sizing
   and, combined with larger header fonts and `.ag-header-cell { overflow: 
hidden; }` (lines
   169-171), can cause header text clipping instead of allowing theme-driven 
header height.
   ```
   </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=869ca4db39dd4f0bb28aa071a3bc455c&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=869ca4db39dd4f0bb28aa071a3bc455c&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/components/GridTable/index.tsx
   **Line:** 144:144
   **Comment:**
        *Logic Error: Defaulting `headerHeight` to `rowHeight` forces a fixed 
header size even when no header override was requested, which changes baseline 
rendering and can clip headers when only font tokens are customized. Preserve 
AG Grid theme-driven header sizing by leaving header height undefined unless an 
explicit override is provided.
   
   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%2F41031&comment_hash=1f8efe02d04fa98216dad644292ae40a522f979126c5b6f0f22018297483db8e&reaction=like'>👍</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F41031&comment_hash=1f8efe02d04fa98216dad644292ae40a522f979126c5b6f0f22018297483db8e&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