Skip to content

Commit 36b86ed

Browse files
fix(web): give the profile badge a real ellipsis
`Badge` is an `inline-flex` with `whitespace-nowrap`, so `truncate` on the badge never reached the name inside it: a long profile name was hard-clipped at both ends with no ellipsis. The cap stays on the badge, the truncation moves to an inner span, and the full name is available as a title. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 59fca7f commit 36b86ed

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

apps/web/src/components/preview/PreviewView.tsx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -697,11 +697,15 @@ export function PreviewView({
697697
// "Default" would be noise on the common case, while a tab in
698698
// another profile is exactly what needs calling out.
699699
activeProfile && activeProfile.id !== browserDefaults.profileId ? (
700-
// Capped and truncated: profile names run to 48 characters, and an
701-
// unbounded badge in this row takes its width from the URL input,
702-
// the only flexible element in the compact chrome.
703-
<Badge variant="outline" className="max-w-28 shrink-0 truncate">
704-
{activeProfile.name}
700+
// Capped: profile names run to 48 characters, and an unbounded
701+
// badge in this row takes its width from the URL input, the only
702+
// flexible element in the compact chrome. The cap sits on the
703+
// badge and the truncation on an inner span, because `Badge` is an
704+
// `inline-flex` with `whitespace-nowrap` — `text-overflow` never
705+
// reaches a bare text node inside it, so the name would be cut off
706+
// at both ends with no ellipsis.
707+
<Badge variant="outline" className="max-w-28 shrink-0" title={activeProfile.name}>
708+
<span className="truncate">{activeProfile.name}</span>
705709
</Badge>
706710
) : null
707711
}

0 commit comments

Comments
 (0)