Fix Disable button dropdown showing redundant "Disable" for workspace-enabled extensions#320291
Open
anuragyadav0311 wants to merge 1 commit into
Open
Fix Disable button dropdown showing redundant "Disable" for workspace-enabled extensions#320291anuragyadav0311 wants to merge 1 commit into
anuragyadav0311 wants to merge 1 commit into
Conversation
…ed extensions When an extension is disabled globally but enabled for a workspace (EnabledWorkspace state), the Disable button dropdown incorrectly showed both 'Disable' and 'Disable (Workspace)' items. The 'Disable' (global) action should not appear because the extension is already disabled globally. Only 'Disable (Workspace)' is meaningful in this state. Fix by restricting DisableGloballyAction to only be enabled when the extension's enablement state is EnabledGlobally. Fixes microsoft#244138
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adjusts when the “Disable Globally” extension action is enabled so it only applies to extensions currently enabled globally.
Changes:
- Tightens
DisableGloballyActionenablement condition to only allow the action whenenablementState === EnabledGlobally.
Comment on lines
1782
to
1784
| this.enabled = this.extension.state === ExtensionState.Installed | ||
| && (this.extension.enablementState === EnablementState.EnabledGlobally || this.extension.enablementState === EnablementState.EnabledWorkspace) | ||
| && this.extension.enablementState === EnablementState.EnabledGlobally | ||
| && this.extensionEnablementService.canChangeEnablement(this.extension.local); |
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.
…ed extensions
When an extension is disabled globally but enabled for a workspace (EnabledWorkspace state), the Disable button dropdown incorrectly showed both 'Disable' and 'Disable (Workspace)' items.
The 'Disable' (global) action should not appear because the extension is already disabled globally. Only 'Disable (Workspace)' is meaningful in this state.
Fix by restricting DisableGloballyAction to only be enabled when the extension's enablement state is EnabledGlobally.
Fixes #244138