Skip to content

sessions: fix sidebar layout when customizations toolbar changes#306314

Merged
sandy081 merged 2 commits intomainfrom
copilot/future-porpoise
Mar 30, 2026
Merged

sessions: fix sidebar layout when customizations toolbar changes#306314
sandy081 merged 2 commits intomainfrom
copilot/future-porpoise

Conversation

@sandy081
Copy link
Copy Markdown
Member

Summary

Fixes layout issues in the sessions sidebar where the sessions list and customizations section don't properly coordinate their sizing.

Changes

  • Re-layout on toolbar item changes: The AICustomizationShortcutsWidget now listens to the toolbar's onDidChangeMenuItems event and triggers a layout update. Previously, layout was only recalculated on collapse/expand toggle — so when toolbar items were dynamically added (e.g., Plugins appearing after extension activation), the sessions list kept stale height dimensions.

  • Remove redundant CSS: Removed height: 100% from .sessions-list-control since flex: 1 1 auto already handles sizing. The redundant height could cause unexpected flex-basis calculations.

  • Reduce section margin: Reduced .agent-sessions-section bottom margin from 12px to 6px for tighter spacing between the sessions list and customizations toolbar.

  • Rename callback: Renamed onDidToggleCollapseonDidChangeLayout to accurately reflect it handles any layout-affecting change, not just collapse toggles.

- Listen to toolbar's onDidChangeMenuItems to trigger re-layout when
  items are added/removed (e.g., Plugins appearing after extension
  activation)
- Remove redundant height: 100% from sessions-list-control (flex
  sizing handles this)
- Reduce sessions section bottom margin from 12px to 6px
- Rename onDidToggleCollapse to onDidChangeLayout to reflect broader
  layout change handling

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 30, 2026 11:54
@vs-code-engineering vs-code-engineering bot added this to the Backlog milestone Mar 30, 2026
@sandy081 sandy081 self-assigned this Mar 30, 2026
@sandy081 sandy081 enabled auto-merge (squash) March 30, 2026 11:56
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes sizing coordination issues in the Agent Sessions sidebar by ensuring the sessions list relayouts when the customizations toolbar changes (e.g., dynamic menu items added after extension activation), and by adjusting related CSS spacing/sizing rules.

Changes:

  • Trigger sessions view layout when the customizations toolbar’s menu items change, not only on collapse/expand transitions.
  • Rename the customization widget layout callback (onDidToggleCollapseonDidChangeLayout) to reflect broader layout triggers.
  • Adjust sidebar CSS spacing and remove height: 100% from the sessions list control.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/vs/sessions/contrib/sessions/browser/views/sessionsView.ts Uses the renamed callback to relayout the view when the customization widget signals layout changes.
src/vs/sessions/contrib/sessions/browser/media/sessionsViewPane.css Reduces bottom spacing between the sessions list section and the customizations area.
src/vs/sessions/contrib/sessions/browser/media/sessionsList.css Removes height: 100% from the list container (potentially impacting list sizing).
src/vs/sessions/contrib/sessions/browser/aiCustomizationShortcutsWidget.ts Fires layout callback on toolbar menu-item changes and on collapse transition end.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@sandy081 sandy081 merged commit 29f5047 into main Mar 30, 2026
18 checks passed
@sandy081 sandy081 deleted the copilot/future-porpoise branch March 30, 2026 12:45
mrleemurray pushed a commit that referenced this pull request Mar 30, 2026
…6314)

* sessions: fix sidebar layout when customizations toolbar changes

- Listen to toolbar's onDidChangeMenuItems to trigger re-layout when
  items are added/removed (e.g., Plugins appearing after extension
  activation)
- Remove redundant height: 100% from sessions-list-control (flex
  sizing handles this)
- Reduce sessions section bottom margin from 12px to 6px
- Rename onDidToggleCollapse to onDidChangeLayout to reflect broader
  layout change handling

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Update src/vs/sessions/contrib/sessions/browser/media/sessionsList.css

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.

3 participants