Skip to content

[Onboarding] Tutorial entry point - #8244

Merged
outofambit merged 51 commits into
developmentfrom
tutorial-entry-point
Sep 16, 2019
Merged

outofambit merged 51 commits into
developmentfrom
tutorial-entry-point

Conversation

@niik

@niik niik commented Sep 10, 2019 •

Copy link
Copy Markdown
Member

Overview

Closes #8148

2019-09-10 16-11-16 2019-09-10 16_13_55

Description

This PR addresses the initial portion of the onboarding tutorial, namely the creation of the tutorial repository. It's based on #8211 and implements the stub parts of that PR.

Given that we're working towards a fairly hard deadline with the onboarding project I've tried to optimize for the fastest approach to getting something up for review here and follow up with more PRs as necessary rather than sitting on this for too long.

As such I've chosen to just throw an error if there's already a repository names desktop-tutorial on the user's account as well as if there's already a directory called desktop-tutorial in the default repository path on the local machine. Other options here would be automatically incrementing repository names to avoid conflict (i.e desktop-tutorial-1, desktop-tutorial-2 etc).

There were some considerations outlined in the original issue:

  1. This issue includes being able to detect in Desktop that a given repo is a tutorial repo and should therefore display the tutorial steps.

This is accomplished by looking at the isTutorialRepository flag on the Repository model as outlined in #8211. Worth noting here is that this flag is set and persisted when creating the repository but it does not persist if you remove and re-add the repository. There's no mechanism for detecting if any arbitrary repository is a desktop onboarding tutorial repository.

  1. This issue also includes the actual content for the tutorial repository and what it will include.

☑️

  1. Since we're creating a repository for them, do we need to expose the local path for where the repository will be saved on their computer somehow?

I've opted to just create the repository in the default directory for now but I'm open to changing this in a subsequent PR if we decide that's what we want.

@niik niik added the ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Sep 10, 2019
@niik niik changed the title Tutorial entry point [Onboarding] Tutorial entry point Sep 10, 2019

@billygriffin billygriffin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is so exciting! I'm not wedded to my suggestion, but I do want to make clear that the repo won't be visible to anyone except for them.

@tierninho
tierninho self-requested a review September 10, 2019 19:34
tierninho
tierninho previously approved these changes Sep 10, 2019

@tierninho tierninho left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All tests passed on this. ✅

One suggestion for a future iteration:

Add some additional help buttons to the error messages. Perhaps Show in Finder for local error, and Open in GithHub for remote error. New users might have some trouble finding the new repo.

Screen Shot 2019-09-10 at 8 47 54 AM
Screen Shot 2019-09-10 at 8 53 56 AM

mac, d6d0c8d

billygriffin
billygriffin previously approved these changes Sep 10, 2019
kuychaco
kuychaco previously approved these changes Sep 12, 2019

@kuychaco kuychaco left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great @niik ! ✨✨✨

Left some non-blocking comments/questions

* This method differs from the `_addRepositories` method in that it
* requires that the repository has been created on the remote and
* set up to track it. Given that tutorial repositories are created
* from the no-repositories blank slate it shouldn't be possible for

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from the no-repositories blank slate it shouldn't be possible for another repository with the same path to exist

Is it true that we could be in a no-repositories blank slate (ex: Desktop just installed) but the user could still have a repo with the tutorial name convention in their home folder...?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sorry, what I meant was that it shouldn't be possible for another repository with the same path to exist in the repositories table given that the no-repositories blank slate is only ever shown when that table is empty. I'll clarify in the documentation.

Comment thread app/src/ui/app.tsx
return
}

const account = this.getDotComAccount() || this.getEnterpriseAccount()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What extra considerations are there for supporting enterprise accounts? #8148 (comment)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I attempted to answer this in the referenced issue #8148 (comment)

Comment thread app/src/ui/app.tsx
this.props.dispatcher.showPopup({
type: PopupType.CreateTutorialRepository,
account,
})

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed that we don't provide feedback to the users in the cases where we return early from this method. Which could mean we leave the user hanging in an confusing/awkward way.

It looks like for now we'll never return early from this (because account is null or enableTutorial is false) because we don't even display the button to create a tutorial repo if those conditions aren't met (https://github.com/desktop/desktop/pull/8244/files#diff-90d158a911410430c657d180c2557931R344-R355).

However, I'm wondering if it's still worth providing some feedback because there's always the chance that the code changes such that we hit these cases (ex: we add a keyboard shortcut). It could be worthwhile to display a message or something (ex: letting them know that they need to set up a dotcom or enterprise account) just for good measure.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like for now we'll never return early from this (because account is null or enableTutorial is false) because we don't even display the button to create a tutorial repo if those conditions aren't met

Correct

I'm wondering if it's still worth providing some feedback because there's always the chance that the code changes such that we hit these cases (ex: we add a keyboard shortcut). It could be worthwhile to display a message or something (ex: letting them know that they need to set up a dotcom or enterprise account) just for good measure.

Yeah, this is always a balance that can be argued either way. In this case I'm happy with the risk as-is but if we end up adding a menu item or keyboard shortcut which itself is still enabled when the user isn't signed in I agree that we should add such a message.

Staying hypothetical here, if I were do to something to future-proof this it would be leveraging the type system to ensure that we don't call this method unless we do have an account. I'd do this by making a non-nullable Account instance a required parameter to this method and passing it along from the blank slate (where we do the initial assertion and type-narrowing on Account). For me to do that now, however, would require me to create a small wrapper component instead of the renderButtonGroupButton method which feels, to me, a bit overkill for the risk involved and the time pressure we're under to get the tutorial out on time.

['commit', '-m', 'Initial commit', '--', 'README.md'],
path,
'tutorial:commit'
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Efficiency nit: we could combine adding and committing into one command with git -am ... and save a little time

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Efficiency nit: we could combine adding and committing into one command with git -am ... and save a little time

I was under the impression that -a only considers tracked files but if you've got a trick up your sleeve I'm all ears.

outofambit
outofambit previously approved these changes Sep 12, 2019

@outofambit outofambit left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks good to me, thank you @niik! just one question, but i don't think its a blocking one. 🤸‍♀

await git(args, path, 'tutorial:push', pushOpts)
}

public onSubmit = async () => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

non-blocking, but i'm curious why we're doing this much logic in a react component method. the pattern i would expect would be to call something on dispatcher and make the round trip through app-store and its state. i know that's a bit more boilerplate, so i could see this getting pulled out later or perhaps there's some edge cases or complexity we're avoiding with this approach?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perhaps there's some edge cases or complexity we're avoiding with this approach?

No edge cases, just complexity. I don't think we'd be gaining anything by moving this logic to a dispatcher/appstore method since the state contained within this component isn't depended upon or shared with any other part of the application.

Similar patterns can be found in CreateRepository, and 'AddExistingRepository' and stands out from for example PublishRepository where the progress of the publish operation is shared through app state in order to be communicated to the user through components outside of the publish dialog. The publish operation is also special because it mutates the repository instance itself.

If we were to move this to an App Store method now we'd just be marshalling the progress state through AppState. I also opted for just calling the git methods directly because we don't have a Repository instance at this time and changing it such that we did caused more problems than it was worth IMO.

@kuychaco

Copy link
Copy Markdown
Contributor

A couple of clarifying question @niik (nothing blocking)

Question 1
So currently the only entry point to the onboarding tutorial is the button that shows up in the no-repositories blank slate view... so if the user adds a repo then they can't get create a tutorial repo.

I'm wondering -- Is it worth considering adding another entry point (say a menu item)?

Question 2
And if a user creates a tutorial repo, removes it and then re-adds it, then is it fair to say that they will have a tough time getting back to the tutorial based on what you're saying here:

Worth noting here is that this flag is set and persisted when creating the repository but it does not persist if you remove and re-add the repository. There's no mechanism for detecting if any arbitrary repository is a desktop onboarding tutorial repository.

My understanding is that if they did this, they'd find themselves without the onboarding tutorial panel because the flag didn't persist. And have no indication for why, or what steps to take to get back to the onboarding tutorial state. Or maybe I'm missing something, which is toootally possible.

I know this is pretty edge casey and I don't think it needs to be addressed in this PR (if at all), just wondering about it.

@outofambit outofambit self-assigned this Sep 13, 2019
outofambit added a commit that referenced this pull request Sep 13, 2019
Co-Authored-By: Katrina Uychaco <[email protected]>
@niik

niik commented Sep 16, 2019

Copy link
Copy Markdown
Member Author

I'm wondering -- Is it worth considering adding another entry point (say a menu item)?

I think @billygriffin and/or @ampinsk would be best suited to provide context around the current thinking. Personally I feel, given that we're specifically targeting new users, that a dedicated button in the blank slate is a good first step.

My understanding is that if they did this, they'd find themselves without the onboarding tutorial panel because the flag didn't persist. And have no indication for why, or what steps to take to get back to the onboarding tutorial state.

Yup, that's correct. An approach where the repository could be removed and re-added would likely require us to store some sort of indicator or marker in the repository itself and logic to determine whether a repository being added to the application has that marker. Seeing as this ought to be (as you've already identified) an edge case, I opted for the least invasive approach. If this were to become a requirement I'd be happy to look at it changing it but for now I'm content with calling out the behavior here so that everyone understands the constraints.

@outofambit outofambit left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for answering questions and clarifying @niik!

@outofambit
outofambit merged commit d8665f8 into development Sep 16, 2019
@rafeca
rafeca deleted the tutorial-entry-point branch July 22, 2020 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

epic:onboarding ready-for-review Pull Requests that are ready to be reviewed by the maintainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Onboarding tutorial: entry point

5 participants