Repository navigation
fix(chat): truncate suggested prompt titles to prevent overflow in narrow chat (fixes #275257) - #345436
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Native title tooltips on the buttons and Autopilot label bypass workbench theming and the configured hover delay, leaving an unresolved consistency issue.
1 open issue
What changed in this PR
Addresses #275257 by keeping long suggested-prompt and handoff titles within their buttons when the chat panel is narrow.
Changes:
- Limits button width and enables ellipsis truncation for titles.
- Adds native tooltips to expose full handoff and Autopilot labels.
| File | Description |
|---|---|
src/vs/workbench/contrib/chat/browser/widget/media/chatViewWelcome.css |
Constrains button width and truncates overflowing titles. |
src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSuggestNextWidget.ts |
Adds full-label tooltips to handoff and Autopilot titles. |
Review effort: Balanced
|
|
||
| const titleElement = dom.append(button, dom.$('.chat-welcome-view-suggested-prompt-title')); | ||
| titleElement.textContent = handoff.label; | ||
| titleElement.title = handoff.label; |
There was a problem hiding this comment.
Updated to inject \IHoverService\ and register \setupDelayedHover\ with \HoverStyle.Pointer\ in \disposables\ for both handoff prompt buttons and the Autopilot button, removing the native DOM \ itle.
|
Hi Justin Chen (@justschen), gentle follow-up on this PR whenever convenient. All CI checks are green, and the suggested-prompt button overflow adjustments are ready for review. Happy to make any updates if needed. Thank you! |
Justin Chen (justschen)
left a comment
There was a problem hiding this comment.
this is fine, thanks!
keep in mind this is a widget that only appears in the local harness which is getting deprecated soon

Description
Fixes #275257.
Problem
When the chat panel is resized to a narrow width and suggested prompt / handoff titles are long, the text string overflows outside the button element boundary.
Root Cause
src/vs/workbench/contrib/chat/browser/widget/media/chatViewWelcome.css,.chat-welcome-view-suggested-prompt-titleusedwhite-space: nowrapwithoutoverflow: hidden,text-overflow: ellipsis, ormin-width: 0..chat-welcome-view-suggested-promptlacked amax-width: 100%constraint, causing the text to spill out past the button border on narrow viewports.Solution
chatViewWelcome.css:max-width: 100%to.chat-welcome-view-suggested-prompt.overflow: hidden,text-overflow: ellipsis, andmin-width: 0to.chat-welcome-view-suggested-prompt-title.chatSuggestNextWidget.ts:titleElement.titleto the label so users can hover to view the complete text when truncated.