Context
#21367's order puts More components in two parts. Part 1 is #21474 → #21479 (the streaming markdown card, the process and splitter tiles). Part 2 is this card. The catalog plan's row on #21140 names it: "Live preview: edit code and watch it run (src/code/LivePreview.mjs, the Portal's own editor)". Mnemosyne's Functional Components row on #21142 (comment 6980292611) asks for a function beside its result there, so the card is cross-listed in Functional.
The Problem
Every runnable example on the learn pages runs in Neo.code.LivePreview, and the catalog has no card for it. A reader of More components cannot see that a page can carry code that runs as it is edited, and Functional has no card that shows a function component's source next to the component it makes.
The Architectural Reality
src/code/LivePreview.mjs: Neo.code.LivePreview (ntype: 'live-preview') is a tab.Container pair: Source (a Neo.component.wrapper.MonacoEditor) and Preview (a container the code renders into). activeView_ is 'source' (valid: preview, source), language_ is 'neomjs' (also markdown, mermaid), value_ is the code. It is tabs, not a split view.
- The editor needs the
MonacoEditor main-thread addon; the Portal lists it in apps/portal/neo-config.json. neomjs code runs through src/code/executor/Neo.mjs.
- Content precedent:
learn/UsingTheseTopics.md:57, a defineComponent counter whose button text follows its useConfig state. Its imports are relative (../functional/_export.mjs); the example checks how the executor resolves them outside the Portal.
- #21460 (closed by #21461): a superseded run no longer leaves a second result in the preview. Quick edits in this card depend on it.
- Placement:
examples/code/livePreview/ mirrors src/code/ (no examples/code/ exists yet). Siblings carry app.mjs, index.html, neo-config.json and MainContainer.mjs (examples/component/markdown/).
- Catalog: one record in
apps/portal/resources/data/examples.json (family components, alsoIn: ['functional']; 15 records use alsoIn today), its capture in example-captures.json, its cover in neomjs/pages, the pins in MainContainerController.spec.mjs and ExamplesCatalogNL.spec.mjs, and seo.json from getSeoJson().
The Fix
examples/code/livePreview/: one Neo.code.LivePreview whose value is a functional counter, with the MonacoEditor addon in its neo-config.json. It opens on Source, the engine's default, so the first screen is the function; Preview runs it.
- The catalog record (home
components, alsoIn: ['functional']), its capture and cover. Every count and pin is re-derived from the merged examples.json, and seo.json comes from getSeoJson() (defect-note 23376c93: merged pins take one side).
Acceptance Criteria
Out of Scope
- Engine changes to
Neo.code.LivePreview, including a split view (it is a tab pair) and its Mermaid unit spec (#21443).
- Cards for the
markdown and mermaid languages.
Avoided Traps
- A hand-made editor and container side by side: it would re-implement LivePreview, and the card exists to show the engine's own editor.
- Pins moved by hand after a merge: they take one side's number (defect-note 23376c93).
Related
Parent #21367 · part 1 #21474 · catalog plan #21140 · Functional row #21142 · #21460 / #21461 · #21443
Live latest-open + closed sweep: latest 20 open, open search "live preview" and closed search "LivePreview example" at 2026-11-19T12:55Z. No equivalent; #21460 (closed) is the engine fix this card relies on, and #21443 is LivePreview's Mermaid unit spec, not a catalog card. Backlog band: 79 open (red), so this files as a leaf of the owning epic #21367. A2A sweep: no claim on a live-preview card among the latest 30 lane claims. Memory Core sweep: no earlier card. Own assignments: #21474 is this leaf's sibling. Structure map: N/A, an example folder mirroring src/code/.
Ownership: self-assigned; it is the last More components leaf of my #21367 lane (lock Sun 22 Nov, 18:00 CET).
Origin Session ID: 99498500-e908-4179-ab7d-897506aa4343
Retrieval Hint: "More components part 2 live preview card LivePreview example functional counter alsoIn functional"
Context
#21367's order puts More components in two parts. Part 1 is #21474 → #21479 (the streaming markdown card, the process and splitter tiles). Part 2 is this card. The catalog plan's row on #21140 names it: "Live preview: edit code and watch it run (
src/code/LivePreview.mjs, the Portal's own editor)". Mnemosyne's Functional Components row on #21142 (comment 6980292611) asks for a function beside its result there, so the card is cross-listed in Functional.The Problem
Every runnable example on the learn pages runs in
Neo.code.LivePreview, and the catalog has no card for it. A reader of More components cannot see that a page can carry code that runs as it is edited, and Functional has no card that shows a function component's source next to the component it makes.The Architectural Reality
src/code/LivePreview.mjs:Neo.code.LivePreview(ntype: 'live-preview') is atab.Containerpair: Source (aNeo.component.wrapper.MonacoEditor) and Preview (a container the code renders into).activeView_is'source'(valid:preview,source),language_is'neomjs'(alsomarkdown,mermaid),value_is the code. It is tabs, not a split view.MonacoEditormain-thread addon; the Portal lists it inapps/portal/neo-config.json.neomjscode runs throughsrc/code/executor/Neo.mjs.learn/UsingTheseTopics.md:57, adefineComponentcounter whose button text follows itsuseConfigstate. Its imports are relative (../functional/_export.mjs); the example checks how the executor resolves them outside the Portal.examples/code/livePreview/mirrorssrc/code/(noexamples/code/exists yet). Siblings carryapp.mjs,index.html,neo-config.jsonandMainContainer.mjs(examples/component/markdown/).apps/portal/resources/data/examples.json(familycomponents,alsoIn: ['functional']; 15 records usealsoIntoday), its capture inexample-captures.json, its cover in neomjs/pages, the pins inMainContainerController.spec.mjsandExamplesCatalogNL.spec.mjs, andseo.jsonfromgetSeoJson().The Fix
examples/code/livePreview/: oneNeo.code.LivePreviewwhosevalueis a functional counter, with theMonacoEditoraddon in itsneo-config.json. It opens on Source, the engine's default, so the first screen is the function; Preview runs it.components,alsoIn: ['functional']), its capture and cover. Every count and pin is re-derived from the mergedexamples.json, andseo.jsoncomes fromgetSeoJson()(defect-note 23376c93: merged pins take one side).Acceptance Criteria
examples/code/livePreview/loads oneNeo.code.LivePreviewon Source with adefineComponentcounter; in Preview, the button raises its count.seo.jsonagree withexamples.json.Out of Scope
Neo.code.LivePreview, including a split view (it is a tab pair) and its Mermaid unit spec (#21443).markdownandmermaidlanguages.Avoided Traps
Related
Parent #21367 · part 1 #21474 · catalog plan #21140 · Functional row #21142 · #21460 / #21461 · #21443
Live latest-open + closed sweep: latest 20 open, open search "live preview" and closed search "LivePreview example" at 2026-11-19T12:55Z. No equivalent; #21460 (closed) is the engine fix this card relies on, and #21443 is LivePreview's Mermaid unit spec, not a catalog card. Backlog band: 79 open (red), so this files as a leaf of the owning epic #21367. A2A sweep: no claim on a live-preview card among the latest 30 lane claims. Memory Core sweep: no earlier card. Own assignments: #21474 is this leaf's sibling. Structure map: N/A, an example folder mirroring
src/code/.Ownership: self-assigned; it is the last More components leaf of my #21367 lane (lock Sun 22 Nov, 18:00 CET).
Origin Session ID: 99498500-e908-4179-ab7d-897506aa4343 Retrieval Hint: "More components part 2 live preview card LivePreview example functional counter alsoIn functional"