Frontmatter
| id | 9520 |
| title | LivePreview: Propagate active theme to popout child window |
| state | Closed |
| labels | bugai |
| assignees | tobiu |
| createdAt | Mar 19, 2026, 5:47 PM |
| updatedAt | Mar 19, 2026, 5:50 PM |
| githubUrl | https://github.com/neomjs/neo/issues/9520 |
| author | tobiu |
| commentsCount | 1 |
| parentIssue | null |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Mar 19, 2026, 5:50 PM |
LivePreview: Propagate active theme to popout child window

tobiu
Mar 19, 2026, 5:49 PM
Input from Gemini 3.1 Pro:
✦ The LivePreview popout window theme propagation issue has been fully resolved.
The core problem was twofold:
- The child app (
apps/portal/childapps/preview/neo-config.json) was missing the newneo-theme-neo-darkandneo-theme-lightoptions in itsthemesarray, causing it to fall back incorrectly.- In
src/code/LivePreview.mjs->onWindowConnect(), the active theme was not being properly cascaded to the new window. Because thepreviewViewcomponent already had itsthemeproperty internally set from its original creation context, applying the theme directly to it again caused a no-op in the config reactivity system (skippingafterSetTheme), meaning the class was never added to the new DOM root.The solution ensures the
neo-config.jsonthemes are fully synchronized with the Portal app. Architecturally, the correct fix was applied by setting the active theme on themainView(the Viewport) of the new popup window instead. The Viewport natively handles setting the root theme, which cascades correctly topreviewViewand all dynamically executed components (like theFormContainer).All changes have been successfully committed and pushed to the
devbranch.
tobiu assigned to @tobiu on Mar 19, 2026, 5:50 PM
tobiu closed this issue on Mar 19, 2026, 5:50 PM
When popping out a LivePreview from a markdown tutorial inside the Portal app, the theme of the popup window does not reliably reflect the current theme of the Portal app (e.g. falling back to light theme even if the Portal uses dark theme).
This happens because:
apps/portal/childapps/preview/neo-config.jsonis missing theneo-theme-neo-darkandneo-theme-lightoptions, causing it to fall back to defaults when one of these is requested.src/code/LivePreview.mjs->onWindowConnect(), the active theme is not explicitly passed to themainViewof the new window. Because thepreviewViewitself already has the theme property internally set from its original creation context, applying the theme topreviewViewdirectly causes a no-op in the reactivity system, meaning the class is never added to the new DOM. Setting it on the window'smainView(the Viewport) resolves this cleanly and naturally cascades variables down.This ticket aims to:
apps/portal/childapps/preview/neo-config.jsonto mirror the Portal app's themes array.src/code/LivePreview.mjsto apply the current theme to the newmainViewduringonWindowConnect().