Skip to content

Commit dd7987f

Browse files
committed
ellipsis if the connection name gets too long
1 parent 66aa8cc commit dd7987f

File tree

1 file changed

+8
-1
lines changed
  • packages/compass-components/src/components/workspace-tabs

1 file changed

+8
-1
lines changed

packages/compass-components/src/components/workspace-tabs/tab.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,13 @@ const closeButtonStyles = css({
180180
marginRight: spacing[100],
181181
});
182182

183+
const workspaceTabTooltipStyles = css({
184+
whiteSpace: 'nowrap',
185+
overflow: 'hidden',
186+
textOverflow: 'ellipsis',
187+
width: '100%',
188+
});
189+
183190
type TabProps = {
184191
connectionName?: string;
185192
type: string;
@@ -326,7 +333,7 @@ function Tab({
326333
{tooltip && (
327334
<div data-testid="workspace-tab-tooltip">
328335
{tooltip.map(([label, value]) => (
329-
<div key={label}>
336+
<div key={label} className={workspaceTabTooltipStyles}>
330337
<b>{label}:</b> {value}
331338
</div>
332339
))}

0 commit comments

Comments
 (0)