Skip to content

Add responsive compact layout for agent sessions web view#308110

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/make-responsive-agent-sessions-view
Draft

Add responsive compact layout for agent sessions web view#308110
Copilot wants to merge 2 commits intomainfrom
copilot/make-responsive-agent-sessions-view

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 7, 2026

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

  • Compact mode detection (workbench.ts): New COMPACT_WIDTH_THRESHOLD (600px) and LayoutClasses.COMPACT class. Detected early in initLayout() for correct initial grid state, and dynamically in layout() on viewport resize. Only fires on state transitions — users can still manually toggle sidebar/aux bar while in compact mode.
  • Auto-hide sidebar & auxiliary bar on entering compact mode, giving chat the full viewport width.
  • Full-bleed CSS (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.
  • Titlebar adjustments (titlebarpart.css): Reduced toolbar padding in compact mode so the session picker has more room.

How to test

# Start the sessions web server
./scripts/code-sessions-web.sh --skip-welcome

# In the browser, resize to < 600px width (or use DevTools device emulation)
# Sidebar should auto-hide, cards should go full-bleed with no margins/radius
# Resize back to > 600px — card appearance restores, sidebar can be toggled back

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 AI changed the title [WIP] Update agent sessions dedicated view for responsiveness Add responsive compact layout for agent sessions web view Apr 7, 2026
Copilot AI requested a review from osortega April 7, 2026 00:45
@osortega
Copy link
Copy Markdown
Contributor

osortega commented Apr 7, 2026

@copilot are these changes scoped to only when running in web AND responsiveness only for small screens like mobile.
In other words, running in web on a machine that has a big enough viewport should still look the same as it does today

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 7, 2026

@copilot are these changes scoped to only when running in web AND responsiveness only for small screens like mobile.
In other words, running in web on a machine that has a big enough viewport should s...

Yes, a big viewport looks identical to today. Every CSS rule is gated behind .agent-sessions-workbench.compact, and the .compact class is only added when the viewport width drops below 600px. On any viewport ≥ 600px, no compact rules apply and no layout changes occur.

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.

@osortega
Copy link
Copy Markdown
Contributor

osortega commented Apr 8, 2026

@copilot hello

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants