Skip to content

An open source design system that's fully customizable and agent ready

TypeScript

fix(sandbox): truncate title and subtitle to single line in Table Overview (#357)

rubyycheung328d824fe6c7
diff --git a/apps/sandbox/src/app/pages/table-overview/page.tsx b/apps/sandbox/src/app/pages/table-overview/page.tsx
index ee6fb01100..93ffdf9601 100644
--- a/apps/sandbox/src/app/pages/table-overview/page.tsx
+++ b/apps/sandbox/src/app/pages/table-overview/page.tsx
@@ -238,12 +238,16 @@ const columns: XDSTableColumn<ReviewRow>[] = [
name={item.authorName}
size="small"
/>
- <XDSVStack gap="space1">
- <span {...stylex.props(styles.titleLink)}>{item.title}</span>
- <XDSText type="supporting" color="secondary">
- {item.diffId} · {item.lines} lines {item.reviewTime}
- </XDSText>
- </XDSVStack>
+ <div {...stylex.props(styles.authorInfo)}>
+ <XDSVStack gap="space1">
+ <span {...stylex.props(styles.titleLink)}>{item.title}</span>
+ <span {...stylex.props(styles.supportingLine)}>
+ <XDSText type="supporting" color="secondary">
+ {item.diffId} · {item.lines} lines {item.reviewTime}
+ </XDSText>
+ </span>
+ </XDSVStack>
+ </div>
</XDSHStack>
),
},
@@ -331,6 +335,18 @@ const styles = stylex.create({
fontWeight: 600,
fontSize: '0.875rem',
cursor: 'pointer',
+ overflow: 'hidden',
+ textOverflow: 'ellipsis',
+ whiteSpace: 'nowrap',
+ },
+ authorInfo: {
+ overflow: 'hidden',
+ minWidth: 0,
+ },
+ supportingLine: {
+ overflow: 'hidden',
+ textOverflow: 'ellipsis',
+ whiteSpace: 'nowrap',
},
avatarGroup: {
display: 'flex',