Owned: a leaf of #21367 until its lock, Sun 22 Nov 18:00 CET.
Context
Defect-note e71871ff, reproduced on dev 5a3cb4de67 at 1024 × 768: in examples/menu/tree, a click on File removes the menu from the stage. Before the click, #neo-menu-list-1 holds File, Edit, View and About; after it, no .neo-menu-list is in the DOM, and the console holds no error.
The Problem
menu.List#beforeSetStore recognises a tree store only as an instance: value instanceof TreeStore (src/menu/List.mjs:334). The example passes the class, store: MainStore. The tree store then becomes the level's own store, and sourceStore stays null. It still looks right: a TreeStore's items are its visible rows, and with every parent collapsed those are the four roots. hasChildren() then falls back to nested items (:612-619), so every parent reads as a leaf. A click on File takes the leaf branch of onKeyDownEnter() (:789-794), and hideOnLeafItemClick unmounts the root.
The Architectural Reality
Design authority: menu.List#beforeSetStore's JSDoc, "the tree store is kept as sourceStore and this level receives its own flat store holding exactly the records it renders" (src/menu/List.mjs:326-327), with @param {Object|Neo.data.Store|Neo.data.TreeStore} value. Its parent list.Base#beforeSetStore takes an instance, a class or a config through ClassSystemUtil.beforeSetInstance(value, Store) (src/list/Base.mjs).
- #17839's trap holds: submenus share the root's tree store and must never destroy it. They receive it as an instance (
:593-597).
- An instance handed in stays its owner's:
menu.List#destroy only unregisters from sourceStore (:466-472).
- The source is bound once, in
onConstructed() (:765-782): a store set later reaches neither the level nor the listeners.
The Fix
src/menu/List.mjs
beforeSetStore: a class or config is built first, through ClassSystemUtil.beforeSetInstance(value, Store), so a tree store is recognised however it arrives.
- A tree store this menu built is its own, and
destroy() destroys it after the submenus. One handed in as an instance stays its owner's.
- A store that replaces another after construction retires the old cascade and its listeners, releases an old source the menu built, and fills the root from the new source (
afterSetStore).
test/playwright/unit/menu/ListTreeStore.spec.mjs: arms for the class and the config form, for ownership, and for a live replacement.
Decision Record impact
none
Acceptance Criteria
Out of Scope
hasChildren()'s nested-items fallback for a plain store: it is the classic API.
- The example's catalog record and cover (#21142, the renewal under #21367).
Avoided Traps
- Passing an instance in the example. It hides the engine gap for the next consumer, and the example would then own a store nobody destroys.
autoDestroyStore for the source. It governs the level store; reading it for the source would destroy instances other owners share.
Related
Live latest-open + closed sweep: checked latest 20 open + open and closed search (menu TreeStore; menu.List TreeStore; Out of Scope and Avoided Traps read on #17839) at 2026-11-19T03:52:47Z; no equivalent or prior exclusion found. Backlog band: 78 open (red); folds under its owning epic #21367.
A2A claim sweep: last 8 messages, no claim on menus.
MC sweep: "menu list tree store click on a parent item empties the menu, treated as a leaf", 5 results; #17839's implementation, no decision on store forms.
Own-assignment sweep: 11 open, none overlapping.
Retrieval Hint: "menu tree store passed as a class, parent treated as leaf, root unmounts"
Owned: a leaf of #21367 until its lock, Sun 22 Nov 18:00 CET.
Context
Defect-note
e71871ff, reproduced ondev5a3cb4de67 at 1024 × 768: inexamples/menu/tree, a click on File removes the menu from the stage. Before the click,#neo-menu-list-1holds File, Edit, View and About; after it, no.neo-menu-listis in the DOM, and the console holds no error.The Problem
menu.List#beforeSetStorerecognises a tree store only as an instance:value instanceof TreeStore(src/menu/List.mjs:334). The example passes the class,store: MainStore. The tree store then becomes the level's own store, andsourceStorestays null. It still looks right: aTreeStore's items are its visible rows, and with every parent collapsed those are the four roots.hasChildren()then falls back to nesteditems(:612-619), so every parent reads as a leaf. A click on File takes the leaf branch ofonKeyDownEnter()(:789-794), andhideOnLeafItemClickunmounts the root.The Architectural Reality
Design authority:
menu.List#beforeSetStore's JSDoc, "the tree store is kept assourceStoreand this level receives its own flat store holding exactly the records it renders" (src/menu/List.mjs:326-327), with@param {Object|Neo.data.Store|Neo.data.TreeStore} value. Its parentlist.Base#beforeSetStoretakes an instance, a class or a config throughClassSystemUtil.beforeSetInstance(value, Store)(src/list/Base.mjs).:593-597).menu.List#destroyonly unregisters fromsourceStore(:466-472).onConstructed()(:765-782): a store set later reaches neither the level nor the listeners.The Fix
src/menu/List.mjsbeforeSetStore: a class or config is built first, throughClassSystemUtil.beforeSetInstance(value, Store), so a tree store is recognised however it arrives.destroy()destroys it after the submenus. One handed in as an instance stays its owner's.afterSetStore).test/playwright/unit/menu/ListTreeStore.spec.mjs: arms for the class and the config form, for ownership, and for a live replacement.Decision Record impact
none
Acceptance Criteria
examples/menu/tree, a click on File keeps the menu and opens File's submenu (New, Open, Save).hasChildren()readsisLeaf, and a parent opens its submenu.Out of Scope
hasChildren()'s nested-itemsfallback for a plain store: it is the classic API.Avoided Traps
autoDestroyStorefor the source. It governs the level store; reading it for the source would destroy instances other owners share.Related
Live latest-open + closed sweep: checked latest 20 open + open and closed search (menu TreeStore; menu.List TreeStore; Out of Scope and Avoided Traps read on #17839) at 2026-11-19T03:52:47Z; no equivalent or prior exclusion found. Backlog band: 78 open (red); folds under its owning epic #21367. A2A claim sweep: last 8 messages, no claim on menus. MC sweep: "menu list tree store click on a parent item empties the menu, treated as a leaf", 5 results; #17839's implementation, no decision on store forms. Own-assignment sweep: 11 open, none overlapping.
Retrieval Hint: "menu tree store passed as a class, parent treated as leaf, root unmounts"