Skip to content

🤖 feat: tooltip with full workspace name on truncated sidebar titles#3378

Open
Neppkun wants to merge 1 commit into
coder:mainfrom
Neppkun:workspace_name_tooltip
Open

🤖 feat: tooltip with full workspace name on truncated sidebar titles#3378
Neppkun wants to merge 1 commit into
coder:mainfrom
Neppkun:workspace_name_tooltip

Conversation

@Neppkun
Copy link
Copy Markdown

@Neppkun Neppkun commented May 24, 2026

Summary

Show a tooltip with the full workspace name when hovering a sidebar row whose title is clipped by the existing truncate utility. Today the only ways to read a clipped name are to expand the sidebar or click the row; this restores quick scanability when the sidebar is resized narrow.

demo

Background

AgentListItem renders the workspace title in a <span> with Tailwind's truncate (overflow: hidden; text-overflow: ellipsis; white-space: nowrap). Inside a narrow min-w-0 grid column, long titles collapse to ellipses with no native title attribute fallback, so users have to widen the sidebar or click the row to see the full name.

Implementation

Single-file change in src/browser/components/AgentListItem/AgentListItem.tsx:

  • Wrap the title <span> in TooltipIfPresent (the same helper used for truncated labels in FileTree). TooltipProvider is already mounted globally in App.tsx, so no extra wiring is required.
  • Detect actual overflow with a callback ref + ResizeObserver on the span: scrollWidth > clientWidth drives an isTitleTruncated flag. The tooltip is only attached while overflow is present; non-truncated rows have no trigger at all.
  • Pass displayTitle (not workspaceTitle) so variants/best-of-n group labels appear as A · fix login, matching the row's existing aria-labels.
  • Tooltip is anchored to the title span only — hovering the group-label badge, status icons, terminal-count badge, or row padding does not show this tooltip. The pre-existing terminal-count tooltip on the same row is untouched.
  • Tooltip rendered with side="right" so it floats into the main content area instead of covering neighboring sidebar rows.

Validation

  • make typecheck — clean.
  • bunx eslint on the touched file — clean.
  • Manual: resized the left sidebar to the minimum width with long workspace titles and confirmed the tooltip appears only when the name is clipped, only over the title text, and tracks overflow live as the sidebar is resized (via ResizeObserver).

Risks

Low. Presentational, additive wrap around an existing element; no state-management changes. The trigger is fully unmounted when isTitleTruncated is false, so the common case (fitting titles) is byte-identical to before. The ResizeObserver is per-row and only observes the title span, matching the lifetime of the row itself.


Generated with mux • Model: anthropic:claude-opus-4-7 • Thinking: high • Cost: $2.13

Wrap the workspace title span in AgentListItem with TooltipIfPresent so
hovering a row reveals the full name when the title is clipped by the
existing 'truncate' utility. A ResizeObserver tracks scrollWidth vs
clientWidth on the span and only attaches the tooltip while overflow is
present, so non-truncated rows stay tooltip-free. The trigger lives on
the title element only, leaving the rest of the row (group label,
badges, terminal-count tooltip) untouched.

Uses displayTitle so variants/best-of-n group labels (e.g. 'A · …') are
included, matching the row's aria-labels.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant