Skip to content

fix: re-assert active editor context on workspace trust change - #335615

Open
Birarpanjot Singh Kanwer (arpankanwer) wants to merge 1 commit into
microsoft:mainfrom
arpankanwer:fix/save-greyed-after-trust-335608
Open

fix: re-assert active editor context on workspace trust change#335615
Birarpanjot Singh Kanwer (arpankanwer) wants to merge 1 commit into
microsoft:mainfrom
arpankanwer:fix/save-greyed-after-trust-335608

Conversation

@arpankanwer

Copy link
Copy Markdown
Contributor

Fixes #335608

Bug repro

  1. Open a folder in Restricted Mode (untrusted) with a file open in the active editor.
  2. Open Workspace Trust editor and choose Trust.
  3. Return to the editor without switching editors/tabs.
  4. File > Save remains greyed/disabled even though trust is now granted.

Root cause
Workspace trust transitions do not fire active-editor events, so stale activeEditor context keys persist. File > Save precondition on that context never re-evaluates until the active editor changes.

Fix
Re-observe the active editor on workspaceTrustService.onDidChangeTrust in EditorGroupView, re-asserting context keys immediately after a trust transition.

Validation

  • eslint clean on touched file
  • tsc --noEmit: 0 errors
  • gulp compile-client: ok (~15s)
  • Manual dev-window before/after: pre-fix Save greyed after granting trust (screenshot); post-fix Save stays enabled

Copilot AI balanced review requested due to automatic review settings September 11, 2026 02:49

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 was unable to review this pull request because the user who requested the review has reached their quota limit.

@vs-code-engineering

Copy link
Copy Markdown
Contributor

📬 CODENOTIFY

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

Benjamin Christopher Simmonds (@benibenj)

Matched files:

  • src/vs/workbench/browser/parts/editor/editorGroupView.ts

Fixes microsoft#335608
Re-observes the active editor when workspace trust changes so File > Save
precondition on activeEditor context re-evaluates without requiring an editor switch.
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.

entering "Trusted" mode for a folder disables the "File->Save" option until a new file is opened

3 participants