Repository navigation
fix(web): keep agent name suffixes visible in pickers - #666
Conversation
There was a problem hiding this comment.
ℹ️ No critical issues — one minor suggestion inline.
Reviewed changes
MiddleTruncateshared component (new) —apps/web/src/components/shared/middle-truncate.tsx: splits a label into a CSS-truncated prefix and a width-reserved 8-grapheme suffix, exposing the full name via ansr-onlyspan and a nativetitletooltip.- Wired into three pickers — agent picker trigger/options (
agent-picker.tsx), member form dropdown (member-select.tsx), and assignee picker trigger/options (assignee-picker.tsx); stored IDs, search labels, and selection values are unchanged. - Tests + docs — unit and integration coverage for Unicode boundaries, accessible names, and selection, plus an
apps/web/README.mdnote.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
| title={text} | ||
| > | ||
| <span className="sr-only">{text}</span> | ||
| <span aria-hidden="true" className="min-w-0 truncate"> |
There was a problem hiding this comment.
Because the prefix and suffix are separate flex items, the prefix's trailing collapsible space sits at the end of its own line and is dropped by truncate (white-space: nowrap). Whenever the container is wide enough to show the prefix untruncated, a name whose split lands right after a space renders with the words joined, e.g. Backend Refactor Agent v2 → Backend RefactorAgent v2 (verified in headless Chromium). Multi-word member full names hit this in the w-64/w-56 option rows.
Technical details
# Trailing space lost at the prefix/suffix boundary
## Affected sites
- `apps/web/src/components/shared/middle-truncate.tsx:33` — the prefix `<span>` uses `truncate` (`white-space: nowrap`); its trailing collapsible whitespace is removed because it is the end of that flex item's line.
## Required outcome
- A space that falls exactly on the split boundary must stay visible, so multi-word names keep their original spacing.
## Suggested approach
- Use `overflow-hidden text-ellipsis whitespace-pre` instead of `truncate` on the prefix. Verified in headless Chromium: this preserves the trailing space (115.2px vs 111.3px for the `nowrap` variant) while still ellipsizing when the prefix overflows its box.| <span aria-hidden="true" className="min-w-0 truncate"> | |
| <span aria-hidden="true" className="min-w-0 overflow-hidden text-ellipsis whitespace-pre"> |
pikann
left a comment
There was a problem hiding this comment.
LGTM! Thank you for the contribution! 🚀

Summary
Fixes #323.
Agent names that share a long prefix, such as
backend-refactor-agent-v2andbackend-refactor-agent-v3, currently lose their distinguishing endings in constrained pickers. Middle-truncate names in the agent picker, member form dropdown, and assignee picker, keeping the ending visible when space is limited.The shared label reserves up to eight trailing graphemes and lets CSS elide the prefix only when necessary. The suffix also clips within the available width for very narrow containers. Full names remain available as accessible names and native hover tooltips; search labels, stored values, and selection IDs are unchanged. Unicode graphemes (including combining marks and ZWJ emoji) stay intact when splitting the label.
Type of Change
Validation
bun run test: 136 test files, 1,373 tests passed.bun run lint: passed; two existing unused-suppression warnings in unchangedtask-git-forms.tsx.bun run build: passed; existing large-chunk warning.Checklist
AI-assisted implementation; the checks above were run locally.