fix(desktop): clamp long session names in the sidebar hover card
Fixes #7706
What & why
Hovering a session with a long unbreakable name (underscores/camelCase, no spaces or hyphens) spilled the name past the hover card's fixed 288px (w-72) border, painting over surrounding UI.
One-line change in DashboardSidebarWorkspaceHoverCardContent.tsx:68, restoring parity with the legacy WorkspaceHoverCard.tsx:81 (classes dropped in the port):
<div className="text-sm font-medium break-words line-clamp-2" title={name}>
break-words wraps unbreakable tokens, line-clamp-2 bounds card height with ellipsis, title keeps the full name reachable. Shared PopoverContent deliberately untouched (would affect every popover). title is a plain attribute outside , so no translation entries change.
How I tested it
- New co-located DashboardSidebarWorkspaceHoverCardContent.test.tsx: renders with a 170-char unbroken name + different branch (so hasCustomAlias is true), asserts the name node carries break-words + line-clamp-2 and exposes the full name via title — 1 pass (run from apps/desktop/ for the Lingui-macro preload).
- biome check on the folder — clean. bun run check:i18n — no catalog diff.
- Manual hover check in the dev desktop app still to do: rename a session to averyveryverylongsessionnamewithoutanyspacesatall, hover its sidebar row, confirm the name clamps to two lines inside the card with ellipsis + tooltip.
Before
After
Checklist
- PR title follows conventional commits (
type(scope): subject) -
bun run lintandbun run typecheckpass (CI fails on lint warnings too) - "Allow edits from maintainers" is checked on fork PRs
Summary by cubic
Fixes long unbreakable session names overflowing the desktop sidebar hover card's fixed width and painting over surrounding UI. Names now wrap and clamp to two lines with an ellipsis, with the full name still reachable via the title tooltip.
- Adds a test covering an unbroken 170-char session name.
Summary by CodeRabbit
-
Bug Fixes
- Long workspace aliases now wrap across up to two lines instead of being restricted to a single line.
- Hovering over a truncated alias displays the full workspace name in a tooltip.
-
Tests
- Added coverage for wrapping, truncation, and tooltip behavior for long workspace aliases.