Studio: Don't display available editors label when no editors are present - #1399
Conversation
| } else if ( installedEditors.phpstorm ) { | ||
| return { data: 'phpstorm' }; | ||
| } | ||
|
|
There was a problem hiding this comment.
I don't think we need this code. I believe we added it to work around feature flag but since we removed the feature flag, we are not providing defaults for code editors so I removed it.
There was a problem hiding this comment.
I think this is not a good call. Those were added for backwards compatibility. Previously, we were explicitly checking if VSCode and PhpStorm are installed and show the button accordingly. It can easily confuse users after updating the studio version since it would remove the VSCode or PhpStorm button from the overview.
There was a problem hiding this comment.
I think actually that button not being there is intended since we are now not setting a default editor. It is also mentioned in our docs: https://developer.wordpress.com/docs/developer-tools/studio/frequently-asked-questions/#16-why-isn-t-the-open-in-button-available-for-my-preferred-app-
Studio, the code editors and terminal applications must live in your Applications folder to ensure the Open in… options are available. If you haven’t selected a preferred code editor in your User Settings, no code editor button will appear in the Open in… area.
However, I agree with the point that we should handle this for backwards compatibility. I am going to take a look how to reconcile this, thanks for the feedback @gavande1 👍
There was a problem hiding this comment.
I brought back the code in 9abb507 , I think we should be all good.
gavande1
left a comment
There was a problem hiding this comment.
I have left a minor comment. Apart from that, it works as expected. LGTM 👍
| } else if ( installedEditors.phpstorm ) { | ||
| return { data: 'phpstorm' }; | ||
| } | ||
|
|
gavande1
left a comment
There was a problem hiding this comment.
Thanks for addressing the feedback!





Related issues
Fixes STU-502
Proposed Changes
This PR ensures that we do not display
Available editorseditors label when there are no editors installed. Additionally, I made some improvements around theSelectlabel which was not displaying before.When there are no installed editors:
When the user selected a preferred editor:
When there are installed editor but the user have not selected a preferred editor:
Testing Instructions
When there are no installed editors:
npm startPreferencestabAvailable editorslabelWhen the user selected a preferred editor:
npm startPreferencestabAvailable editorslabel is presentSelectWhen there are installed editor but the user have not selected a preferred editor:
preferredEditorfrom theappdataunder/Users/{yourUser}/Library/Application Support/Studio/appdata-v1.jsonnpm startPreferencestabCode editoroption, you can seeSelectoptionAvailable editorslabel is presentPre-merge Checklist