Repository navigation
canvas page
github-actions[bot] edited this page Oct 12, 2026
·
4 revisions
-
Route:
/p/:slug(and legacy/guide/*,/syntax/*) -
Host Component:
apps/playground/app/canvas/ScrollCanvasPage.tsx/MarkdownCanvasPage.tsx -
Domain Models:
Page,Note,Notesource (rawContent + occurrence map; saved states inBlockRevision)
-
RunwayAdapter(apps/playground/app/canvas/RunwayAdapter.tsx). Continuous scroll runway for staged tutorial steps. -
RunwayShell(apps/playground/app/canvas/RunwayShell.tsx). Shared sticky window and measured editor/caption split for home and guide runways. -
GuideRunwayGroups(apps/playground/app/canvas/GuideRunwayGroups.tsx). Small semantic runs for all eight/guide/*chapters, with the full existing lesson content in the caption rail. -
CanvasSection(apps/playground/app/components/molecules/CanvasSection.tsx). Individual stage card with narrative text and challenge badges. -
EditorWindow(apps/playground/app/components/organisms/editor/EditorWindow.tsx). Interactive CodeMirror window embedded in the canvas.
-
useCanvasRuntime(apps/playground/app/hooks/useCanvasRuntime.ts). Manages live execution state and challenge completions. -
useScrollQuests(apps/playground/app/canvas/useScrollQuests.ts). Tracks milestone scroll progress. -
useSyntaxChallenge(apps/playground/app/hooks/useSyntaxChallenge.ts). Evaluates user edits against syntax validation rules.
- Normal-motion guides: Semantic groups share the home tour's sticky runway. The editor occupies three fifths of the available row and the active lesson occupies two fifths.
- Stage changes: Scrolling forward or backward loads the active lesson's source. Scrolling within the same source-owning lesson preserves edits.
- Home learning: "Learning with Examples" introduces six chapter stages using the same runway as the preceding four sections. Each stage has its own example, explanation, quest progress, and guide link.
- Navigation: Heading links land inside the corresponding stage. Reference and What's Next sections remain in normal document flow.
- Normal motion: The same sticky window stacks the editor above the active caption when the measured container cannot fit the split layout. Long captions scroll within their rail.
- Reduced motion: Guides use the flowing canvas layout. Home learning shows stacked chapter cards and explicit Load example buttons instead of scroll-driven swaps.
- Interactive controls: Run, Try-it, example selection, guide links, and quest actions remain available in both presentations.
-
Live Local Edits with Protected Source:
- Users can freely edit and run code examples inside canvas pages.
- Edits remain local to the active session; teaching source files are protected from unintentional mutation.
-
Frontmatter visibility:
- Home and syntax-guide examples hide frontmatter and the Add property, Add tag, and Edit YAML controls. Metadata remains in the document for parsing, running, and sharing.
- Set
showFrontmatter: truein a guide's page frontmatter to show those properties and controls, including guides that use ascrollblock. Setfalseto hide them on other canvas pages. - Embedded
EditorWindowdemos default to hidden frontmatter and acceptshowFrontmatter={true}. FullNoteEditorinstances still show it by default and acceptshowFrontmatter={false}.
-
Quest Ledger Synchronization:
- Completing interactive challenges updates local storage quest milestones and unlocks subsequent sections.