From fb2080246f87ab423a0a15c7b72ad2cd9be986e2 Mon Sep 17 00:00:00 2001 From: dhaksdhakshin Date: Thu, 28 May 2026 18:09:51 +0530 Subject: [PATCH] fix(list-view-card): truncate long descriptions and surface full text via tooltip MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 #40460 --- .../src/components/ListViewCard/index.tsx | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/superset-frontend/packages/superset-ui-core/src/components/ListViewCard/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/ListViewCard/index.tsx index e9271d0de6a0..a99c59e9f23b 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/ListViewCard/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/ListViewCard/index.tsx @@ -48,6 +48,15 @@ const StyledCard = styled(Card)` transform: translateY(0); } } + + /* Truncate long descriptions (e.g. localized "Modified at" timestamps) + so they don't overflow the card. The full value remains accessible + via the tooltip wrapper applied around the description. */ + .ant-card-meta-description { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } `} `; @@ -258,7 +267,15 @@ function ListViewCard({ } - description={description} + description={ + description ? ( + + {description} + + ) : ( + description + ) + } avatar={avatar || null} /> )}