-
Notifications
You must be signed in to change notification settings - Fork 581
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 "Hide Done" Option for Tutorials #10248
Merged
Merged
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
1ca8406
Add an option to hide Done in tutorials
thsparks 9b7103d
Merge branch 'master' of https://github.com/microsoft/pxt into thspar…
thsparks d640d67
Add docs
thsparks ebace3b
Add tests
thsparks ac3f599
Do not create specific property in TutorialContainer for hideDone
thsparks File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"editor": "blocksprj", | ||
"title": "Hide Done", | ||
"steps": [ | ||
{ | ||
"contentMd": "Tutorials can choose to hide the done button on the final step. This metadata is parsed and removed.", | ||
"headerContentMd": "Tutorials can choose to hide the done button on the final step. This metadata is parsed and removed." | ||
}, | ||
{ | ||
"contentMd": "Tutorial parsing for hints, steps, etc should function exactly as before.\n\n```blocks\nlet x = 8;\nlet y = x + 2;\n```", | ||
"headerContentMd": "Tutorial parsing for hints, steps, etc should function exactly as before.", | ||
"hintContentMd": "```blocks\nlet x = 8;\nlet y = x + 2;\n```" | ||
} | ||
], | ||
"activities": null, | ||
"code": [ | ||
"{\nlet x = 8;\nlet y = x + 2;\n}", | ||
"{\nbasic.showIcon(IconNames.Square)\n}" | ||
], | ||
"metadata": { | ||
"hideDone": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"editor": "blocksprj", | ||
"title": "Hide Toolbox", | ||
"steps": [ | ||
{ | ||
"contentMd": "Tutorials can choose to hide the toolbox. This metadata is parsed and removed.", | ||
"headerContentMd": "Tutorials can choose to hide the toolbox. This metadata is parsed and removed." | ||
}, | ||
{ | ||
"contentMd": "Tutorial parsing for hints, steps, etc should function exactly as before.\n\n```blocks\nlet x = 8;\nlet y = x + 2;\n```", | ||
"headerContentMd": "Tutorial parsing for hints, steps, etc should function exactly as before.", | ||
"hintContentMd": "```blocks\nlet x = 8;\nlet y = x + 2;\n```" | ||
} | ||
], | ||
"activities": null, | ||
"code": [ | ||
"{\nlet x = 8;\nlet y = x + 2;\n}", | ||
"{\nbasic.showIcon(IconNames.Square)\n}" | ||
], | ||
"metadata": { | ||
"hideToolbox": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Hide Done | ||
|
||
### @hideDone true | ||
|
||
## Introduction | ||
|
||
Tutorials can choose to hide the done button on the final step. This metadata is parsed and removed. | ||
|
||
## Step with hint | ||
|
||
Tutorial parsing for hints, steps, etc should function exactly as before. | ||
|
||
```blocks | ||
let x = 8; | ||
let y = x + 2; | ||
``` | ||
|
||
```ghost | ||
basic.showIcon(IconNames.Square) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Hide Toolbox | ||
|
||
### @hideToolbox true | ||
|
||
## Introduction | ||
|
||
Tutorials can choose to hide the toolbox. This metadata is parsed and removed. | ||
|
||
## Step with hint | ||
|
||
Tutorial parsing for hints, steps, etc should function exactly as before. | ||
|
||
```blocks | ||
let x = 8; | ||
let y = x + 2; | ||
``` | ||
|
||
```ghost | ||
basic.showIcon(IconNames.Square) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit torn about this. I see that we created shortcuts for other
tutorialOptions.metadata
fields before, but I'm not sure of the benefit here. Since we're addinghideDone
to the metadata, could we just grab it from the tutorial options? ThehideDone
flag definitely belongs in the metadata, but it feels a bit different to me than the other metadata fields that we decided to pass directly into theTutorialContainer
. I don't feel strongly about this, especially for this case, but I wanted to bring it up to have a conversation of if there are things that we want to customize about tutorials in the future, should we add an optional prop to theTutorialContainer
, or should we leave it in thetutorialOptions
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm okay to just read it from metadata (which is already passed in), so I'll make that change.
I could see a theoretical argument towards making TutorialContainer useable without all our tutorial & tutorial metadata classes, but I don't see that being useful in practicality and it's a moot point anyway since we also already pass in the metadata itself.