-
-
Notifications
You must be signed in to change notification settings - Fork 222
feat: add 'Open in Playground' button to learn modules #877
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,7 +2,7 @@ | |
|
|
||
| export const steps = [ | ||
| { title: "Overview", link: "/learn/intro" }, | ||
| { title: "Module 1", link: "/learn/module1" }, | ||
| { title: "Module 2", link: "/learn/module2" }, | ||
| { title: "Module 3", link: "/learn/module3" }, | ||
| { title: "Module 1", link: "/learn/module1", sampleName: "Hello World" }, | ||
| { title: "Module 2", link: "/learn/module2", sampleName: "Formula Now" }, | ||
| { title: "Module 3", link: "/learn/module3", sampleName: "Join" }, | ||
|
Comment on lines
+5
to
+7
|
||
| ]; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -234,8 +234,11 @@ const useAppStore = create<AppState>()( | |
| init: async () => { | ||
| const params = new URLSearchParams(window.location.search); | ||
| const compressedData = params.get("data"); | ||
| const sampleName = params.get("sample"); | ||
| if (compressedData) { | ||
| await get().loadFromLink(compressedData); | ||
| } else if (sampleName) { | ||
| await get().loadSample(sampleName); | ||
| } else { | ||
| await get().rebuild(); | ||
| } | ||
|
Comment on lines
234
to
244
|
||
|
|
||
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.
The new "Open in Playground" button introduces a new learn→playground navigation path, but there’s no component test covering that the button renders for modules with a
sampleNameand that clicking it navigates to/?sample=.... Given existing component tests insrc/tests/components, adding a test for this behavior would help prevent regressions.