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

Create the Get Started page #435

Closed
shcheklein opened this issue May 18, 2021 · 8 comments
Closed

Create the Get Started page #435

shcheklein opened this issue May 18, 2021 · 8 comments
Assignees
Labels
🎨 design Needs design input or is being actively worked on enhancement New feature or request

Comments

@shcheklein
Copy link
Member

Similar to this Python extension one:

Screen Shot 2021-05-17 at 7 52 43 PM

How and when does it run itself?

@shcheklein shcheklein added 🎨 design Needs design input or is being actively worked on enhancement New feature or request labels May 18, 2021
@shcheklein shcheklein mentioned this issue May 18, 2021
30 tasks
@rogermparent rogermparent self-assigned this May 18, 2021
@rogermparent
Copy link
Contributor

rogermparent commented May 18, 2021

It seems the Python extension uses a configuration option and the ExtensionContext.globalState API to store the state required to determine whether the extension was just installed or the version has changed.

Here's the extensionVersionChanged and activateBackground methods that activates the Python extension's StartPage class and are responsible for automatically opening the start page on first load.

    // Public for testing
    public async extensionVersionChanged(): Promise<boolean> {
        const savedVersion: string | undefined = this.context.globalState.get(EXTENSION_VERSION_MEMENTO);
        const { version } = this.appEnvironment.packageJson;
        let shouldShowStartPage: boolean;

        if (savedVersion) {
            if (savedVersion === version || this.savedVersionisOlder(savedVersion, version)) {
                // There has not been an update
                shouldShowStartPage = false;
            } else {
                sendTelemetryEvent(Telemetry.StartPageOpenedFromNewUpdate);
                shouldShowStartPage = true;
            }
        } else {
            sendTelemetryEvent(Telemetry.StartPageOpenedFromNewInstall);
            shouldShowStartPage = true;
        }

        // savedVersion being undefined means this is the first time the user activates the extension.
        // if savedVersion != version, there was an update
        await this.context.globalState.update(EXTENSION_VERSION_MEMENTO, version);
        return shouldShowStartPage;
    }
    
    // [...]
    
    private async activateBackground(): Promise<void> {
        const settings = this.configuration.getSettings();

        if (settings.showStartPage && this.appEnvironment.extensionChannel === 'stable') {
            // extesionVersionChanged() reads CHANGELOG.md
            // So we use separate if's to try and avoid reading a file every time
            const firstTimeOrUpdate = await this.extensionVersionChanged();

            if (firstTimeOrUpdate) {
                this.firstTime = true;
                this.open().ignoreErrors();
            }
        }
    }

We could start with a simple option to toggle if the welcome page is loaded on activation, and make it easy for the user to opt out if they don't want it after the first load.

@mattseddon
Copy link
Member

We have added a set of quick picks that can be used by any user to setup the workspace for use with DVC. This lets them set two underlying options. The first is the path to the DVC CLI and the second is a path to their preferred Python interpreter for the project (they can choose to rely on the ms-python extension if they would like to). We should incorporate a link to this flow inside of the get started page. We also need to revisit the copy and flow of these quick picks as I am sure that the UI/UX can be improved.

@mattseddon
Copy link
Member

I think we can close this now that we have a walkthrough. WDYT @shcheklein, @rogermparent?

@mattseddon
Copy link
Member

I will investigate what the Python extension does now and then circle back. I have the feeling that they have migrated to a walkthrough now.

@mattseddon
Copy link
Member

mattseddon commented Sep 28, 2021

@rogermparent, @shcheklein the ms-python.python team have removed their custom webview in favour of the walkthrough.

The change happened in this release - https://github.com/microsoft/vscode-python/releases/tag/2021.9.1191016588

This was the issue: microsoft/vscode-python#16453

Closing this now.

@shcheklein
Copy link
Member Author

shcheklein commented Sep 29, 2021

Thanks, Matt! Question - do they launch it after the initial install?

@mattseddon
Copy link
Member

mattseddon commented Sep 29, 2021

At the moment it appears that they do not do that. I will investigate to see if I can make it happen for us.

If you get a new version of VS Code OR open a new workspace then the Welcome page is shown and all of the walkthroughs are on there:

Screen Shot 2021-09-29 at 10 24 57 am

@mattseddon
Copy link
Member

Of course this is how you would make an id for the walkthrough...

const categoryID = extension.identifier.value + '#' + walkthrough.id;

I can fire this once after installation. Will raise a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎨 design Needs design input or is being actively worked on enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants