Skip to content

fix(dashboard/chat): show full agent name on hover in chat sidebar#5188

Merged
houko merged 2 commits into
librefang:mainfrom
neo-wanderer:fix/chat-agent-name-tooltip
May 18, 2026
Merged

fix(dashboard/chat): show full agent name on hover in chat sidebar#5188
houko merged 2 commits into
librefang:mainfrom
neo-wanderer:fix/chat-agent-name-tooltip

Conversation

@neo-wanderer

@neo-wanderer neo-wanderer commented May 17, 2026

Copy link
Copy Markdown
Contributor

Problem

In the chat page sidebar (/dashboard/chat), the agent list has a
fixed width. When an agent's name is longer than the row, the name is
clipped with no way to see the full text — there was no title
tooltip, so a truncated name was effectively unreadable.

Fix

ChatPage.tsxrenderAgentButton:

  • Resolve the displayed name once into a displayName const (keeping
    the existing role ?? t(agents.builtin.<name>.name, …) i18n
    fallback) and reuse it for the avatar initial, the visible label,
    and a new native title attribute.
  • Add title={displayName} to the name <p> so hovering a truncated
    row reveals the full agent name.
  • Apply the same title treatment to the provider / coordinator
    sub-line (also truncated) for consistency.

The native title attribute is the dependency-free tooltip pattern
already used throughout ChatPage.tsx (12 existing title= usages);
no new component or library is introduced. Truncation itself already
used the truncate utility (single-line ellipsis), so this is purely
a discoverability fix — no layout, sizing, or sidebar redesign.

Verification

  • pnpm typecheck (tsc --noEmit) — clean
  • pnpm build (vite) — succeeds (only the pre-existing chunk-size
    advisory, unrelated to this change)
  • Pre-push hook (clippy + OpenAPI/SDK drift) — passed
  • Manually verified in a Vite dev session against a live API: long
    agent names show a single-line ellipsis and the full name appears
    as a native tooltip on hover.

Scope

One file, +20/-7. No Rust changes, no route/API changes, so no
integration test is applicable.

Testing notes — why no unit test was added

ChatPage currently has no colocated ChatPage.test.tsx (only
lib-level chat.test.ts / chatPicker.test.ts), unlike most pages in
this dashboard. Adding one solely for this change was judged
disproportionate:

  • The behaviour is a native title attribute on a truncated
    element. The actual user-visible symptom (visual clipping / hover
    tooltip rendering) is precisely what jsdom does not exercise —
    no layout, no overflow, no real hover — so a test would assert only
    that an attribute string equals the resolved name, restating the
    one-line change rather than guarding real behaviour.
  • ChatPage is a heavy component (WebSocket, router, and query-client
    providers). Standing up its first render harness in jsdom is
    significant setup cost for that single attribute assertion, and
    would expand the diff well beyond the bug's scope.
  • The name-resolution fallback (role ?? t(agents.builtin.<name>.name, …)) is unchanged by this PR — it is merely hoisted into one const
    and reused — so existing behaviour is not altered in a way new
    coverage would protect.

If maintainers prefer regression coverage, the lighter follow-up would
be to extract the name-resolution expression into a small pure helper
in src/lib and unit-test that in the existing style — happy to do
that in a separate PR if desired.

neo-wanderer and others added 2 commits May 17, 2026 08:48
Long agent names in the chat sidebar were clipped by the fixed-width
list with no way to see the full text. Add a native `title` tooltip
to the agent name (and provider / coordinator sub-line) so hovering a
truncated row reveals the full string. The name is now resolved once
into `displayName` and reused for the avatar initial, the visible
label, and the tooltip, keeping the i18n fallback consistent.

Truncation already used the `truncate` utility (single-line ellipsis);
no layout change — purely a discoverability fix.
@github-actions github-actions Bot added no-rust-required This task does not require Rust knowledge size/S 10-49 lines changed labels May 17, 2026

@houko houko left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. The fix correctly pairs the existing truncate utility on the agent name <p> with a new native title={displayName} attribute, so hover reveals the full name that the single-line ellipsis hides. Hoisting role ?? t(agents.builtin.${agent.name}.name, …) into a single displayName const and reusing it for the avatar initial, the visible label, and the tooltip removes the prior duplication without altering the i18n fallback semantics. Extending the same title treatment to the coordinator / model-provider sub-line keeps the two truncated rows consistent. The native title attribute matches the existing tooltip pattern used in ~12 places throughout ChatPage.tsx, so no new dependency or component is introduced and the sidebar layout is untouched. The decision to skip a colocated ChatPage.test.tsx is reasonable: jsdom does not exercise real overflow or hover, so a unit test would assert only that an attribute equals the resolved string and would not protect the user-visible behaviour, while standing up the first render harness for this heavy component (WebSocket / router / query-client providers) would expand the diff well beyond a one-attribute fix.

@houko
houko merged commit 51bd9a6 into librefang:main May 18, 2026
29 checks passed
@github-actions github-actions Bot added the ready-for-review PR is ready for maintainer review label May 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-rust-required This task does not require Rust knowledge ready-for-review PR is ready for maintainer review size/S 10-49 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants