-
Notifications
You must be signed in to change notification settings - Fork 36.7k
Responsive chat panel (dynamic compression) #269791
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
base: main
Are you sure you want to change the base?
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 implements a CSS solution to improve the responsiveness of the chat panel's welcome view by preventing content overlap at various screen sizes and viewport dimensions.
- Updates flexbox properties and spacing for better responsive layout behavior
- Adds progressive media queries that hide non-essential welcome content at smaller viewport sizes
- Changes "Chat history..." text to "More history..." for brevity
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 11 comments.
| File | Description |
|---|---|
src/vs/workbench/contrib/chat/browser/media/chatViewWelcome.css |
Implements responsive CSS with media queries and updates flexbox layout for suggested prompts |
src/vs/workbench/contrib/chat/browser/chatWidget.ts |
Updates history link text from "Chat history..." to "More history..." |
| /* Responsive fallbacks to avoid overlapping welcome content */ | ||
|
|
||
| @media screen and (max-height: 760px), screen and (max-width: 620px) { | ||
| .interactive-session:not(:has(.chat-welcome-view-icon .codicon-send-to-remote-agent)) .chat-welcome-view-container:has(.chat-welcome-view-suggested-prompts > .chat-welcome-view-suggested-prompt:nth-of-type(2)) div.chat-welcome-view > .chat-welcome-view-title { |
Copilot
AI
Oct 3, 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.
The CSS selector is extremely complex and nested, making it difficult to maintain. Consider breaking this into smaller, more specific classes or using CSS custom properties to simplify the targeting logic.
|
|
||
| /* Responsive fallbacks to avoid overlapping welcome content */ | ||
|
|
||
| @media screen and (max-height: 760px), screen and (max-width: 620px) { |
Copilot
AI
Oct 3, 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.
The media query breakpoints use magic numbers without explanation. Consider defining these breakpoints as CSS custom properties with descriptive names to improve maintainability and make the responsive design intent clearer.
| } | ||
| } | ||
|
|
||
| @media screen and (max-height: 720px), screen and (max-width: 580px) { |
Copilot
AI
Oct 3, 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.
The media query breakpoints use magic numbers without explanation. Consider defining these breakpoints as CSS custom properties with descriptive names to improve maintainability and make the responsive design intent clearer.
| } | ||
| } | ||
|
|
||
| @media screen and (max-height: 680px), screen and (max-width: 540px) { |
Copilot
AI
Oct 3, 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.
The media query breakpoints use magic numbers without explanation. Consider defining these breakpoints as CSS custom properties with descriptive names to improve maintainability and make the responsive design intent clearer.
| } | ||
| } | ||
|
|
||
| @media screen and (max-height: 640px), screen and (max-width: 500px) { |
Copilot
AI
Oct 3, 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.
The media query breakpoints use magic numbers without explanation. Consider defining these breakpoints as CSS custom properties with descriptive names to improve maintainability and make the responsive design intent clearer.
src/vs/workbench/contrib/chat/browser/media/chatViewWelcome.css
Outdated
Show resolved
Hide resolved
src/vs/workbench/contrib/chat/browser/media/chatViewWelcome.css
Outdated
Show resolved
Hide resolved
src/vs/workbench/contrib/chat/browser/media/chatViewWelcome.css
Outdated
Show resolved
Hide resolved
src/vs/workbench/contrib/chat/browser/media/chatViewWelcome.css
Outdated
Show resolved
Hide resolved
src/vs/workbench/contrib/chat/browser/media/chatViewWelcome.css
Outdated
Show resolved
Hide resolved
|
@eli-w-king @digitarald @bhavyaus we're done with September changes. Moving this out to October... |
| } | ||
|
|
||
| @media screen and (max-height: 720px), screen and (max-width: 580px) { | ||
| .interactive-session:not(.new-welcome-view):not(:has(.chat-welcome-view-icon .codicon-send-to-remote-agent)) .chat-welcome-view-container:has(.chat-welcome-view-suggested-prompts > .chat-welcome-view-suggested-prompt:nth-of-type(2)) div.chat-welcome-view > .chat-welcome-view-icon { |
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.
- These selectors are very complex. We coul simplify them to target just the specific elements (.chat-welcome-view-icon, .chat-welcome-view-disclaimer, etc.).
- The screen qualifier isn’t needed here since it’s the default I think.
- Also, how are we choosing the max-height and max-width breakpoints?
bpasero
left a comment
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.
Overall I wonder if we couldn't achieve this easily without CSS (which comes at a cost) by simply updating the visibility of elements from within our layout call, where we know exactly what kind of height and width the view gets:
| layout(height: number, width: number): void { |
| font-size: 14px; | ||
| font-weight: 600; | ||
| font-size: 13px; | ||
| font-weight: 500; |
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.
Can we remove use of font-weight altogether? I think it still works without it well given the color.
|
|
||
| /* Responsive fallbacks to avoid overlapping welcome content */ | ||
|
|
||
| .interactive-session:not(.new-welcome-view):not(:has(.chat-welcome-view-icon .codicon-send-to-remote-agent)) { |
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.
I am a bit worried about the perf of this selector, is there a way we can avoid :has that seems to check on every child element recursively?
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.
+1. We've already broken down the selector for new-welcome-view etc above. Most of these can be nested under there.
| /* Responsive fallbacks to avoid overlapping welcome content */ | ||
|
|
||
| .interactive-session:not(.new-welcome-view):not(:has(.chat-welcome-view-icon .codicon-send-to-remote-agent)) { | ||
| .chat-welcome-view-container:has(.chat-welcome-view-suggested-prompts > .chat-welcome-view-suggested-prompt:nth-of-type(2)) { |
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.
Same here.
|
Revised prompt width and styling here: #271399 |
|
Thanks for creating this issue! We figured it's missing some basic information or in some other way doesn't follow our issue reporting guidelines. Please take the time to review these and update the issue. For Copilot Issues, be sure to visit our Copilot-specific guidelines page for details on the necessary information. Happy Coding! |
bpasero
left a comment
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.
I would suggest to revisit this in November 🙏
CSS solution for responsive chat panel
Screen.Recording.2025-10-03.at.3.42.59.PM.mov