fix(list-view-card): truncate long descriptions and surface full text…#40500
fix(list-view-card): truncate long descriptions and surface full text…#40500crimsondhaks wants to merge 1 commit into
Conversation
… via tooltip Long localized strings such as 'Geändert vor ungefähr einer Stunde und siebenundzwanzig Minuten' wrap onto multiple lines or get clipped on dashboard/chart/saved-query/tag list cards because the description prop is passed straight through to AntD's Card.Meta with no overflow handling, while the title and titleRight elements in the same component already have ellipsis + tooltip patterns. Add overflow/ellipsis CSS for .ant-card-meta-description on the styled card and wrap the description in the existing Tooltip component so the full localized text remains accessible on hover. No prop signature changes. Fixes apache#40460
Code Review Agent Run #9f1850Actionable 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 |
|
Thanks for this fix @crimsondhaks ! Please see this expectations checklist for new contributors: https://github.com/apache/superset/wiki/New-Contributor-Welcome-&-Expectations In particular, could you include before/after screenshots and add some human-written text to your PR description? Currently it seems like it was written completely by AI. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #40500 +/- ##
==========================================
- Coverage 64.17% 64.17% -0.01%
==========================================
Files 2592 2592
Lines 139299 139301 +2
Branches 32347 32349 +2
==========================================
+ Hits 89395 89396 +1
- Misses 48367 48368 +1
Partials 1537 1537
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
"Modified at" strings are pretty important, to a lot of users. You mention they get wrapped or cut off, but which is it? If they wrap, I'm OK with that. If they're cut off, I'd like to see them wrap. Truncating may be cleaner looking, but I'm a bit worried about losing critical info that verifies the freshness/truth of the data displayed. If the card needs to be redesigned a bit (cc @kasiazjc) I'm even open to that. It'd be good to see the before/after images in the product, if it's possible to do so. I'll spin up an ephemeral test env here so you can do so if you're willing. |
|
🎪 Showtime deployed environment on GHA for fb20802 • Environment: http://184.32.244.27:8080 (admin/admin) |
|
yeah "cut off" was my bad , it's actually clipped by the card, not wrapped. so it's truncate + tooltip (what i did, but no hover on touch) vs just letting it wrap (always shows full text, costs a little height). since you're ok with wrapping and don't want the timestamp hidden, happy to switch to wrapping — white-space: normal + making sure the card gives it room instead of clipping. want me to go that way, or wait for @kasiazjc? |
hey @sfirke, sorry, redoing the description + adding screenshots. Done reading the wiki link.
what's broken (#40460)
long localized "Modified at" strings (e.g. german) wrap or get clipped on
ListViewCard. title already handles overflow with ellipsis + tooltip, description doesn't.fix
one file:
superset-frontend/packages/superset-ui-core/src/components/ListViewCard/index.tsxcss:
overflow hidden / ellipsis / nowrapon.ant-card-meta-descriptionwrapped description in the existing
Tooltipso hover shows full textno prop changes, consumers untouched.
tested in storybook
no full superset deployment on my side. ran
npm run storybookfromsuperset-frontend/, openedInteractive List View Card, set viewport toSmall mobile (P), pasted the german string from the issue intodescription.before — description wraps to 2 lines, in real cards with fixed height it gets clipped:
after + hover — single line with ellipsis, tooltip on hover shows the full string:
happy to verify in a real backend run if you'd prefer that. existing
ListViewCard.test.tsxstill passes.