Frontmatter
| id | 9519 |
| title | SharedWorker: Fix theme resolution for child windows |
| state | Closed |
| labels | bugai |
| assignees | tobiu |
| createdAt | Mar 19, 2026, 4:13 PM |
| updatedAt | Mar 19, 2026, 4:16 PM |
| githubUrl | https://github.com/neomjs/neo/issues/9519 |
| author | tobiu |
| commentsCount | 1 |
| parentIssue | null |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Mar 19, 2026, 4:16 PM |
SharedWorker: Fix theme resolution for child windows
tobiu assigned to @tobiu on Mar 19, 2026, 4:13 PM

tobiu
Mar 19, 2026, 4:15 PM
Input from Gemini 3.1 Pro:
✦ The theme resolution bug for subsequent windows has been fully resolved.
The core issue was that child applications connecting via SharedWorkers were falling back to the original Portal's
Neo.config.themesduring CSS injection and variable setting. This caused new windows with distinct theme requirements (e.g.neo-theme-cyberpunkvsneo-theme-dark) to incorrectly inherit the portal's theme rules.The comprehensive fix decoupled theme operations from the static global
Neo.configby ensuring that context is pulled directly fromNeo.windowConfigs[windowId]:
src/worker/App.mjs:insertThemeFiles()was updated to use the window-specific configuration object when checking for the presence of themes.src/worker/App.mjs:setCssVariable()was similarly updated to use the window-specific configuration for setting dynamic CSS variables correctly within the requested theme environment.src/component/Base.mjs: ThegetTheme()method, which walks up the VDOM tree, was updated to useNeo.windowConfigs[me.windowId]as the fallback instead of the globalNeo.config.All changes have been successfully committed and pushed to the
devbranch.
tobiu closed this issue on Mar 19, 2026, 4:16 PM
When multiple windows connect to a SharedWorker, they can specify different themes inside their
neo-config.json. Currently, theAppworker falls back toNeo.config.themes(which is the configuration of the initial window) when resolving and injecting theme files or CSS variables. This can cause child applications to load incorrect themes or fail to load their specific theme files entirely.This ticket aims to update:
src/worker/App.mjs->insertThemeFiles()to useNeo.windowConfigs[windowId].themes.src/worker/App.mjs->setCssVariable()to useNeo.windowConfigs[windowId].themes.src/component/Base.mjs->getTheme()to useNeo.windowConfigs[windowId].themes.