Repository navigation
[Onboarding] Tutorial entry point - #8244
Conversation
billygriffin
left a comment
There was a problem hiding this comment.
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.
Co-Authored-By: Billy Griffin <[email protected]>
There was a problem hiding this comment.
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.
mac, d6d0c8d
| * 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 |
There was a problem hiding this comment.
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...?
There was a problem hiding this comment.
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.
| return | ||
| } | ||
|
|
||
| const account = this.getDotComAccount() || this.getEnterpriseAccount() |
There was a problem hiding this comment.
What extra considerations are there for supporting enterprise accounts? #8148 (comment)
There was a problem hiding this comment.
I attempted to answer this in the referenced issue #8148 (comment)
| this.props.dispatcher.showPopup({ | ||
| type: PopupType.CreateTutorialRepository, | ||
| account, | ||
| }) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
It looks like for now we'll never return early from this (because
accountisnullorenableTutorialisfalse) 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' | ||
| ) |
There was a problem hiding this comment.
Efficiency nit: we could combine adding and committing into one command with git -am ... and save a little time
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
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 () => { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
|
A couple of clarifying question @niik (nothing blocking) Question 1 I'm wondering -- Is it worth considering adding another entry point (say a menu item)? Question 2
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. |
undo this after #8244 is merged!
Co-Authored-By: Katrina Uychaco <[email protected]>
6546349
Co-Authored-By: Katrina Uychaco <[email protected]>
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.
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
left a comment
There was a problem hiding this comment.
thanks for answering questions and clarifying @niik!


Overview
Closes #8148
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-tutorialon the user's account as well as if there's already a directory calleddesktop-tutorialin the default repository path on the local machine. Other options here would be automatically incrementing repository names to avoid conflict (i.edesktop-tutorial-1,desktop-tutorial-2etc).There were some considerations outlined in the original issue:
This is accomplished by looking at the
isTutorialRepositoryflag 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.☑️
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.