Context
@neo-opus-ada's defect-note (2026-09-18): component/button/Base.spec.mjs failed in CI three times this afternoon, on three arms, in PRs that touch no menu or button code. The runs were PR #18857 (run 35350078494, attempts 1 and 2) and PR #18873 (run 35345435248). All three stopped at the first poll after createSubMenuButton() + focus() + Enter, which expects focus on Open and got null. Locally they passed 189/189 on an idle machine.
I reproduced it locally under machine-wide load, with the component suite running on 10 workers in the background. At the moment of failure no menu is mounted and focus is still on the button: the Enter never opened anything.
The Problem
button.Base#afterSetMenu() creates menuList inside import('../menu/List.mjs').then(…). onClick() calls toggleMenu(), which reads menuList.hidden with no guard. A click that lands before the import resolves throws in the App Worker and is lost, and the menu never opens. That includes Enter or Space, which a native button turns into a click.
Deterministic reproduction: hold the src/menu/List.mjs fetch, click the button, then release. No menu opens (0 .neo-menu-list).
The arms caught it only under load. A user hits it on a slow device, or by clicking a button as soon as it renders.
The Architectural Reality
src/button/Base.mjs: afterSetMenu() (the lazy import), onClick(), toggleMenu() (menuList.hidden unguarded). Every other menuList read in the class is guarded.
core.Base#trap() is the destroy-safe way for an instance to await a promise.
The Fix
afterSetMenu() keeps its import promise, and toggleMenu() awaits it through trap() before toggling. A click that arrives early opens the menu once the menu exists, instead of throwing.
Acceptance Criteria
Out of Scope
- A
menu config changed at runtime creates another menuList without destroying the previous one.
Related
#18860 (the arms that caught it) · PR #18857 · PR #18873
Decision Record impact: none.
Sweeps: latest open issues and an all-state search for toggleMenu / menuList found nothing equivalent (the nearest is the closed #4868, about focus on a second show). A2A: @neo-opus-ada's defect-note is the source, and there is no claim. Own assignments: none overlapping.
Origin Session ID: 0a997d38-ccdb-4352-ac21-566606a6ab2d
Retrieval Hint: "button menu first click lost lazy import menu/List toggleMenu menuList undefined"
Context
@neo-opus-ada's defect-note (2026-09-18):
component/button/Base.spec.mjsfailed in CI three times this afternoon, on three arms, in PRs that touch no menu or button code. The runs were PR #18857 (run 35350078494, attempts 1 and 2) and PR #18873 (run 35345435248). All three stopped at the first poll aftercreateSubMenuButton()+focus()+ Enter, which expects focus onOpenand gotnull. Locally they passed 189/189 on an idle machine.I reproduced it locally under machine-wide load, with the component suite running on 10 workers in the background. At the moment of failure no menu is mounted and focus is still on the button: the Enter never opened anything.
The Problem
button.Base#afterSetMenu()createsmenuListinsideimport('../menu/List.mjs').then(…).onClick()callstoggleMenu(), which readsmenuList.hiddenwith no guard. A click that lands before the import resolves throws in the App Worker and is lost, and the menu never opens. That includes Enter or Space, which a native button turns into a click.Deterministic reproduction: hold the
src/menu/List.mjsfetch, click the button, then release. No menu opens (0.neo-menu-list).The arms caught it only under load. A user hits it on a slow device, or by clicking a button as soon as it renders.
The Architectural Reality
src/button/Base.mjs:afterSetMenu()(the lazy import),onClick(),toggleMenu()(menuList.hiddenunguarded). Every othermenuListread in the class is guarded.core.Base#trap()is the destroy-safe way for an instance to await a promise.The Fix
afterSetMenu()keeps its import promise, andtoggleMenu()awaits it throughtrap()before toggling. A click that arrives early opens the menu once the menu exists, instead of throwing.Acceptance Criteria
menu/List.mjsfetch, clicks the button, then releases: the menu opens. It is red ondev, where no menu opens.Out of Scope
menuconfig changed at runtime creates anothermenuListwithout destroying the previous one.Related
#18860 (the arms that caught it) · PR #18857 · PR #18873
Decision Record impact: none.
Sweeps: latest open issues and an all-state search for
toggleMenu/menuListfound nothing equivalent (the nearest is the closed #4868, about focus on a second show). A2A: @neo-opus-ada's defect-note is the source, and there is no claim. Own assignments: none overlapping.Origin Session ID: 0a997d38-ccdb-4352-ac21-566606a6ab2d
Retrieval Hint: "button menu first click lost lazy import menu/List toggleMenu menuList undefined"