Skip to content

sessions - hide some menu and commands that do not apply#307172

Merged
bpasero merged 2 commits intomainfrom
ben/free-cricket
Apr 1, 2026
Merged

sessions - hide some menu and commands that do not apply#307172
bpasero merged 2 commits intomainfrom
ben/free-cricket

Conversation

@bpasero
Copy link
Copy Markdown
Member

@bpasero bpasero commented Apr 1, 2026

Scopes workbench menubar entries and command-palette-visible actions so they are hidden/disabled when running in a Sessions window (IsSessionsWindowContext), reducing irrelevant UI surface in that specialized window type.

Changes Made

  • Adds IsSessionsWindowContext.negate() as precondition for various commands so they don't appear/trigger in Sessions windows, including OpenRecentAction (workbench.action.openRecent) so it is hidden from the Command Palette and its Ctrl/Cmd+R keybinding is inactive.
  • Adds when: IsSessionsWindowContext.negate() to multiple menubar/menu contributions so items are not shown in Sessions windows.
  • Narrows visibility of certain configuration/layout/profile-related submenus in Sessions windows.

Copilot AI review requested due to automatic review settings April 1, 2026 15:33
@bpasero bpasero enabled auto-merge (squash) April 1, 2026 15:33
@bpasero bpasero self-assigned this Apr 1, 2026
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 scopes a set of workbench menubar entries and command-palette-visible actions so they are hidden/disabled when running in a Sessions window (IsSessionsWindowContext), reducing irrelevant UI surface in that specialized window type.

Changes:

  • Adds IsSessionsWindowContext.negate() as precondition for various commands so they don’t appear/trigger in Sessions windows.
  • Adds when: IsSessionsWindowContext.negate() to multiple menubar/menu contributions so items are not shown in Sessions windows.
  • Narrows visibility of certain configuration/layout/profile-related submenus in Sessions windows.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/vs/workbench/contrib/welcomeViews/common/newFile.contribution.ts Hides “New File…” command/menu in Sessions windows via precondition/when.
src/vs/workbench/contrib/userDataProfile/browser/userDataProfile.ts Hides profiles-related menubar entries/submenus in Sessions windows.
src/vs/workbench/contrib/search/browser/searchActionsNav.ts Hides “Replace in Files” in Sessions windows (menu + command precondition).
src/vs/workbench/contrib/search/browser/searchActionsFind.ts Hides “Find in Files” in Sessions windows (menu + command precondition).
src/vs/workbench/contrib/remote/browser/remoteIndicator.ts Hides “Close Remote Connection” in Sessions windows.
src/vs/workbench/contrib/extensions/browser/extensions.contribution.ts Hides Extensions entry from Preferences menubar in Sessions windows.
src/vs/workbench/contrib/emmet/browser/actions/expandAbbreviation.ts Hides Emmet expand abbreviation menubar item in Sessions windows.
src/vs/workbench/contrib/debug/browser/debug.contribution.ts Hides the top-level Run menu entry in Sessions windows.
src/vs/workbench/browser/parts/editor/editor.contribution.ts Hides Share and Editor Layout menubar entries in Sessions windows.
src/vs/workbench/browser/parts/activitybar/activitybarPart.ts Hides Activity Bar Position from Appearance menubar in Sessions windows; adjusts command palette visibility for position actions.
src/vs/workbench/browser/actions/workspaceActions.ts Hides workspace open/close/add/save actions in Sessions windows (preconditions + menubar whens).
src/vs/workbench/browser/actions/windowActions.ts Hides New Window and Open Recent menubar entry in Sessions windows (New Window also gated by precondition).
src/vs/workbench/browser/actions/layoutActions.ts Hides various layout/appearance actions in Sessions windows (preconditions + menu whens).
src/vs/workbench/browser/actions/helpActions.ts Hides certain Help actions (e.g. accessibility getting started, Ask @VScode) in Sessions windows.

…Palette in Sessions windows

Agent-Logs-Url: https://github.com/microsoft/vscode/sessions/ef0f26b8-aae6-464e-8633-650caebae42a

Co-authored-by: bpasero <900690+bpasero@users.noreply.github.com>
@bpasero bpasero merged commit 02d8ead into main Apr 1, 2026
19 checks passed
@bpasero bpasero deleted the ben/free-cricket branch April 1, 2026 16:22
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.

4 participants