sessions - hide some menu and commands that do not apply#307172
Merged
sessions - hide some menu and commands that do not apply#307172
Conversation
Contributor
There was a problem hiding this comment.
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()aspreconditionfor 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>
anthonykim1
approved these changes
Apr 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
IsSessionsWindowContext.negate()aspreconditionfor various commands so they don't appear/trigger in Sessions windows, includingOpenRecentAction(workbench.action.openRecent) so it is hidden from the Command Palette and its Ctrl/Cmd+R keybinding is inactive.when: IsSessionsWindowContext.negate()to multiple menubar/menu contributions so items are not shown in Sessions windows.