Skip to content

fix(extensions): remove global Disable action if extension is already disabled globally#325463

Draft
singhlovepreet9 wants to merge 1 commit into
microsoft:mainfrom
singhlovepreet9:fix-duplicate-disable-action
Draft

fix(extensions): remove global Disable action if extension is already disabled globally#325463
singhlovepreet9 wants to merge 1 commit into
microsoft:mainfrom
singhlovepreet9:fix-duplicate-disable-action

Conversation

@singhlovepreet9

Copy link
Copy Markdown

Fixes #244138

When an extension is disabled globally and then enabled for a workspace, the DisableGloballyAction would still be enabled, causing the dropdown to show both Disable and Disable (Workspace).

This PR updates DisableGloballyAction.update() to check !this.extensionEnablementService.isDisabledGlobally(this.extension.local) when the extension's state is EnabledWorkspace. This ensures the global Disable action is hidden if the extension is already globally disabled, leaving only the Disable (Workspace) button as expected.

Copilot AI review requested due to automatic review settings July 12, 2026 04:48

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

Prevents duplicate disable options when a globally disabled extension is enabled for a workspace.

Changes:

  • Hides the global Disable action when global disablement remains active beneath workspace enablement.

}
this.enabled = this.extension.state === ExtensionState.Installed
&& (this.extension.enablementState === EnablementState.EnabledGlobally || this.extension.enablementState === EnablementState.EnabledWorkspace)
&& (this.extension.enablementState === EnablementState.EnabledGlobally || (this.extension.enablementState === EnablementState.EnabledWorkspace && !this.extensionEnablementService.isDisabledGlobally(this.extension.local)))
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