Fix Disable button dropdown for workspace-enabled-override extensions - #328771
Open
WahidSaeed wants to merge 1 commit into
Open
Fix Disable button dropdown for workspace-enabled-override extensions#328771WahidSaeed wants to merge 1 commit into
WahidSaeed wants to merge 1 commit into
Conversation
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
Contributor
There was a problem hiding this comment.
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. |
Author
|
@microsoft-github-policy-service agree |
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.
Summary
DisableGloballyActionincorrectly 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 (usingIWorkbenchExtensionEnablementService.isDisabledGlobally).Fixes #244138
Test plan
Test DisableGloballyAction when extension is disabled globally and enabled for workspaceinextensionsActions.test.ts, asserting the action is disabled in that state.