LearnNewsExamplesConnect
Frontmatter
assigneesneo-opus-ada
createdAtOct 21, 2026, 11:42 PM
updatedAtOct 22, 2026, 1:07 AM
githubUrlhttps://github.com/neomjs/neo/issues/19973
authorneo-opus-ada
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtOct 22, 2026, 1:07 AM

A hidden floating child stays mounted after its parent removes its DOM

neo-opus-ada
neo-opus-ada commented on Oct 21, 2026, 11:42 PM

Context

test/playwright/component/menu/SpawnAnimation.spec.mjs "a dismissed and reopened instance is cleaned up and re-arms" flakes the components (3/3) shard. The reopened menu stays unaligned: the node is present but has no neo-aligned-* class for 5 s. It failed on #19964 (job 119302098063) and #19970 (job 119479884524), and components (3/3) failed in 3 of the 6 dev runs before 0c7ccd5878. Locally it reproduces 1/30 serially, and 3/60 under 6 workers with a probe that replays the arm.

The probe timelines (App worker clock, Neo.menu.List#afterSetMounted / alignTo hooks plus the update batches):

  • Passing: the hide's viewport batch removes the menu node. A deferred List.unmount() (src/menu/List.mjs) then sets mounted: false about 68 ms later. On the reopen batch, the viewport's landing mounts the menu again → afterSetMounted(true) → alignTo() → DomAccess.align with the node present.
  • Failing: the reopen batch follows the hide's 9 ms later, before the deferred unmount. The menu still reads mounted: true, so the reopen is no transition: no afterSetMounted(true), no alignTo(), and the new node never aligns.

The Problem

The arm's menu is a floating ITEM of the viewport container (parentId: 'component-test-viewport'), rendered inside the viewport's node. Hiding it runs Component#hide()'s non-body branch (vdom.removeDom = true + parent.update()). The parent's landing removes the node, but VdomLifecycle#unmountRemovedChildren skips floating children, so the menu keeps mounted: true with no DOM until something else unmounts it. During that window it breaks the engine's contract: a component without DOM reports mounted. Its updates can still fly and produce deltas for a missing node, and a show inside the window gets no mount hooks (alignment, focusOnMount, the outside-pointer listener). The same holds for any floating component hidden inside a parent, not just menus (inferred from the code path; measured only for the menu).

The Architectural Reality

  • src/mixin/VdomLifecycle.mjs unmountRemovedChildren() unmounts children absent from the synced tree, except child.floating. Its JSDoc gives the reason: "Floating children (dialogs, popups) render outside their parent's node and are never tested."
  • That reason does not hold for a floating child added as an item: it renders inside its parent's node, and its own removeDom is what took the node out.
  • component.Base#hide() for a parent other than document.body never calls unmount(). #18290 recorded this ("mounted stays TRUE for a hidden floating menu") and keyed its focus guard on hidden instead.
  • Design authority: the same JSDoc says "mounted is state tracking, not a DOM operation: the node is already gone, this records it." A floating child whose own vdom.removeDom removed it is exactly such a gone node.

The Fix

In unmountRemovedChildren(), test a floating child too when its own vdom carries removeDom: !child.floating || child.vdom.removeDom. A hidden floating child is then unmounted by the landing that removed it, and its next show mounts it again with every mount hook. Floating children that render elsewhere and are not hidden stay untested, as before. The JSDoc names the exception.

Acceptance Criteria

  • AC-1: A floating child hidden (removeDom) through its parent's update is mounted: false once that update lands, and showing it again runs its afterSetMounted(true).
  • AC-2: A floating menu shown again right after its removal (before any deferred unmount) is aligned (neo-aligned-*).
  • AC-3: A unit arm for AC-1 and a component-tier browser arm for AC-2 are red on base and green at head.
  • AC-4: Under the probe's load (6 workers), SpawnAnimation.spec.mjs "a dismissed and reopened instance is cleaned up and re-arms" passes every run at head (240 runs). This is an outside-CI receipt.
    • Corrected before the PR: this AC first also required base to fail under that load. Base passed 240/240 at 0c7ccd5878. The natural failure is observed in CI (#19970, job 119479884524) and was reproduced locally only on the pre-#19967 engine (1/30 serial, 3/60 in the probe). AC-2's deterministic arm carries the red-on-base proof.

Post-Merge Validation

  • components (3/3) on dev shows no SpawnAnimation.spec.mjs "unaligned" failure over the next 10 runs.

Out of Scope

  • HeaderCellRectSync.spec.mjs:99 (defect-note 9d6ebee41034cd70): a different flake, with its own ticket if it recurs.

Related

#18290 · #19964 · #19970

Live latest-open sweep: checked the latest 20 open issues at 2026-10-21T21:42:07Z; no equivalent (#19969 is mine, about syncVnodeTree's mount pass). A2A sweep: the last 12 messages, all read-states; no overlapping claim. MC sweep: one query on the symptom ("reopened floating menu unaligned, hidden floating child stays mounted"), 5 results. #18290's note records the fact and designs around it; no ruling keeps the skip intentional. Own-assignment sweep: 7 open; #19969 touches the same file but another function.

Origin Session ID: 17bb8277-9137-4774-9a4d-7d98db9779a6

Retrieval Hint: "hidden floating child stays mounted, unmountRemovedChildren floating skip, SpawnAnimation reopened menu unaligned"

tobiu referenced in commit ce8a401 - "fix(vdom): a hidden floating child is unmounted with the DOM its parent removes (#19973) (#19974) on Oct 22, 2026, 1:07 AM
tobiu closed this issue on Oct 22, 2026, 1:07 AM