LearnNewsExamplesServices
Frontmatter
id19265
titleA body-floating component shown, hidden and shown inside one mount flight renders two nodes with one id
stateClosed
labels
bugaicore
assigneesneo-opus-grace
createdAtSep 26, 2026, 1:11 PM
updatedAtSep 26, 2026, 2:27 PM
githubUrlhttps://github.com/neomjs/neo/issues/19265
authorneo-opus-grace
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtSep 26, 2026, 2:27 PM

A body-floating component shown, hidden and shown inside one mount flight renders two nodes with one id

neo-opus-grace
neo-opus-grace commented on Sep 26, 2026, 1:11 PM

Context

test/playwright/e2e/grid/CellEditingPickerProjection.spec.mjs:80 (combo, vertical) failed twice on CI today (dev push run 36235273002 at 08a84ef3be; PR #19263 run 36237237140, attempt 1): .neo-picker-container resolved to 2 elements, both id="neo-combobox-1__picker". The failing trace's last DOM snapshot shows both nodes as direct children of <body>. One is aligned (translate(455px, 123.5px), width 141), the other is a fresh, unaligned mount. Locally the arm passes 10/10, and 12/12 at 4x/8x CPU throttling.

The Problem

For a component whose parentId is 'document.body' (every floating picker, menu, tooltip):

  • component.Base#show() mounts with !me.mounted && me.initVnode(true).
  • hide() goes through unmount(), which sends removeNode and sets mounted = false at once.

Inside one in-flight initVnode(true), nothing is mounted yet, so the removeNode is a no-op on main, and a second show() still reads mounted === false and starts a second initVnode(true). Both flights insert, and the body holds two nodes with one id. initVnode's own comment leaves single-flight to the caller ("any caller-side single-flight latch"); show() has none. The mirror case, show → hide with nothing after, lands the first flight's node after the removeNode, so a hidden component stays painted.

Reproduced, component tier, empty-viewport fixture: a container mounted at document.body, hidden, then setConfigs({hidden: false}), ({hidden: true}), ({hidden: false}) fired without awaiting → 2 nodes, 5/5 and 3/3. The same sequence with each step awaited → 1 node, 3/3.

The Architectural Reality

  • mixin.VdomLifecycle#initVnode holds isVnodeInitializing for the whole flight: it is set before the vdom round trip and cleared in onInitVnode or in the catch.
  • A parent-rooted component is not affected: its show() / hide() go through the parent's update, one flight per parent.
  • #18290 (the menu re-open race) was a different mechanism: a deferred focus-leave, not a double mount.

The Fix

One mount flight at a time, and the latest intent read when it lands. show() starts initVnode(true) only when nothing is mounted and no flight is in the air, and the flight's settlement unmounts again if hidden turned true meanwhile. hide() during a flight leaves the unmount to that settlement instead of sending a removeNode for a node that does not exist yet.

Acceptance Criteria

  • AC-1 (component, red-first): show → hide → show inside one flight leaves exactly one node; red on dev (2 nodes), green at the head.
  • AC-2 (component): show → hide inside one flight leaves no node once the flight lands.
  • AC-3: the awaited sequence stays at one node (the control), and the component + unit tiers stay green.
  • AC-4: CellEditingPickerProjection passes at the head.

Out of Scope

  • Ordering between a vdom-worker insert and an app-worker removeNode after onInitVnode (a separate channel question, not observed here).
  • Parent-rooted show() / hide().

Related

#19263 (the CI red that surfaced it) · #18290 (menu re-open, a different mechanism) · #15083 (parentless initVnode(true) round trip)

Origin Session ID: 81d1894c-d8fd-4192-8350-42e32eb0101e Retrieval Hint: "document.body floating component show hide show in-flight initVnode two nodes same id picker duplicate"

tobiu referenced in commit 6fa2bf0 - "fix(component): a body-rooted component mounts in one flight and lands on the latest hidden (#19265) (#19268) on Sep 26, 2026, 2:27 PM
tobiu closed this issue on Sep 26, 2026, 2:27 PM