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

[Getting Started] Provide when clauses for workspace tags #121778

Closed
digitarald opened this issue Apr 21, 2021 · 11 comments
Closed

[Getting Started] Provide when clauses for workspace tags #121778

digitarald opened this issue Apr 21, 2021 · 11 comments
Assignees
Labels
feature-request Request for new features or functionality getting-started insiders-released Patch has been released in VS Code Insiders verification-needed Verification of issue is requested verified Verification succeeded
Milestone

Comments

@digitarald
Copy link
Contributor

To make walkthroughs more contextual to the currently open project, they should to be aware what kind of files/packages are in the project.

One of the best (there might be others) existing signals VS Code offers are workspace tags. If they would be available in when clause context, walkthroughs (and other UI elements) could adapt to that to show additional extensions, settings or specialized features.

cc @jureid @JacksonKearl

@digitarald
Copy link
Contributor Author

Via @chrisdias: Workspace tagging happens in LifecyclePhase.Eventually, so the information would only be available after some delay. The other risk is that it would be adding a dependency workspace tags, making later changes harder.

The way config/file extension recommendations work, using file patterns, could be more generic.

@JacksonKearl JacksonKearl added the feature-request Request for new features or functionality label May 3, 2021
@JacksonKearl
Copy link
Contributor

Discussed w/ @kieferrm, considering modifying this to instead give priority to walkthroughs based on files present in workspace. So a TS walkthrough might be top-of-list when ./tsconfig.json exists, and a Java walkthrough is top-of-list when ./Ant.xml exists.

@digitarald
Copy link
Contributor Author

considering modifying this to instead give priority to walkthroughs based on files present in workspace.

For many cases we would duplicate the signals that extensions use to get activated. This could also the existing signal for when a language extension activated because of files in a workspace – combining the workspaceContains and onLanguage activationEvents. Or are there cases when these activation reason could be misleading?

@JacksonKearl
Copy link
Contributor

Scoped this down to be getting started specific. With next insiders, walkthroughs will be able to declare a featuredFor array of globs, when one matches the walkthrough will be promoted to "featured" status, meaning it ranks higher in the list of walkthroughs, has a star on its tile, and renders its description directly on the welcome page.

@jureid
Copy link

jureid commented Aug 17, 2021

@JacksonKearl - for C++, our scenario is that we would change the steps within the walkthrough depending on workspace files (example: if CMakeLists.txt is present, we show the step to install CMake Tools). Should we achieve this by creating separate walkthroughs (one that has the Install CMake Tools step, one that doesn't) and using the featuredFor property? Or would that end up showing both versions of the walkthrough, one is just ranked higher?

@JacksonKearl
Copy link
Contributor

Yes, they would both show up with different ranks. Would it be possible to note in the step's description that the step is only relevant to folks using CMake?

@digitarald
Copy link
Contributor Author

@JacksonKearl the featuring is a nice feature to highlight walkthroughs. Could we also address the need for C++ and for other walkthroughs that need to hide/show steps based on workspace/environment in the same issue, or should I file a new one?

@jureid
Copy link

jureid commented Aug 18, 2021

Yes, they would both show up with different ranks. Would it be possible to note in the step's description that the step is only relevant to folks using CMake?

I think it would be a much better experience to hide/show steps based on if there's a CMakeLists.txt rather than showing all steps and updating the descriptions. The fewer steps in a walkthrough, the better. It's not just that we'd add a step if CMakeLists.txt is present, there are a few steps we'd hide.

AiverReaver pushed a commit to AiverReaver/vscode that referenced this issue Aug 19, 2021
@rzhao271 rzhao271 added the verification-needed Verification of issue is requested label Aug 24, 2021
@alexr00 alexr00 added the verification-steps-needed Steps to verify are needed for verification label Aug 25, 2021
@alexr00
Copy link
Member

alexr00 commented Aug 25, 2021

What's the best way to verify this?

@JacksonKearl
Copy link
Contributor

Using getting started sample, https://github.com/microsoft/vscode-extension-samples/blob/e84ecbf93b11c50f0ad673f8e171769f4deab787/getting-started-sample/package.json#L33, add a featuredFor field to the sample walkthrough. This should be an array of filepaths to search for, if one of them is found then the walkthrough should get a star on the home page and be placed somewhat high in the list:
image
image

A couple known issues: if it's a very large project we may not find the file (the search is cancelled after a short timeout to not cause perf issues), and this is only evaluated on opening the folder for the first time (adding the file in a session will not cause the star to appear)

@JacksonKearl JacksonKearl removed the verification-steps-needed Steps to verify are needed for verification label Aug 26, 2021
@alexr00 alexr00 added the verified Verification succeeded label Aug 26, 2021
@jureid
Copy link

jureid commented Sep 17, 2021

@JacksonKearl - I'm just catching up on this. Is the featuredFor property available?

@github-actions github-actions bot locked and limited conversation to collaborators Oct 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality getting-started insiders-released Patch has been released in VS Code Insiders verification-needed Verification of issue is requested verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

6 participants
@digitarald @rzhao271 @JacksonKearl @alexr00 @jureid and others