Skip to content

fix: correctly disable 'Enable (Workspace)' option when already active #251531

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

Subham-KRLX
Copy link

Description

Fixes a bug where the 'Enable (Workspace)' action remained enabled even when the extension was already enabled for the workspace. This led to confusion as users could repeatedly trigger the same action unnecessarily.

Updated the update() method of the EnableForWorkspaceAction class to add a check for extension.enablementState !== EnablementState.EnabledWorkspace.

Related Issue

Fixes: #244138

Changes Made

  • File: src/vs/workbench/contrib/extensions/browser/extensionsActions.ts
  • Modified: EnableForWorkspaceActionupdate() method logic

Steps to Reproduce the Fix

  1. Install any extension.
  2. Enable it for Workspace.
  3. Now verify that the dropdown disables the option if it’s already active for the workspace.

@Subham-KRLX
Copy link
Author

Hi @sandy081, @ultra-000 👋
I've submitted a fix for issue #244138. Could you please review this PR and approve the workflows so the required checks can run?
Thank you!

@ultra-000
Copy link

@Subham-KRLX Unfortunately, I am not a decision maker in VS code's repo, so you will have to wait for @sandy081's approval, but I can check your PR when I have free time, and maybe give you some feedback on any unhandled edge cases.

@sandy081 sandy081 self-requested a review June 17, 2025 08:44
@sandy081 sandy081 added this to the June 2025 milestone Jun 17, 2025
@sandy081
Copy link
Member

@Subham-KRLX The builds seems to be red - looks like there is a formatting issue. Please check and fix it.

@Subham-KRLX
Copy link
Author

Hi @sandy081 👋

Thanks for the feedback earlier — I’ve pushed the updated commit that fixes the formatting issue. Could you please approve the workflows so the checks can run?

Also, let me know if you’d like me to rebase with the latest main branch.
Thanks again for your time and help!

@ultra-000
Copy link

@Subham-KRLX, aside from the formatting issues, your fix seems to suffer from the same issue my fix did, the steps to reproduce the issue are instructed by @sandy081 at my PR's thread: #244419 (comment)

@Subham-KRLX
Copy link
Author

Hi @ultra-000,
Thanks for pointing that out and referencing the comment on your PR — I’ll go through @sandy081’s instructions there and verify if the current implementation properly handles those cases.

If it turns out to have the same issue, I’ll make the necessary adjustments and push the fix accordingly. Really appreciate your input! 🙌

Will update soon.

@ultra-000
Copy link

Hi @ultra-000, Thanks for pointing that out and referencing the comment on your PR — I’ll go through @sandy081’s instructions there and verify if the current implementation properly handles those cases.

If it turns out to have the same issue, I’ll make the necessary adjustments and push the fix accordingly. Really appreciate your input! 🙌

Will update soon.

Alright, have luck.

@Subham-KRLX Subham-KRLX force-pushed the fix/extension-disable-dropdown branch from 340ed06 to e35db23 Compare June 17, 2025 13:12
@Subham-KRLX
Copy link
Author

Subham-KRLX commented Jun 17, 2025

Hi @sandy081 and @ultra-000,
I’ve addressed the formatting issue and added the check to properly disable the “Enable (Workspace)” option when it’s already active. I also verified that the loop issue from #244419 has been resolved. Could you please re-review when you have a chance? Thanks!

@ultra-000
Copy link

Hi @sandy081 and @ultra-000, I’ve addressed the formatting issue and added the check to properly disable the “Enable (Workspace)” option when it’s already active. I also verified that the loop issue from #244419 has been resolved. Could you please re-review when you have a chance? Thanks!

This does two things:

Notifies reviewers that changes are ready again. Summarizes the updates concisely.
Summarizes the updates concisely.

Using AI to write your messages? I have felt that there is something odd about your messages, no problem though, maybe you are new at the field, and don't know what to say exactly to effectively deliver your thoughts. Anyway, will make sure to check your updates when I can.

@Subham-KRLX
Copy link
Author

Yeah, that’s a fair call @ultra-000. I’ve been pretty active with open source lately and trying to contribute wherever I can, so to save time I’ve been using AI to help with some of the wording. Still figuring out how to make it sound more like me, so I appreciate you pointing it out. Always open to feedback — thanks again for checking things out when you get the time.

@ultra-000
Copy link

Alright @Subham-KRLX, I can tell from the diffs that you didn't change your code, have you probably committed and pushed your changes?

@Subham-KRLX
Copy link
Author

Hi @sandy081 and @ultra‑000 👋,

Thanks again for your feedback—I realized I initially misunderstood the contribution guidelines and formatting expectations. I’ve now corrected the formatting, updated the logic to disable “Enable (Workspace)” when already active, and verified the fix resolves the loop edge case from #244419.

I apologize for the confusion and appreciate your patience.

@Subham-KRLX
Copy link
Author

Hi @sandy081, @ultra-000, just checking in on the review status of this PR. Please let me know if any further changes are needed.

@ultra-000
Copy link

@Subham-KRLX, I guess I am stepping back a bit and will leave this to @sandy081, sorry.

@Subham-KRLX
Copy link
Author

@sandy081, @ultra-000 thanks again for all your guidance and patience throughout this process! The codebase is a bit large and complex and I had greatly appreciate if someone could take a moment to help debug and clean up the remaining errors. Thank you!

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
7 participants