Skip to content
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

fix: use correct command to Open Folder on Welcome page #3437

Merged
merged 2 commits into from
May 21, 2021

Conversation

jsjoeio
Copy link
Contributor

@jsjoeio jsjoeio commented May 21, 2021

This PR fixes the "Open Folder" link on the Welcome page.

Changes

  • update Welcome Page to use openFolder

Screenshots

Screen.Recording.2021-05-21.at.12.00.08.PM.mov

Checklist

  • tested locally
  • updated CHANGELOG.md

Fixes #2921

Related:

@jsjoeio jsjoeio added this to the 3.11.0 milestone May 21, 2021
@jsjoeio jsjoeio self-assigned this May 21, 2021
@codecov
Copy link

codecov bot commented May 21, 2021

Codecov Report

Merging #3437 (445618d) into main (ac96517) will not change coverage.
The diff coverage is n/a.

❗ Current head 445618d differs from pull request most recent head 3a426e4. Consider uploading reports for the commit 3a426e4 to get more accurate results
Impacted file tree graph

@@           Coverage Diff           @@
##             main    #3437   +/-   ##
=======================================
  Coverage   59.21%   59.21%           
=======================================
  Files          35       35           
  Lines        1709     1709           
  Branches      379      379           
=======================================
  Hits         1012     1012           
  Misses        559      559           
  Partials      138      138           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ac96517...3a426e4. Read the comment docs.

@jsjoeio
Copy link
Contributor Author

jsjoeio commented May 21, 2021

Notes

Looking at the vs_code_welcome_page.ts, there is a line which should be mac-only which opens a folder by executing the command workbench.action.files.openFileFolder.

When the link gets called, the commandService is used. First, it uses the id workbench.action.files.openFileFolder to look up the command in the CommandsRegistry. If the command isn't found, it rejects the promise. The question is: why isn't it found?

We need to find the list of commands and see what's there 🤔

From what I can tell, actions are "registered" like registerAction2(KeybindingsReferenceAction);

Funny enough, I can't tell how the OpenFileFolderAction gets registered 🤔
Here is the code upstream.

Okay I found this issue. If you look here I found the issue I believe! If you look here, that action only), they only use the OpenFileFolderAction on mac desktop (not web). So we need to change the action in the Welcome Page to use the OpenFolder and it should work.

This change happened on April 21 in the 1.56.2 release: microsoft/vscode@141ecfb#diff-c294b7c700c8aaaac2bce37dd95450e3ab232e0e52fcc181b7c94780f01aa17a

In 1.56.2, they modified the WelcomePage use of OpenFileFolder in
src/vs/workbench/contrib/debug/browser/welcomeView.ts to only use on macOS +
Desktop (i.e. not Web). This caused the "Open Folder" to not work on macOS +
macOS-like environments.

Instead, we use OpenFolder which is a registered command and works as expected.
@jsjoeio jsjoeio marked this pull request as ready for review May 21, 2021 19:07
@jsjoeio jsjoeio requested a review from a team as a code owner May 21, 2021 19:07
@repo-ranger repo-ranger bot merged commit 604491d into main May 21, 2021
@repo-ranger repo-ranger bot deleted the jsjoeio/fix-2921 branch May 21, 2021 19:27
@nooobcoder
Copy link

This PR fixes the "Open Folder" link on the Welcome page.

Changes

  • update Welcome Page to use openFolder

Screenshots

Screen.Recording.2021-05-21.at.12.00.08.PM.mov

Checklist

  • tested locally
  • updated CHANGELOG.md

Fixes #2921

Related:

Which theme did you use @jsjoeio , that looks pretty awesome!

@jsjoeio
Copy link
Contributor Author

jsjoeio commented May 24, 2021

Thanks @nooobcoder ! It's this one: https://open-vsx.org/extension/max-SS/Cyberpunk

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.

Cannot 'Open Folder...' on code-server Welcome Page
3 participants