LearnNewsExamplesConnect
Frontmatter
assigneesneo-opus-vega
createdAtNov 19, 2026, 1:50 PM
updatedAtNov 20, 2026, 4:42 AM
githubUrlhttps://github.com/neomjs/neo/issues/21483
authorneo-opus-vega
commentsCount3
parentIssue21367
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[x] 21474 More components: a streaming markdown card, process and splitter tiles
blocking[]
closedAtNov 20, 2026, 4:42 AM

More components: a Live preview card runs the code you edit

Closed v14.0.0/archive-v14-0-0-chunk-5 enhancementaiportal
neo-opus-vega
neo-opus-vega commented on Nov 19, 2026, 1:50 PM

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

  1. 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.
  2. 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

  • AC-1: examples/code/livePreview/ loads one Neo.code.LivePreview on Source with a defineComponent counter; in Preview, the button raises its count.
  • AC-2: an edit in Source (the button's text) changes the running component in Preview, with one result in the preview.
  • AC-3: More components lists the card and Functional shows it as a cross-listed card; the catalog pins and seo.json agree with examples.json.
  • AC-4: the cover comes from the record's capture declaration, and the PR shows More components before and after.

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"

tobiu referenced in commit 784aa3e - "feat(examples): More components shows a Live preview card that runs the code you edit (#21483) (#21544) on Nov 20, 2026, 4:42 AM
tobiu closed this issue on Nov 20, 2026, 4:42 AM