Context
The #19928 arm in test/playwright/e2e/grid/IssuesShowcase.spec.mjs ("the filter list draws its focus ring inside the row and its rows on the menu surface, in both themes") flakes in e2e-engine (3/4). After its second pick ("Duplicate", after Escape and a theme switch), .neo-navigator-active-item is never found. It failed twice on #19964 (jobs 119302106742 and 119305785537) and earlier on #19958 and #19960. #19962 fixed one cause, a late search focus. At its head (9fc08da9a9), the arm still failed 5 of 24 runs locally under 8 workers.
Measured with a probe spec that replays the arm's exact sequence (local headless Chromium, playwright.config.e2e.mjs, same head):
- In every failing run, the reopened menu's value list never calls
Neo.main.addon.Navigator.subscribe. In every passing run it does, about 1 ms after the menu mounts.
- A worker-side hook on
Neo.list.ValuePicker#afterSetMounted records each transition with its stack. Passing: mount (first open), unmount (Escape: hide() → unmount() → container cascade), mount (reopen, via initVnode). Failing: mount, unmount, then mount via syncVnodeTree < executeVdomUpdate, an update flight landing ~1 ms after the unmount. The reopen finds the list already mounted: true, so afterSetMounted never fires and the new DOM is never subscribed.
- At the failure, the App worker reports the list
mounted: true, hasNavigator: true and its element is in the DOM, without the Navigator's listeners.
- The flight is the surface's own. The first pick shows the Clear button (
refreshOptions → clear.hidden = false → surface.update()), and Escape lands while that flight is out. The arm's soft.poll(read) between the first pick and Escape (14–46 ms) puts Escape inside the window: replicas without that poll passed all 98 runs, and with it 4–5 of 24 failed, in each of three runs.
- Holding the list's subscribe on the main thread until after the click reproduces the symptom 10/10.
The Problem
Component#hide() on a component rooted at document.body calls unmount(), which sets mounted = false synchronously, and Container#afterSetMounted cascades that to the items: the value list unsubscribes from the Navigator. An update flight that left before the unmount still lands. executeVdomUpdate hands its vnode to syncVnodeTree, which sets mounted = true on every child component the vnode carries, without asking whether the root's DOM still exists. The children end up mounted: true under an unmounted root. When the root mounts again, the container cascade finds nothing to change, so no child's afterSetMounted(true) runs. The list never re-subscribes, and any other mount-time setup in those children is skipped too.
In the grid, a header menu closed inside that window and then reopened has no keyboard navigation and no focus ring in its value list, until the next close and reopen. The same code path applies to any document.body-rooted component hidden while one of its updates is in flight. That is inferred from the code; only the header menu is measured.
The Architectural Reality
src/component/Base.mjs: hide() → unmount() sets vdom.removeDom = true, mounted = false and sends a removeNode delta.
src/container/Base.mjs: afterSetMounted() cascades mounted to items without removeDom.
src/mixin/VdomLifecycle.mjs: the executeVdomUpdate() landing calls component.syncVnodeTree(vnode, deltas) for each root, and guards only destroyed roots (the #19830 precedent). syncVnodeTree() sets component.mounted = true for each child found in the vnode.
updateVdom() already refuses to start a flight on an unmounted root (it waits for mountedPromise). The only flight that can land on an unmounted root is one that left before unmount().
src/list/Base.mjs: afterSetMounted() subscribes to Neo.main.addon.Navigator on true and unsubscribes on false.
- Design authority:
Component#show()'s JSDoc says "A component rooted at document.body mounts in one flight at a time, which lands on the latest hidden". hide() says "A node still in its mount flight does not exist yet: the flight unmounts it when it lands". A mount flight already honours a hide() that arrives while it flies. An update flight does not.
The Fix
syncVnodeTree() marks the children it finds as mounted only while the root's DOM is live: me.mounted || !me.vdom.removeDom. A flight that lands after unmount() still adopts its vnodes but mounts nothing. The root's next mount does that, so every child's afterSetMounted(true) runs again. First renders are unaffected, because show() deletes removeDom before initVnode(true), and domWithheld (toolbar overflow only) never renders a document.body root.
Acceptance Criteria
Out of Scope
- The other flakes seen on
#19964: HeaderMenuShape.spec.mjs:133 (now #19965), PremeasureRows.spec.mjs:76 and SpawnAnimation.spec.mjs:183.
- Whether a non-container root's
unmount() should also unmount child components embedded in its vdom.
Related
#19928 · #19961 · #19962 · #19964 · #19830 · #19965
Live latest-open sweep: checked the latest 20 open issues at 2026-10-21T17:08:11Z; no equivalent found (#19965 is a createDeltas root mismatch when enabling columnMenu at runtime, a different mechanism).
A2A sweep: the last 30 messages, all read-states; Maryam's #19965 lane-claim is the only grid claim and does not overlap.
MC sweep: one query on the symptom ("hidden while update in flight stays mounted, reopen skips afterSetMounted, navigator not subscribed"), 6 results. The nearest are #18290 (floating focus-leave) and #19921 (a throwing mount hook); neither ruled on this. KB sweep: #16434, #19830 and #19922 are closed, with different mechanisms.
Own-assignment sweep: 6 open, none overlapping.
Origin Session ID: 7ae4513c-24be-4f11-864b-167a32b15bd1
Retrieval Hint: "update flight lands after unmount, syncVnodeTree marks children mounted, header menu reopened loses navigator active item"
Context
The
#19928arm intest/playwright/e2e/grid/IssuesShowcase.spec.mjs("the filter list draws its focus ring inside the row and its rows on the menu surface, in both themes") flakes ine2e-engine (3/4). After its second pick ("Duplicate", after Escape and a theme switch),.neo-navigator-active-itemis never found. It failed twice on#19964(jobs 119302106742 and 119305785537) and earlier on#19958and#19960.#19962fixed one cause, a late search focus. At its head (9fc08da9a9), the arm still failed 5 of 24 runs locally under 8 workers.Measured with a probe spec that replays the arm's exact sequence (local headless Chromium,
playwright.config.e2e.mjs, same head):Neo.main.addon.Navigator.subscribe. In every passing run it does, about 1 ms after the menu mounts.Neo.list.ValuePicker#afterSetMountedrecords each transition with its stack. Passing: mount (first open), unmount (Escape:hide()→unmount()→ container cascade), mount (reopen, viainitVnode). Failing: mount, unmount, then mount viasyncVnodeTree < executeVdomUpdate, an update flight landing ~1 ms after the unmount. The reopen finds the list alreadymounted: true, soafterSetMountednever fires and the new DOM is never subscribed.mounted: true, hasNavigator: trueand its element is in the DOM, without the Navigator's listeners.refreshOptions→clear.hidden = false→surface.update()), andEscapelands while that flight is out. The arm'ssoft.poll(read)between the first pick andEscape(14–46 ms) putsEscapeinside the window: replicas without that poll passed all 98 runs, and with it 4–5 of 24 failed, in each of three runs.The Problem
Component#hide()on a component rooted atdocument.bodycallsunmount(), which setsmounted = falsesynchronously, andContainer#afterSetMountedcascades that to the items: the value list unsubscribes from the Navigator. An update flight that left before the unmount still lands.executeVdomUpdatehands its vnode tosyncVnodeTree, which setsmounted = trueon every child component the vnode carries, without asking whether the root's DOM still exists. The children end upmounted: trueunder an unmounted root. When the root mounts again, the container cascade finds nothing to change, so no child'safterSetMounted(true)runs. The list never re-subscribes, and any other mount-time setup in those children is skipped too.In the grid, a header menu closed inside that window and then reopened has no keyboard navigation and no focus ring in its value list, until the next close and reopen. The same code path applies to any
document.body-rooted component hidden while one of its updates is in flight. That is inferred from the code; only the header menu is measured.The Architectural Reality
src/component/Base.mjs:hide()→unmount()setsvdom.removeDom = true,mounted = falseand sends aremoveNodedelta.src/container/Base.mjs:afterSetMounted()cascadesmountedto items withoutremoveDom.src/mixin/VdomLifecycle.mjs: theexecuteVdomUpdate()landing callscomponent.syncVnodeTree(vnode, deltas)for each root, and guards only destroyed roots (the#19830precedent).syncVnodeTree()setscomponent.mounted = truefor each child found in the vnode.updateVdom()already refuses to start a flight on an unmounted root (it waits formountedPromise). The only flight that can land on an unmounted root is one that left beforeunmount().src/list/Base.mjs:afterSetMounted()subscribes toNeo.main.addon.Navigatorontrueand unsubscribes onfalse.Component#show()'s JSDoc says "A component rooted atdocument.bodymounts in one flight at a time, which lands on the latesthidden".hide()says "A node still in its mount flight does not exist yet: the flight unmounts it when it lands". A mount flight already honours ahide()that arrives while it flies. An update flight does not.The Fix
syncVnodeTree()marks the children it finds as mounted only while the root's DOM is live:me.mounted || !me.vdom.removeDom. A flight that lands afterunmount()still adopts its vnodes but mounts nothing. The root's next mount does that, so every child'safterSetMounted(true)runs again. First renders are unaffected, becauseshow()deletesremoveDombeforeinitVnode(true), anddomWithheld(toolbar overflow only) never renders adocument.bodyroot.Acceptance Criteria
unmount()leaves the root's child componentsmounted: false, and the root's next mount runs each child'safterSetMounted(true)..neo-navigator-active-item.#19928arm fails on base and passes every run at head. This is an outside-CI receipt.Out of Scope
#19964:HeaderMenuShape.spec.mjs:133(now#19965),PremeasureRows.spec.mjs:76andSpawnAnimation.spec.mjs:183.unmount()should also unmount child components embedded in its vdom.Related
#19928 · #19961 · #19962 · #19964 · #19830 · #19965
Live latest-open sweep: checked the latest 20 open issues at 2026-10-21T17:08:11Z; no equivalent found (#19965 is a createDeltas root mismatch when enabling
columnMenuat runtime, a different mechanism). A2A sweep: the last 30 messages, all read-states; Maryam's#19965lane-claim is the only grid claim and does not overlap. MC sweep: one query on the symptom ("hidden while update in flight stays mounted, reopen skips afterSetMounted, navigator not subscribed"), 6 results. The nearest are#18290(floating focus-leave) and#19921(a throwing mount hook); neither ruled on this. KB sweep:#16434,#19830and#19922are closed, with different mechanisms. Own-assignment sweep: 6 open, none overlapping.Origin Session ID: 7ae4513c-24be-4f11-864b-167a32b15bd1
Retrieval Hint: "update flight lands after unmount, syncVnodeTree marks children mounted, header menu reopened loses navigator active item"