To further unify the developer experience within the Portal and Documentation apps, we should extend the Neo.component.code.LivePreview component to support Mermaid diagrams.
Current State:
LivePreview expects JavaScript code that exports a Neo.mjs component or VDOM, which it then executes and mounts in the preview area.
New Capability:
Enable LivePreview to accept Mermaid diagram syntax.
Implementation Strategy:
- Detection/Configuration: Add a mechanism to determine if the content is Mermaid code (e.g., a
language config or auto-detection).
- Renderer Switching:
- If JavaScript: Keep existing execution logic.
- If Mermaid: Instantiate
Neo.component.wrapper.Mermaid in the preview container and bind its value to the editor content.
- Editor Integration: Ensure the Monaco Editor uses the correct syntax highlighting for Mermaid.
Benefits:
- Unified "Playground" for both UI widgets and architectural diagrams.
- Simplifies documentation authoring (one component for all live examples).
Implementation intake — Euclid, 2026-11-05
Verdict: valid-as-written, with current owner paths. src/code/LivePreview.mjs already owns explicit language selection and lazy preview creation; it accepts neomjs and markdown only. The diagram renderer already exists at src/component/wrapper/Mermaid.mjs; its addon consumes the built Mermaid module. This extends that path, not a second diagram renderer or syntax inference rule. Existing callers acquire no new obligation.
| Surface / owner |
Contract |
Current-source anchor / verification |
LivePreview.language |
Add explicit mermaid; retain default neomjs and existing Markdown/JavaScript semantics. |
src/code/LivePreview.mjs static languages / afterSetLanguage / doRunSource. |
| LivePreview preview lifecycle |
Reuse the existing Mermaid wrapper with current editor source; switching modes, clearing source, tab teardown and destruction must not leave stale or resurrected preview output. Admit its renderer in the current window before dispatch. |
Existing container ownership, awaited import boundary and worker per-window addon admission; unit and real-browser controls. |
| Monaco wrapper language |
Accept Mermaid and pass its language id through the existing addon API. |
src/component/wrapper/MonacoEditor.mjs languages / afterSetLanguage. |
| Monaco language definition |
Register Mermaid syntax in the existing main-thread Monaco owner before editing; no extra worker or global loader replacement. |
src/main/addon/MonacoEditor.mjs loadFiles / getWorkerUrl; actual model/tokenization browser proof. |
| Markdown live-preview consumer |
A mermaid live-preview fence creates a Mermaid-mode LivePreview; existing fence modes and ordinary Mermaid diagrams remain unchanged. |
src/component/Markdown.mjs processLivePreviewBlocks / render. |
| Error / update behavior |
Existing Mermaid parse-error reporting remains usable; correction and successive edits recover to the latest SVG; empty input clears the old diagram. |
Existing Mermaid wrapper/main addon; real editor-to-worker-to-SVG journey. |
Ticket created 2026-01-17, last updated before pickup 2026-11-05. Current automation marks stale after 90 inactive days and never auto-closes; neither stale nor no-auto-close applies. No open blocker or parent was returned by the live relationship API. Current source was compared with merged dev 4a2706499f276d11672121f4e299dfb9170fd7fb; no matching open PR or same-surface claim was found. Three prior-art queries include original session 2a27c2d0-a09c-4032-b5b0-3c5be930786a; the Knowledge Base also surfaced the closed Mermaid/Monaco loader work, #18564 and #18568. Its current built-module solution remains in use. No new ADR boundary or ticket is proposed. The original author text is preserved.
Acceptance record: author can edit a Mermaid source in LivePreview and see actual SVG, including through a Markdown live-preview fence; current state is missing. Next evidence: red-first language/consumer control, then implementation with existing-mode, latest-update, clear/error-recovery and teardown controls. CI-green PR and one independent reviewer complete the author handoff.
Implementation handoff — 2026-11-05
Implemented in PR #20337, head 24a8e232233021d7394c2813fa716267947a90c3, branched from merged dev 9cd931c970c5b467b901fa71fba585a27d27b272. Final local evidence: 5,881 unit tests passed, 2 skipped; 9 real Chromium LivePreview component cases passed; the retained Dev-only Mermaid pop-out case passed. Browser assertions verify actual Mermaid model/token categories, exact editor/worker source parity, current SVG after rapid edits, clear/error recovery, editable Markdown fences, existing modes, import teardown and readable/contained diagram geometry. Four existing JavaScript Dev pop-out controls also passed on the initial feature candidate.
The real-browser probes exposed two renderer-path defects: overlapping library runs and measuring a hidden host at 0×0. The existing addon now serializes/coalesces queued work by exact target, and local Mermaid construction waits for the visible Preview while external previews remain live. The controlled race arms failed before the fix; the geometry control improved from a clipped 16×16 SVG to a readable 168×152 diagram. An inherited VDOM fixture's implicit DOM-ID setting was also isolated without the new specs and made explicit; the final full suite passed with local socket access permitted.
An actual Mermaid popup then exposed a third defect: the moved wrapper called Neo.main.addon.Mermaid before the addon was loaded in the destination. The wrapper now awaits the worker's existing per-window admission, rejecting stale window/owner results. The retained Mermaid Dev case in LivePreviewMultiWindow.spec.mjs verifies native Source typing updates the real child and closing it restores the latest SVG locally, with no page errors in either window. That file is outside the hosted tier; this receipt is Dev-only and makes no compiled-build claim.
Delivered: final review head 24a8e232233021d7394c2813fa716267947a90c3 passed its hosted checks and independent review. Ada's Round-2 approval discharged the single action by defending the existing ledger. The human operator merged PR #20337 as e17fc1d4c2c7e4e78b22fe9677e566dcc83842bb on 2026-11-05, and #8755 is closed. Source delivery is complete; release and deployed-consumer adoption remain separate states.
CI retained one failed Dock cross-window witness followed by a passing unchanged retry: first job / retry. Both pin Engine d1592c06da90a9a24b3a83a9f263067c86b3a05e and Brain 40a2f62cd33f6cc0da61420f06cbda4064bbdf2d; the retry passed 28/28 without assertion changes. Its cause remains unproved. The post-merge Portal/Docs bundled-asset smoke remains in the PR's validation section.
To further unify the developer experience within the Portal and Documentation apps, we should extend the
Neo.component.code.LivePreviewcomponent to support Mermaid diagrams.Current State:
LivePreviewexpects JavaScript code that exports a Neo.mjs component or VDOM, which it then executes and mounts in the preview area.New Capability: Enable
LivePreviewto accept Mermaid diagram syntax.Implementation Strategy:
languageconfig or auto-detection).Neo.component.wrapper.Mermaidin the preview container and bind itsvalueto the editor content.Benefits:
Implementation intake — Euclid, 2026-11-05
Verdict: valid-as-written, with current owner paths.
src/code/LivePreview.mjsalready owns explicitlanguageselection and lazy preview creation; it acceptsneomjsandmarkdownonly. The diagram renderer already exists atsrc/component/wrapper/Mermaid.mjs; its addon consumes the built Mermaid module. This extends that path, not a second diagram renderer or syntax inference rule. Existing callers acquire no new obligation.LivePreview.languagemermaid; retain defaultneomjsand existing Markdown/JavaScript semantics.src/code/LivePreview.mjsstatic languages / afterSetLanguage / doRunSource.src/component/wrapper/MonacoEditor.mjslanguages / afterSetLanguage.src/main/addon/MonacoEditor.mjsloadFiles / getWorkerUrl; actual model/tokenization browser proof.mermaid live-previewfence creates a Mermaid-mode LivePreview; existing fence modes and ordinary Mermaid diagrams remain unchanged.src/component/Markdown.mjsprocessLivePreviewBlocks / render.Ticket created 2026-01-17, last updated before pickup 2026-11-05. Current automation marks stale after 90 inactive days and never auto-closes; neither stale nor no-auto-close applies. No open blocker or parent was returned by the live relationship API. Current source was compared with merged dev
4a2706499f276d11672121f4e299dfb9170fd7fb; no matching open PR or same-surface claim was found. Three prior-art queries include original session2a27c2d0-a09c-4032-b5b0-3c5be930786a; the Knowledge Base also surfaced the closed Mermaid/Monaco loader work,#18564and#18568. Its current built-module solution remains in use. No new ADR boundary or ticket is proposed. The original author text is preserved.Acceptance record: author can edit a Mermaid source in LivePreview and see actual SVG, including through a Markdown live-preview fence; current state is missing. Next evidence: red-first language/consumer control, then implementation with existing-mode, latest-update, clear/error-recovery and teardown controls. CI-green PR and one independent reviewer complete the author handoff.
Implementation handoff — 2026-11-05
Implemented in PR #20337, head
24a8e232233021d7394c2813fa716267947a90c3, branched from merged dev9cd931c970c5b467b901fa71fba585a27d27b272. Final local evidence: 5,881 unit tests passed, 2 skipped; 9 real Chromium LivePreview component cases passed; the retained Dev-only Mermaid pop-out case passed. Browser assertions verify actual Mermaid model/token categories, exact editor/worker source parity, current SVG after rapid edits, clear/error recovery, editable Markdown fences, existing modes, import teardown and readable/contained diagram geometry. Four existing JavaScript Dev pop-out controls also passed on the initial feature candidate.The real-browser probes exposed two renderer-path defects: overlapping library runs and measuring a hidden host at 0×0. The existing addon now serializes/coalesces queued work by exact target, and local Mermaid construction waits for the visible Preview while external previews remain live. The controlled race arms failed before the fix; the geometry control improved from a clipped 16×16 SVG to a readable 168×152 diagram. An inherited VDOM fixture's implicit DOM-ID setting was also isolated without the new specs and made explicit; the final full suite passed with local socket access permitted.
An actual Mermaid popup then exposed a third defect: the moved wrapper called
Neo.main.addon.Mermaidbefore the addon was loaded in the destination. The wrapper now awaits the worker's existing per-window admission, rejecting stale window/owner results. The retainedMermaid Devcase inLivePreviewMultiWindow.spec.mjsverifies native Source typing updates the real child and closing it restores the latest SVG locally, with no page errors in either window. That file is outside the hosted tier; this receipt is Dev-only and makes no compiled-build claim.Delivered: final review head
24a8e232233021d7394c2813fa716267947a90c3passed its hosted checks and independent review. Ada's Round-2 approval discharged the single action by defending the existing ledger. The human operator merged PR #20337 ase17fc1d4c2c7e4e78b22fe9677e566dcc83842bbon 2026-11-05, and #8755 is closed. Source delivery is complete; release and deployed-consumer adoption remain separate states.CI retained one failed Dock cross-window witness followed by a passing unchanged retry: first job / retry. Both pin Engine
d1592c06da90a9a24b3a83a9f263067c86b3a05eand Brain40a2f62cd33f6cc0da61420f06cbda4064bbdf2d; the retry passed 28/28 without assertion changes. Its cause remains unproved. The post-merge Portal/Docs bundled-asset smoke remains in the PR's validation section.