Skip to content

Fix Disable button dropdown for workspace-enabled-override extensions - #328771

Open
WahidSaeed wants to merge 1 commit into
microsoft:mainfrom
WahidSaeed:fix/244138-disable-workspace-dropdown
Open

Fix Disable button dropdown for workspace-enabled-override extensions#328771
WahidSaeed wants to merge 1 commit into
microsoft:mainfrom
WahidSaeed:fix/244138-disable-workspace-dropdown

Conversation

@WahidSaeed

Copy link
Copy Markdown

Summary

  • When an extension is disabled globally and then enabled just for the current workspace, DisableGloballyAction incorrectly reported itself as enabled, causing the Disable button to show a redundant dropdown with both "Disable" and "Disable (Workspace)" instead of a plain "Disable (Workspace)" button.
  • DisableGloballyAction.update() now only enables the global disable action when the extension is enabled globally, or enabled for the workspace while not already disabled globally (using IWorkbenchExtensionEnablementService.isDisabledGlobally).

Fixes #244138

Test plan

  • Added a regression test: Test DisableGloballyAction when extension is disabled globally and enabled for workspace in extensionsActions.test.ts, asserting the action is disabled in that state.
  • Manual repro: install an extension, disable it, then enable it for the workspace — Disable button should show only "Disable (Workspace)" without a dropdown.

When an extension is disabled globally and then enabled just for the
current workspace, DisableGloballyAction was still reporting itself as
enabled, causing the Disable button to show a redundant dropdown with
both "Disable" and "Disable (Workspace)". Only the workspace action is
meaningful in that state since the extension is already disabled
globally.

Fixes microsoft#244138
Copilot AI review requested due to automatic review settings August 3, 2026 17:44

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.

Pull request overview

Fixes the Extensions view’s Disable button for workspace-enabled overrides.

Changes:

  • Hides the redundant global Disable action when already disabled globally.
  • Adds regression coverage for this enablement state.

Reviewed changes

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

File Description
extensionsActions.ts Corrects global Disable action eligibility.
extensionsActions.test.ts Tests the globally-disabled, workspace-enabled case.

@WahidSaeed

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

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.

Disabled and enabled (workspace) extension Disable button dropdown contains both "Disable" and "Disable (Workspace)" items

3 participants