fix(metadata-bar): add max-width to text for proper ellipsis truncation#42237
fix(metadata-bar): add max-width to text for proper ellipsis truncation#42237prathamesh04 wants to merge 1 commit into
Conversation
When localized timestamps (e.g. German 'Geändert vor 3 Stunden und 42 Minuten') exceed the available horizontal space in the metadata bar, the text was being clipped without ellipsis because the text span lacked an explicit max-width constraint. Added max-width: TEXT_MAX_WIDTH (150px) to the .metadata-text span so text-overflow: ellipsis works reliably in the flex layout context. Closes apache#40460
Code Review Agent Run #db0b3aActionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
|
cc @michael-s-molina @geido @kgabryje — This is a small CSS fix for #40460. All existing MetadataBar tests pass. Would appreciate a review when you have a chance! |
✅ Deploy Preview for superset-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #42237 +/- ##
==========================================
- Coverage 65.13% 65.13% -0.01%
==========================================
Files 2753 2753
Lines 154584 154584
Branches 35463 35463
==========================================
- Hits 100695 100689 -6
- Misses 51975 51981 +6
Partials 1914 1914
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@prathamesh04 mind adding before and after screenshots to your PR description? |
|
@sadpandajoe I have added the before/after section in the PR description. |
|
Hi @michael-s-molina @geido @kgabryje — I've added the before/after screenshots as requested by @sadpandajoe. All existing MetadataBar tests pass. Could you take a look when you get a chance? Thanks! |
Summary
This PR fixes text overflow in the MetadataBar component where long localized timestamps (e.g. German
Geändert vor 3 Stunden und 42 Minuten) were being clipped without showing an ellipsis.Problem
The
.metadata-textspan in the MetadataBar component hadoverflow: hiddenandtext-overflow: ellipsisset, but lacked an explicitmax-widthconstraint. In a flex layout context,text-overflow: ellipsisrequires a definite width on the element itself to work reliably. Without it, the text was clipped by the parent max-width but the ellipsis was not applied.Fix
Added
max-width: 150pxto the.metadata-textspan. This gives the text element a definite width constraint, ensuringtext-overflow: ellipsisworks properly in the flex layout.After
Testing
All 21 existing MetadataBar tests pass. The fix is a single CSS property addition with no behavioral changes.
Closes #40460