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

Add a restart whole tutorial button #476

Closed
moT01 opened this issue Mar 30, 2021 · 8 comments · Fixed by #513
Closed

Add a restart whole tutorial button #476

moT01 opened this issue Mar 30, 2021 · 8 comments · Fixed by #513
Assignees
Labels
bug Something isn't working

Comments

@moT01
Copy link
Contributor

moT01 commented Mar 30, 2021

I'm not sure if this is necessary, but it might be nice to have a button to restart a tutorial from the beginning. Opening an issue for discussion.

@moT01 moT01 added the bug Something isn't working label Mar 30, 2021
@ShMcK
Copy link
Member

ShMcK commented Mar 30, 2021

I can see this as a problem with the online version where's it's not easy to open a new folder.

So far it sounds like a "tutorial settings" may be helpful, something like how GitHub has repo settings.

@SavvyShah
Copy link
Contributor

SavvyShah commented Sep 13, 2021

I am thinking to take up this issue. Here's what I think needs to be done.

  • Show a settings menu which contains the reset option(I have attached an image which has the settings icon on the top right. Clicking on it would open the settings menu. Any suggestions?)
  • Send an event to reset the state
  • Invoke some vscode api to reset the files. (Do we also need to delete commits?)

Did I miss something else?

image

@ShMcK
Copy link
Member

ShMcK commented Sep 14, 2021

Settings Page

A settings page makes a lot of sense. There is definitely more functionality that could be added there.

Resetting a Tutorial

There is some existing logic for resetting to a commit in src/services/reset/index.ts.
I think the idea would be to reset to the hash of level 1 step 1.

A step can contain more than one hash, so you'd have to take the last one.

Also note that the reset events needs to be passed to the local vscode server (the code inside of src). The web portion does not have access to run on the file system.

@SavvyShah
Copy link
Contributor

SavvyShah commented Sep 14, 2021

Yes. I found an already existing settings page. I've also reused the Reset button component if that's ok.
This still needs some work, should I open a PR?

Feature branch
settings-page

@moT01
Copy link
Contributor Author

moT01 commented Sep 14, 2021

Would there be a way to make it completely reset to the point where it's as if you just started a tutorial? Like empty out the workspace folder, and re-clone the repo or something?

@ShMcK
Copy link
Member

ShMcK commented Sep 15, 2021

That's also possible.

Deleting all files is a bit scary, maybe reset to the empty first commit, then run the init action again.

@SavvyShah
Copy link
Contributor

SavvyShah commented Sep 18, 2021

Do we end up in a unclean state if we reset to level 1 step 1 and not use the other approaches above?

@SavvyShah
Copy link
Contributor

So I have made a PR on based of the first solution which is reseting to level 1 step 1. I think that works fine and we can improve further on this base.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants