Fix Extensions view showing redundant Disable dropdown for workspace-enabled extensions - #325442
Conversation
…ace-enabled DisableGloballyAction treated EnablementState.EnabledWorkspace the same as EnabledGlobally, so it stayed enabled even when an extension was disabled globally but re-enabled just for the current workspace. This made the Extensions view show a "Disable" dropdown with both "Disable" and "Disable (Workspace)" instead of the single expected "Disable (Workspace)" button. Fixes microsoft#244138
There was a problem hiding this comment.
Pull request overview
Fixes an Extensions view UI bug where an extension that is disabled globally but re-enabled for the current workspace would still offer the global Disable action, resulting in a redundant dropdown containing both Disable and Disable (Workspace).
Changes:
- Updates
DisableGloballyAction.update()to enable/offer the global disable action only whenenablementState === EnablementState.EnabledGlobally. - Prevents the global disable action from being shown in the workspace-override (
EnabledWorkspace) case, so the UI presents only Disable (Workspace) without a dropdown.
Covers the scenario from the Copilot PR review: an extension disabled globally and then explicitly enabled for the current workspace should not offer the global "Disable" action.
|
@Alexoswin please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
|
@microsoft-github-policy-service agree |
Summary
Fixes #244138.
When an extension is disabled globally and then explicitly re-enabled for the current workspace only, its
enablementStatebecomesEnablementState.EnabledWorkspace.DisableGloballyAction.update()treated that state the same asEnablementState.EnabledGlobally, so the "Disable" (global) action stayed enabled and visible alongside "Disable (Workspace)" — producing a dropdown with both options even though the extension isn't actually enabled globally in this state.This change restricts
DisableGloballyActionto only be enabled when the extension'senablementStateisEnabledGlobally, so in the workspace-override case the Extensions view shows a single "Disable (Workspace)" button with no dropdown, matching the expected behavior described in the issue.Test plan