Skip to content

Agents - Open new sessions to the side with Alt-click - #334962

Merged
Federico Brancasi (federicobrancasi) merged 2 commits into
mainfrom
agents/new-session-alt-click-only
Sep 8, 2026
Merged

Agents - Open new sessions to the side with Alt-click#334962
Federico Brancasi (federicobrancasi) merged 2 commits into
mainfrom
agents/new-session-alt-click-only

Conversation

@federicobrancasi

@federicobrancasi Federico Brancasi (federicobrancasi) commented Sep 7, 2026

Copy link
Copy Markdown
Member

Fixes #334508

Summary

Alt+click (Option+click on macOS) on New in the Agents window opens a new session beside the current one, keeping it visible.

Regular click and existing keyboard shortcuts are unchanged. No new buttons, dropdowns, or tooltip text.

Screen.Recording.2026-09-07.at.8.13.28.PM.mov

Testing

  • 143 targeted tests passing, 2 pending.
  • Client type-check and scoped hygiene checks passing.

Support Alt+click (Option+click on macOS) on the existing New button
to open a session beside the active one. Keep the existing UI and
keyboard shortcuts unchanged.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings September 7, 2026 18:14
@vs-code-engineering

vs-code-engineering Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

Sandeep Somavarapu (@sandy081)

Matched files:

  • src/vs/sessions/services/sessions/browser/sessionsService.ts
  • src/vs/sessions/services/sessions/browser/visibleSessions.ts
  • src/vs/sessions/services/sessions/test/browser/sessionsManagementService.test.ts
  • src/vs/sessions/services/sessions/test/browser/visibleSessions.test.ts

Ladislau Szomoru (@lszomoru)

Matched files:

  • src/vs/sessions/services/sessions/browser/sessionsService.ts
  • src/vs/sessions/services/sessions/browser/visibleSessions.ts
  • src/vs/sessions/services/sessions/test/browser/sessionsManagementService.test.ts
  • src/vs/sessions/services/sessions/test/browser/visibleSessions.test.ts

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

The new action lacks keyboard accessibility, and existing empty composers are not placed beside the active session.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review tier: Balanced
Findings: 2 Medium severity

New issues introduced by this change (2)
Severity Finding
Medium severity src/​vs/​sessions/​contrib/​sessions/​browser/​sessionsActions.ts — This adds a mouse-only interaction: keyboard activation is converted to undefined before this…
Medium severity src/​vs/​sessions/​services/​sessions/​browser/​sessionsService.ts — When an empty composer already exists, this forces the fallback to _activate(undefined) instead…
What changed in this PR

Adds Alt/Option-click support for opening a new Agents session beside the active session.

Changes:

  • Propagates a toSide option through session creation.
  • Adds side-placement logic and targeted tests.
  • Handles Alt-click on the New button.

Required changes:

  • Provide an accessible keyboard or bindable-command alternative and document it in Sessions accessibility help.
  • Relocate an existing empty composer beside the active anchor when toSide is requested.
File Description
src/​vs/​sessions/​services/​sessions/​test/​browser/​sessionsManagementService.test.ts Tests side-opening behavior.
src/​vs/​sessions/​services/​sessions/​browser/​sessionsService.ts Implements side placement.
src/​vs/​sessions/​contrib/​sessions/​test/​browser/​sessionsActions.test.ts Tests New button interactions.
src/​vs/​sessions/​contrib/​sessions/​browser/​sessionsActions.ts Handles Alt-click behavior.
src/​vs/​sessions/​contrib/​chat/​browser/​chat.contribution.ts Forwards the toSide option.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/vs/sessions/contrib/sessions/browser/sessionsActions.ts
Comment thread src/vs/sessions/services/sessions/browser/sessionsService.ts Outdated
Move the single empty composer to the requested position instead of focusing it elsewhere. Keep repeated requests on the active composer and ordinary New behavior unchanged.

Cover relocation, focus, stickiness, and replacement recency with regression tests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@federicobrancasi
Federico Brancasi (federicobrancasi) merged commit b8607ed into main Sep 8, 2026
33 checks passed
@federicobrancasi
Federico Brancasi (federicobrancasi) deleted the agents/new-session-alt-click-only branch September 8, 2026 08:02
@vs-code-engineering vs-code-engineering Bot added this to the 1.138.0 milestone Sep 8, 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.

Agents: no way to open a new session beside the current one

3 participants