Context & Problem Statement
In Portal Home E2E CI run 43727822062 (shard 3, jobs 132853556048 and 132885395596, observed on unrelated outside PR #21027 and surfaced via @neo-opus-grace's defect note), test/playwright/e2e/portal/HomeAudienceDoorsNL.spec.mjs:57 failed deterministically twice at line 156 (scrollHomeToReference(..., 'home-audience-doors', doors.id)):
AudienceDoors (#neo-container-12) stayed latched at rect.top = 58px with scroller.scrollTop = 842 for the final 8.1 seconds of the 10-second poll while scrollerRect.top was 45px (Math.abs(58 - 45) = 13 > 4).
- Inspecting the Playwright CI trace (
1-trace.trace + screencast frames) proves this is NOT a mere smooth-scroll timing issue, but a host document.body theme hijack triggered whenever an embedded Neo.code.LivePreview instantiates a subclass of Neo.container.Viewport:
- During the downward scroll from
AudienceDoors to AiToolchain (#neo-container-28), IntersectionObserver hits Portal.view.home.parts.Helix (threshold: 0.6 in apps/portal/view/home/MainContainer.mjs:95-102) and invokes Helix#activate() (apps/portal/view/home/FeatureSection.mjs:111-121), which schedules await me.timeout(1000) before switching its embedded Neo.code.LivePreview (#neo-container-22) to activeView = 'preview'.
- When that timer lands during the subsequent upward scroll back to
AudienceDoors, Neo.code.executor.Neo runs Helix.livePreviewCode (class MainView extends Viewport { static config = { className: 'Portal.view.MultiWindowHelix', showGitHubStarButton: false, theme: 'neo-theme-dark' } }) via container.add({module}) inside #neo-container-22.
Neo.container.Viewport#onConstructed() (src/container/Viewport.mjs:96-104) unconditionally invokes DomAccess.applyBodyCls({cls: ['neo-body-viewport'], windowId}) and me.theme && me.syncBodyTheme(), and syncBodyTheme() (src/container/Viewport.mjs:134) only checks if (!me.applyBodyCls).
- Because
container.Base#createItem (src/container/Base.mjs:470) assigns {parentId: container.id, theme: ...} rather than parentId: 'document.body', the nested LivePreview Viewport calls DomAccess.setBodyCls({add: ['neo-theme-dark'], remove: ['neo-theme-neo-dark', ...]}) on the host window's document.body.
- Flipping Portal's
document.body from neo-theme-neo-dark to neo-theme-dark shrinks Portal.view.HeaderToolbar from 58px to 45px (moving scrollerRect.top from 58px to 45px and growing #neo-container-1 hero min-height: 100% from 842px to 855px after Blink already latched the smooth scroll at scrollTop = 842).
Design authority: src/container/Viewport.mjs:25-29 ("Assuming that a Viewport is the top level view of your app, and you want to mount it right away."), src/container/Viewport.mjs:107-127 (#18571 contract: a viewport that owns neo-body-viewport owns document.body theme synchronization), and resources/scss/src/container/Viewport.scss:1-4 (body > .neo-viewport).
(Contributor labels good first issue and help wanted are intentionally omitted because this defect actively flakes CI on unrelated PRs and is claimed for immediate fix by @neo-gemini-julia.)
Pre-Creation Verification Sweeps
- (i) Live Open + Closed Queue (
2026-11-15T20:59Z): 58 open issues in neomjs/neo (backlog band: moderate, 25-75). Open search "Viewport syncBodyTheme OR LivePreview theme OR HomeAudienceDoorsNL" returned 0 results. Closed search "Viewport syncBodyTheme OR LivePreview body theme" returned #18569, #19008, #8727 (plus reviewed #18571 conversation — none cover nested Viewport instances inside a parent container).
- (ii) Recent Broadcast Scan: Reviewed latest 30
AGENT:* messages (list_messages through 20:57Z); contains Grace's defect-note sighting for HomeAudienceDoorsNL.spec.mjs:57 and zero competing [ticket-created] or [lane-claim] messages on Viewport / LivePreview / HomeAudienceDoorsNL.
- (iii) Memory Core Sweep:
query_raw_memories (nested Viewport LivePreview overwrites document.body theme syncBodyTheme HomeAudienceDoorsNL) found zero prior duplicates or architectural decisions touching nested Viewport body ownership.
- (iv) Assignment Cap Check:
2 open self-assigned issues (#20987, #20671 epic); well within active cap.
Acceptance Criteria
- AC-1:
Neo.container.Viewport only applies 'neo-body-viewport' and publishes/resets document.body theme classes (syncBodyTheme) when it owns the root body surface (Boolean(this.applyBodyCls && this.parentId === 'document.body')), while keeping its own .neo-viewport component theme class intact when mounted inside a parent container (parentId !== 'document.body').
- AC-2: Unit regression coverage in
test/playwright/unit/container/ViewportBodyTheme.spec.mjs proves a Viewport added inside a Neo.container.Base (parentId !== 'document.body') invokes neither DomAccess.applyBodyCls nor DomAccess.setBodyCls on construction, theme change, or reset, while preserving all 8 existing root-Viewport (parentId === 'document.body') arms.
- AC-3: Whitebox E2E coverage in
test/playwright/e2e/portal/HomeAudienceDoorsNL.spec.mjs deterministically exercises embedded FeatureSection LivePreview (Helix) activation (theme: 'neo-theme-dark'), verifies document.body retains neo-theme-neo-dark and stage alignment holds cleanly, and passes 5 consecutive runs (--repeat-each=5).
Out of Scope
- Changing
LivePreview popout child-window (LivePreview.MainContainer) behavior: its app.mainView has parentId === 'document.body' in the child window and continues owning that child window's document.body theme.
- Switching Portal's own
Helix / Colors preview examples away from Viewport.
Related
#18571 (PR #18599 — root Viewport#syncBodyTheme() contract)
PR #21027 (outside PR where CI run 43727822062 surfaced the timeout)
Origin Session ID: 1f283c86-c55b-4aa5-a291-0cbb3786c302
Retrieval Hint: container.Viewport ownsBodySurface syncBodyTheme nested LivePreview parentId document.body
Context & Problem Statement
In Portal Home E2E CI run
43727822062(shard 3, jobs132853556048and132885395596, observed on unrelated outside PR#21027and surfaced via@neo-opus-grace's defect note),test/playwright/e2e/portal/HomeAudienceDoorsNL.spec.mjs:57failed deterministically twice at line156(scrollHomeToReference(..., 'home-audience-doors', doors.id)):AudienceDoors(#neo-container-12) stayed latched atrect.top = 58pxwithscroller.scrollTop = 842for the final 8.1 seconds of the 10-second poll whilescrollerRect.topwas45px(Math.abs(58 - 45) = 13 > 4).1-trace.trace+ screencast frames) proves this is NOT a mere smooth-scroll timing issue, but a hostdocument.bodytheme hijack triggered whenever an embeddedNeo.code.LivePreviewinstantiates a subclass ofNeo.container.Viewport:AudienceDoorstoAiToolchain(#neo-container-28),IntersectionObserverhitsPortal.view.home.parts.Helix(threshold: 0.6inapps/portal/view/home/MainContainer.mjs:95-102) and invokesHelix#activate()(apps/portal/view/home/FeatureSection.mjs:111-121), which schedulesawait me.timeout(1000)before switching its embeddedNeo.code.LivePreview(#neo-container-22) toactiveView = 'preview'.AudienceDoors,Neo.code.executor.NeorunsHelix.livePreviewCode(class MainView extends Viewport { static config = { className: 'Portal.view.MultiWindowHelix', showGitHubStarButton: false, theme: 'neo-theme-dark' } }) viacontainer.add({module})inside#neo-container-22.Neo.container.Viewport#onConstructed()(src/container/Viewport.mjs:96-104) unconditionally invokesDomAccess.applyBodyCls({cls: ['neo-body-viewport'], windowId})andme.theme && me.syncBodyTheme(), andsyncBodyTheme()(src/container/Viewport.mjs:134) only checksif (!me.applyBodyCls).container.Base#createItem(src/container/Base.mjs:470) assigns{parentId: container.id, theme: ...}rather thanparentId: 'document.body', the nestedLivePreviewViewportcallsDomAccess.setBodyCls({add: ['neo-theme-dark'], remove: ['neo-theme-neo-dark', ...]})on the host window'sdocument.body.document.bodyfromneo-theme-neo-darktoneo-theme-darkshrinksPortal.view.HeaderToolbarfrom58pxto45px(movingscrollerRect.topfrom58pxto45pxand growing#neo-container-1heromin-height: 100%from842pxto855pxafter Blink already latched the smooth scroll atscrollTop = 842).Design authority:
src/container/Viewport.mjs:25-29("Assuming that a Viewport is the top level view of your app, and you want to mount it right away."),src/container/Viewport.mjs:107-127(#18571contract: a viewport that ownsneo-body-viewportownsdocument.bodytheme synchronization), andresources/scss/src/container/Viewport.scss:1-4(body > .neo-viewport).(Contributor labels
good first issueandhelp wantedare intentionally omitted because this defect actively flakes CI on unrelated PRs and is claimed for immediate fix by@neo-gemini-julia.)Pre-Creation Verification Sweeps
2026-11-15T20:59Z):58open issues inneomjs/neo(backlog band: moderate,25-75). Open search"Viewport syncBodyTheme OR LivePreview theme OR HomeAudienceDoorsNL"returned0results. Closed search"Viewport syncBodyTheme OR LivePreview body theme"returned#18569,#19008,#8727(plus reviewed#18571conversation — none cover nestedViewportinstances inside a parent container).AGENT:*messages (list_messagesthrough20:57Z); contains Grace'sdefect-notesighting forHomeAudienceDoorsNL.spec.mjs:57and zero competing[ticket-created]or[lane-claim]messages onViewport/LivePreview/HomeAudienceDoorsNL.query_raw_memories(nested Viewport LivePreview overwrites document.body theme syncBodyTheme HomeAudienceDoorsNL) found zero prior duplicates or architectural decisions touching nestedViewportbody ownership.2open self-assigned issues (#20987,#20671epic); well within active cap.Acceptance Criteria
Neo.container.Viewportonly applies'neo-body-viewport'and publishes/resetsdocument.bodytheme classes (syncBodyTheme) when it owns the root body surface (Boolean(this.applyBodyCls && this.parentId === 'document.body')), while keeping its own.neo-viewportcomponentthemeclass intact when mounted inside a parent container (parentId !== 'document.body').test/playwright/unit/container/ViewportBodyTheme.spec.mjsproves aViewportadded inside aNeo.container.Base(parentId !== 'document.body') invokes neitherDomAccess.applyBodyClsnorDomAccess.setBodyClson construction, theme change, or reset, while preserving all 8 existing root-Viewport(parentId === 'document.body') arms.test/playwright/e2e/portal/HomeAudienceDoorsNL.spec.mjsdeterministically exercises embeddedFeatureSectionLivePreview(Helix) activation (theme: 'neo-theme-dark'), verifiesdocument.bodyretainsneo-theme-neo-darkand stage alignment holds cleanly, and passes 5 consecutive runs (--repeat-each=5).Out of Scope
LivePreviewpopout child-window (LivePreview.MainContainer) behavior: itsapp.mainViewhasparentId === 'document.body'in the child window and continues owning that child window'sdocument.bodytheme.Helix/Colorspreview examples away fromViewport.Related
#18571(PR #18599— rootViewport#syncBodyTheme()contract)PR #21027(outside PR where CI run43727822062surfaced the timeout)Origin Session ID:
1f283c86-c55b-4aa5-a291-0cbb3786c302Retrieval Hint:container.Viewport ownsBodySurface syncBodyTheme nested LivePreview parentId document.body