LearnNewsExamplesServices
Frontmatter
id8074
titleEnhance code.LivePreview to support nested windows
stateClosed
labels
enhancementarchitecture
assigneestobiu
createdAtDec 9, 2025, 10:54 PM
updatedAtDec 9, 2025, 11:08 PM
githubUrlhttps://github.com/neomjs/neo/issues/8074
authortobiu
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtDec 9, 2025, 11:08 PM

Enhance code.LivePreview to support nested windows

Closed v11.17.0 enhancementarchitecture
tobiu
tobiu commented on Dec 9, 2025, 10:54 PM

This ticket covers a significant refactoring of Neo.code.LivePreview and Neo.component.Markdown to support robust, recursive multi-window capabilities.

Key Changes:

  1. Resolved Relative URLs: Implemented beforeSetWindowUrl in LivePreview to resolve ./ paths against the application root. This ensures child app URLs remain valid even when the component is popped out to a new window location.

  2. Architectural Refactor of Markdown Renderer:

    • Removed legacy technical debt where Markdown.mjs modified its parent container's HTML. It now correctly manages its own html state.
    • Removed the explicit context object passing. Components now rely on their own instance state (appName, windowId) for correct context resolution.
    • Added windowUrl config to propagate the correct child app environment to nested LivePreview instances.
  3. Recursive Window Support:

    • Implemented afterSetWindowId in Markdown.mjs to propagate window changes to all active child components (e.g., interactive examples nested within the markdown).
    • This allows for "recursive popping," where a LivePreview can be popped out, and a LivePreview inside that window can be popped out again, maintaining full functionality.
  4. Component Lifecycle & Re-mounting:

    • Updated Container.Base to force mounted = false when moving a component to a different window. This ensures wrappers (like Monaco Editor) correctly re-initialize their main-thread counterparts in the new window context.
    • Hardened MonacoEditor main thread addon to gracefully handle instance lookups during window transitions.

These changes collectively ensure that complex, nested documentation views remain fully interactive and stable when moved between browser windows.

tobiu assigned to @tobiu on Dec 9, 2025, 10:54 PM
tobiu added the enhancement label on Dec 9, 2025, 10:54 PM
tobiu added the architecture label on Dec 9, 2025, 10:54 PM
tobiu referenced in commit 7ffe5ca - "Enhance code.LivePreview to support nested windows #8074" on Dec 9, 2025, 10:55 PM
tobiu
tobiu Dec 9, 2025, 11:08 PM
Image
tobiu closed this issue on Dec 9, 2025, 11:08 PM