Skip to content

Close mobile sidebar drawer when creating a new session#314572

Merged
osortega merged 2 commits into
mainfrom
agents/afca4b01-7e96-487c-a222-321e6cee142e
May 6, 2026
Merged

Close mobile sidebar drawer when creating a new session#314572
osortega merged 2 commits into
mainfrom
agents/afca4b01-7e96-487c-a222-321e6cee142e

Conversation

@osortega
Copy link
Copy Markdown
Contributor

@osortega osortega commented May 5, 2026

On the agents mobile web layout, tapping the (+) buttons to create a new session left the sidebar drawer covering the viewport, so the new session view stayed hidden behind it. Now the drawer dismisses automatically once a new session is created.

Changes

  • src/vs/sessions/browser/workbench.ts — after the mobile titlebar's (+) button calls openNewSessionView(), also call closeMobileSidebarDrawer().
  • src/vs/sessions/contrib/sessions/browser/views/sessionsViewActions.tsNewSessionForWorkspaceAction (the per-workspace section (+) button rendered inside the sessions list) hides the sidebar via IWorkbenchLayoutService.setPartHidden(true, Parts.SIDEBAR_PART).

Both call sites are gated on isWeb && isMobile so the change is a no-op on desktop and on native, matching the existing onSessionOpen pattern in sessionsView.ts that already closes the drawer when an existing session is opened.

Validation

  • npm run compile-check-ts-native
  • npx eslint on both files ✅

On the agents mobile web layout, tapping the (+) buttons to create a new
session left the sidebar drawer covering the viewport, hiding the new
session view. Now the drawer is dismissed automatically:

- The (+) button in the mobile titlebar (workbench.ts).
- The per-workspace section (+) button inside the sessions list
  (NewSessionForWorkspaceAction).

Both call sites are gated on `isWeb && isMobile` to match the existing
`onSessionOpen` pattern in sessionsView.ts.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 5, 2026 22:57
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2026

Screenshot Changes

Base: c25f7a7e Current: 12a61229

Changed (12)

chat/input/chatInput/Default/Dark
Before After
before after
chat/input/chatInput/Default/Light
Before After
before after
chat/input/chatInput/WithArtifacts/Light
Before After
before after
chat/input/chatInput/WithFileChanges/Dark
Before After
before after
chat/input/chatInput/WithFileChanges/Light
Before After
before after
chat/input/chatInput/WithTodos/Light
Before After
before after
chat/input/chatInput/WithTodosAndFileChanges/Dark
Before After
before after
chat/input/chatInput/WithTodosAndFileChanges/Light
Before After
before after
chat/input/chatInput/WithArtifactsAndFileChanges/Light
Before After
before after
chat/input/chatInput/Full/Dark
Before After
before after
chat/widget/chatWidget/SimpleQA/Light
Before After
before after
chat/widget/chatWidget/PendingToolApproval/Light
Before After
before after

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

This PR targets the Agents (sessions) window phone-layout UX by ensuring the sidebar overlay drawer doesn’t keep covering the viewport after the user creates a new session via “+” actions.

Changes:

  • Mobile titlebar “+” now attempts to close the sidebar drawer after creating a new session.
  • Sessions view per-workspace “+” action now hides the sidebar after creating a new session and selecting the workspace.
Show a summary per file
File Description
src/vs/sessions/contrib/sessions/browser/views/sessionsViewActions.ts Hides the sidebar after “New Session” is invoked from a workspace section, to reveal the newly created session view.
src/vs/sessions/browser/workbench.ts Closes the mobile sidebar drawer when the topbar “New Session” action is triggered.

Copilot's findings

Comments suppressed due to low confidence (1)

src/vs/sessions/contrib/sessions/browser/views/sessionsViewActions.ts:360

  • The condition if (isWeb && isMobile) is based on device detection, but the overlay sidebar is controlled by sessions phone layout (viewport width). In a narrow desktop web viewport that triggers phone layout, this will not close the overlay drawer and the new session view can remain hidden. Consider checking IsPhoneLayoutContext (sessions context key) instead of isMobile so this matches the actual layout state.
		// On mobile web, the sidebar drawer covers the viewport; close it so
		// the new session view becomes visible after creation.
		if (isWeb && isMobile) {
			layoutService.setPartHidden(true, Parts.SIDEBAR_PART);
  • Files reviewed: 2/2 changed files
  • Comments generated: 2

Comment thread src/vs/sessions/browser/workbench.ts Outdated
@ly6093909-ops ly6093909-ops mentioned this pull request May 5, 2026
@osortega osortega marked this pull request as ready for review May 6, 2026 04:16
@osortega osortega enabled auto-merge (squash) May 6, 2026 04:16
@osortega osortega merged commit 89fc639 into main May 6, 2026
26 checks passed
@osortega osortega deleted the agents/afca4b01-7e96-487c-a222-321e6cee142e branch May 6, 2026 04:20
@vs-code-engineering vs-code-engineering Bot added this to the 1.120.0 milestone May 6, 2026
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