-
Notifications
You must be signed in to change notification settings - Fork 36.8k
Fix chat prompt pills expanding to 100% width in suggested actions #269395
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: digitarald <[email protected]>
Co-authored-by: digitarald <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes prompt pills in the chat welcome view's "Suggested Actions" section that were incorrectly expanding to 100% width instead of maintaining their natural fit-content width. The fix addresses CSS flexbox issues related to spacing, flex expansion, and container constraints.
Key Changes:
- Updated CSS flexbox properties to prevent pill expansion and ensure proper spacing
- Added adaptive compression system for responsive welcome view layout
- Improved spacing consistency using modern CSS
gapproperty
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
src/vs/workbench/contrib/chat/browser/media/chatViewWelcome.css |
Fixed flexbox CSS properties for prompt pills, updated spacing, and added adaptive compression styles |
src/vs/workbench/contrib/chat/browser/chatWidget.ts |
Added ResizeObserver-based adaptive compression system for welcome view layout |
| cursor: pointer; | ||
| border: 1px solid var(--vscode-chat-requestBorder, var(--vscode-input-background, transparent)); | ||
| max-width: 260px; | ||
| max-width: 100%; |
Copilot
AI
Oct 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing max-width from 260px to 100% removes the previous constraint that limited pill width. This could allow pills with very long text to become excessively wide. Consider keeping a reasonable maximum width (e.g., max-width: min(260px, 100%)) to maintain readability while allowing flexibility.
| max-width: 100%; | |
| max-width: min(260px, 100%); |
| const BUFFER = 4; // px tolerance for visual collision | ||
| const OVERFLOW_TOL = 2; // px tolerance for scroll overflow |
Copilot
AI
Oct 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Magic numbers should be defined as named constants at the class or module level rather than as local constants. This makes them easier to maintain and understand their purpose across the codebase.
Screen.Recording.2025-10-02.at.2.14.47.PM.mov |
Co-authored-by: Copilot <[email protected]>
|
Continued in #269791 |
Pull request was closed
Problem
Prompt pills under "Suggested Actions" in the chat welcome view were expanding to 100% width instead of maintaining their natural
fit-contentwidth. This was caused by several CSS flexbox issues:row-gap: 8pxwithoutcolumn-gap, relying on per-pill marginsflex: 1, causing pills to grow and fill available spaceflex: 0 0 autoto prevent growth in the flex containerSolution
Applied minimal CSS fixes to maintain natural pill width while ensuring consistent spacing:
Result
fit-contentwidth based on content lengthgappropertyScreenshot
The screenshot demonstrates:
Original prompt
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.