sadpandajoe opened a new pull request, #45487:
URL: https://github.com/apache/superset/pull/45487

   ### SUMMARY
   #41135 (`fix(sqllab): preserve whitespace in grid result cells`, ef4c6123b9) 
added `white-space: pre` to `.ag-cell-value` in `GridTable`. Its comment 
expected a value with an embedded newline to be "clipped by the fixed row 
height", but nothing applies that clip. Because `GridTable` sets 
`enableCellTextSelection: true`, ag-grid renders each cell as `.ag-cell > 
.ag-cell-wrapper > span.ag-cell-value`. The span grows to fit all of its lines, 
and ag-grid leaves `overflow` visible on both `.ag-cell` and 
`.ag-cell-wrapper`. A two-line value therefore draws its second line over the 
row below.
   
   This PR adds `overflow: hidden` on `.ag-cell`, the element that has the 
fixed row height. This is the same approach `GridTable` already uses for 
`.ag-header-cell`. A multi-line value now shows its first line and is cut off 
at the row edge, which is what #41135 intended. Long single-line values still 
end in an ellipsis. The comment is updated to describe where the clip happens. 
The same fix applies to Explore's Results/Samples panes, which also use 
`GridTable`.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   **Before:** the second line of each multi-line `notes` value is drawn over 
the row below.
   
   ![Before: multi-line values overlap the rows 
below](https://gist.githubusercontent.com/sadpandajoe/d0da8bc0c861a596c380c67be7580023/raw/before-sqllab-multiline.png)
   
   **After:** each value is clipped to its own row; the long single-line value 
(row 5) still ends in an ellipsis.
   
   ![After: multi-line values clipped to their 
row](https://gist.githubusercontent.com/sadpandajoe/d0da8bc0c861a596c380c67be7580023/raw/after-sqllab-multiline.png)
   
   ### TESTING INSTRUCTIONS
   1. In SQL Lab, run a query that returns values with embedded newlines, e.g. 
on SQLite:
      `SELECT 1 AS id, '(12/3/2020 9:16 AM)' || char(10) || 'emailed for 
payment' AS notes UNION ALL SELECT 2, 'single line' UNION ALL SELECT 3, 
'(1/16/2021 12:45 PM)' || char(10) || 'hold for BLDG'`
      (Postgres: use `E'...\n...'` literals.)
   2. In the results grid, each `notes` value shows only its first line inside 
its own row; no text is drawn over the row below.
   3. Run a query with a long single-line value and narrow the column: it still 
ends with an ellipsis.
   4. Check that the row-number column, cell focus border, and JSON cell modal 
still look and behave the same, and that Explore's Results/Samples panes render 
normally.
   
   ### ADDITIONAL INFORMATION
   - [x] Has associated issue: Fixes #45464
   - [ ] Required feature flags:
   - [x] Changes UI
   - [ ] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   
   **Notes**
   - The regression test asserts on the CSS GridTable emits (jsdom does no 
layout), so it will not catch a later override of the rule elsewhere in the 
cascade; the visual check is in the screenshots above.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


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