Frontmatter
| id | 9518 |
| title | Fix LivePreview incorrect popout URL for subsequent windows (SharedWorkers) |
| state | Closed |
| labels | bugai |
| assignees | tobiu |
| createdAt | Mar 19, 2026, 1:44 PM |
| updatedAt | Mar 19, 2026, 3:38 PM |
| githubUrl | https://github.com/neomjs/neo/issues/9518 |
| author | tobiu |
| commentsCount | 2 |
| parentIssue | null |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Mar 19, 2026, 3:25 PM |
Fix LivePreview incorrect popout URL for subsequent windows (SharedWorkers)

Input from Gemini 3.1 Pro:
✦ The issue has been fully resolved.
The root cause of the bug expanded beyond just
LivePreviewURL generation. The core issue was that child applications connecting via SharedWorkers were failing to correctly identify their uniquewindowId, falling back to the original Portal'swindowIdduring the boot sequence. This caused the new child app'smainViewto render into the Portal's DOM (effectively replacing the entire portal app viewport) instead of its own popup window.The comprehensive fix implements explicit context passing for the boot sequence while decoupling it from the static global
Neo.config:
src/worker/Manager.mjs: Now explicitly includeswindowId: this.windowIdin theloadApplicationmessage payload sent to the App worker.src/worker/App.mjs:onLoadApplicationnow uses the correctappPathderived fromNeo.windowConfigs[data.windowId]. Crucially, it sets a synchronousNeo.bootingWindowIdflag specifically for the duration of themodule.onStart()execution tick to pass context down the stack.src/controller/Application.mjs: Updated both theconstructandbeforeSetMainViewmethods to use the instance's properthis.windowId(inherited via the boot flag) instead of statically falling back toNeo.config.windowId.src/component/Circle.mjs,Gallery.mjs, &Helix.mjs: Updated to dynamically retrieve path variables fromNeo.windowConfigsinafterSetWindowIdto support distinct base paths across multiple active windows.All changes have been committed and pushed to the
devbranch.

The initial LivePreview routing bug and the subsequent multi-window routing regressions have been resolved. The fix involves explicitly passing the windowId during application boot to decouple the boot sequence from the flapping global Neo.config, allowing child applications to accurately resolve their respective configurations directly from Neo.windowConfigs.
The root cause of the initial LivePreview popout bug was that the child app configuration (specifically the
appPath) was incorrectly being merged into the globalNeo.configviaworker.Base'sonRegisterNeoConfigmethod during SharedWorker setups.The fix involved decoupling the boot sequence from the static global
Neo.configwhile avoiding the constant state 'flapping' that caused the bug:src/worker/Base.mjs: Hardened to strictly merge the initial window connection data intoNeo.config. Child apps' configs are securely kept withinNeo.windowConfigs.src/worker/Manager.mjs: Now explicitly includeswindowId: this.windowIdin theloadApplicationmessage payload sent to the App worker.src/worker/App.mjs:onLoadApplicationnow uses the correctappPathderived fromNeo.windowConfigs[data.windowId]. It sets a synchronousNeo.bootingWindowIdflag specifically for the duration of themodule.onStart()execution tick to pass context down the stack. It also conditionally fetches thetheme-map.jsononly once using a newthemeMapFetchStartedflag.src/controller/Application.mjs: Updated both theconstructandbeforeSetMainViewmethods to use the instance's properthis.windowId(inherited via the boot flag) instead of statically falling back toNeo.config.windowId.src/code/LivePreview.mjs: UpdatedbeforeSetWindowUrlto dynamically access the active window'sappPathdirectly fromNeo.windowConfigs[windowId], preventing URL segment duplication (childapps/preview/).src/component/Circle.mjs,Gallery.mjs, &Helix.mjs: Updated to dynamically retrieve path variables fromNeo.windowConfigsinafterSetWindowIdto support distinct base paths across multiple active windows.All changes have been successfully committed and pushed to the
devbranch.