LearnNewsExamplesConnect
Frontmatter
assigneesneo-opus-grace
createdAtNov 16, 2026, 2:19 AM
updatedAtNov 16, 2026, 3:15 AM
githubUrlhttps://github.com/neomjs/neo/issues/21076
authorneo-opus-grace
commentsCount1
parentIssue21061
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtNov 16, 2026, 3:15 AM

A tree collapse empties a menu level and closes its open submenu

Closed v14.0.0/archive-v14-0-0-chunk-3 bugairegressioncore
neo-opus-grace
neo-opus-grace commented on Nov 16, 2026, 2:19 AM

Context

Leaf of #21061. @neo-gpt-emmy's review of #21070 found it: with the start menu's cascade open two levels deep, collapsing their ancestor in the source tree and expanding it again closes the still-permitted grandchild. #21068 (resolving #21062) merged at 01:14Z before the fix could land there, so the fix gets its own ticket.

The Problem

Reproduced on dev @ d940179245 with a new arm in test/playwright/unit/menu/ListTreeStore.spec.mjs: root → File → New open, then treeStore.collapse('file'):

Expected: ["file-new", "file-open"]
Received: []

The File level empties, and #hideOrphanedSubMenu() (added by #21068) then finds no item for the New submenu and closes it. Before #21068 the rows already left and came back on expand; only the open grandchild survived. A level that renders structure loses its rows to an expansion change it does not render.

The Architectural Reality

  • TreeStore#collapse() (src/data/TreeStore.mjs) removes a branch's visible descendants from the Projection Layer through Collection#splice, which fires mutate with them as removedItems. The Structural Layer keeps them: TreeStore#get() falls back to #allRecordsMap. A real removal deletes a node from #allRecordsMap before mutate fires.
  • menu.List#onSourceStoreMutate() (src/menu/List.mjs) splices every removedItems entry of its level out of the level store, so a collapse reads as a removal; expand() then re-adds the rows as addedItems.
  • Design authority: the TreeStore#getChildren() JSDoc, "Independent: expansion and filtering. A collapsed or filtered-out branch still returns its children, because visibility is a property of the projection, not of the hierarchy." The spec arm "a child level reads through the COLLAPSED tree — expansion is not a rendering prerequisite" pins the same contract for a level's first render.

The Fix

In menu.List#onSourceStoreMutate(): a removed record leaves the level only when sourceStore.get() no longer resolves it, and an added record joins only when the level store does not already list it. No TreeStore change.

Acceptance Criteria

  • With root → File → New open, a tree collapse('file') keeps both levels' rows and the open New submenu, and the following expand('file') lists each row exactly once (unit arm, red on dev).
  • Removing the open submenu's item from the tree still closes that submenu (unit arm).
  • A filter that drops the open submenu's item still closes it (the existing arm stays green).
  • test/playwright/unit/menu/ stays green.

Out of Scope

  • A menu that renders the tree's projection rather than its structure; none exists.
  • The web desktop's own repairs on #21070.

Related

Live latest-open + closed sweep: checked latest 20 open (59 open, red band: the owning epic #21061 takes this as a leaf, and the resolving ticket #21062 is closed) + open and closed search (menu collapse submenu tree; closed hits #17839, #18870, #17860 read, none governs a collapse) + A2A last 30 + Memory Core (menu level collapse submenu) + own open assignments at 2026-11-16T01:19Z; no equivalent or prior exclusion found.

Retrieval Hint: "menu level tree collapse removedItems projection structural layer open submenu orphan"

tobiu referenced in commit 736cceb - "feat(webdesktop): sign-in, launcher and start menu follow permissions (#21063) (#21070) on Nov 16, 2026, 3:11 AM