Skip to content

Commit b436a90

Browse files
authored
fix(index card explain plan): long index names COMPASS-7016 (#5881)
1 parent 9cdd3c1 commit b436a90

File tree

1 file changed

+23
-6
lines changed

1 file changed

+23
-6
lines changed

packages/compass-explain-plan/src/components/explain-tree/explain-tree-stage.tsx

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,12 @@ const shardViewTextStyles = css({
211211
whiteSpace: 'nowrap',
212212
});
213213

214+
const overflowTextStyles = css({
215+
overflow: 'hidden',
216+
textOverflow: 'ellipsis',
217+
whiteSpace: 'nowrap',
218+
});
219+
214220
const StatsBadge: React.FunctionComponent<{
215221
stats: number | string;
216222
}> = ({ stats }) => {
@@ -237,18 +243,29 @@ const ShardView: React.FunctionComponent<ShardViewProps> = (props) => {
237243
);
238244
};
239245

246+
const Highlight: React.FunctionComponent<{
247+
value: string;
248+
field: string;
249+
}> = ({ field, value }) => {
250+
return (
251+
<li className={overflowTextStyles}>
252+
<span>{field}: </span>
253+
<strong title={value}>{value}</strong>
254+
</li>
255+
);
256+
};
257+
240258
const Highlights: React.FunctionComponent<{
241259
highlights: Record<string, boolean | string>;
242260
}> = ({ highlights }) => {
243261
return (
244262
<ul>
245263
{Object.entries(highlights).map(([key, value], index) => (
246-
<li key={index}>
247-
<span>{key}: </span>
248-
<strong>
249-
{typeof value === 'boolean' ? (value ? 'yes' : 'no') : value}
250-
</strong>
251-
</li>
264+
<Highlight
265+
key={index}
266+
field={key}
267+
value={typeof value === 'boolean' ? (value ? 'yes' : 'no') : value}
268+
/>
252269
))}
253270
</ul>
254271
);

0 commit comments

Comments
 (0)