Add responsive compact layout for agent sessions web view#308110
Add responsive compact layout for agent sessions web view#308110
Conversation
When the viewport width falls below 600px, the sessions workbench switches to a compact single-column layout: - Sidebar and auxiliary bar are auto-hidden - Card margins, border-radius and side borders are removed for full-bleed - Chat content and input padding is tightened - Part appear transitions are disabled - Titlebar padding is reduced Compact mode is detected early in initLayout() so the initial grid descriptor uses the correct part visibility, and dynamically in layout() to handle viewport resizing. Agent-Logs-Url: https://github.com/microsoft/vscode/sessions/22feabbb-79bd-4057-b7f9-7c5456de92b1 Co-authored-by: osortega <48293249+osortega@users.noreply.github.com>
|
@copilot are these changes scoped to only when running in web AND responsiveness only for small screens like mobile. |
Yes, a big viewport looks identical to today. Every CSS rule is gated behind The JS logic also only fires on state transitions — it doesn't run on every resize, only when crossing the 600px threshold. When entering compact mode it auto-hides the sidebar and auxiliary bar; when leaving compact mode those parts remain in whatever state the user left them (they don't force-show back). Note: the changes apply to the sessions workbench on both web and desktop, which is intentional — if someone resizes the desktop sessions window very narrow, the layout should still adapt gracefully. But on a typical desktop viewport this never triggers. |
|
@copilot hello |
The agent sessions web entry point renders well on desktop but breaks on phones and narrow viewports. This adds a compact mode that activates below 600px width, producing a full-bleed single-column layout.
Changes
workbench.ts): NewCOMPACT_WIDTH_THRESHOLD(600px) andLayoutClasses.COMPACTclass. Detected early ininitLayout()for correct initial grid state, and dynamically inlayout()on viewport resize. Only fires on state transitions — users can still manually toggle sidebar/aux bar while in compact mode.style.css): In.compact, card margins,border-radius, and side borders are removed from chatbar, auxiliary bar, and panel. Chat content padding tightened (12→8px). Part appear transitions disabled.titlebarpart.css): Reduced toolbar padding in compact mode so the session picker has more room.How to test