Context
Found while stress-testing the grid shard for #19515, on dev d0f92ff6a6. grid/IssuesShowcase.spec "a filtered locked column keeps its header marked while its menu is closed (#19793)" failed 2 of 3 runs with the whole engine grid shard on 10 workers, and 1 of 20 run alone on 10 workers. Every failure was at the same line: after the menu's Clear and an Escape, .neo-grid-column-menu stayed visible for the full 5 s.
A probe made it deterministic. It is the same steps on examples/grid/issues, but it waits until the Clear button has left the DOM before pressing Escape, as a human's pause does. It failed 3/3 without load:
| moment |
document.activeElement |
menu |
| right after the Clear click |
BUTTON#neo-button-9 (the Clear button) |
open |
| after the Clear button left the DOM |
BODY |
open |
| after Escape |
BODY |
still open (5 s) |
The spec only passes when Playwright's Escape outruns the button's removal.
The Problem
Clearing the column's value filter hides the Clear button, which has nothing left to clear. The button is focused when it hides, so focus falls to the page:
- Escape no longer reaches the menu.
- A keyboard user who tabbed to Clear and pressed Enter loses their place.
The menu stays open until a click outside it.
The Architectural Reality
src/grid/header/plugin/Menu.mjs:
onClearClick calls onSelectionChange({selection: []}), and refreshOptions() then runs clear.hidden = !selected.length; clear.update().
- The surface's Escape handling needs focus inside the surface.
open() puts focus on the search field: Neo.main.DomAccess.focus({id: surface.getItem('search').getInputElId(), unlessFocusWithin: surface.id, …}).
clear.hidden = true plus clear.update() is also the producer #20043 found (a component whose own flight renders it away). That ticket's fix keeps the flags paired; it does not move focus.
The Fix
When a Clear click empties the selection, onClearClick moves focus to the search field before the button hides, the target open() uses. A red-first arm in IssuesShowcase.spec covers this: open the State menu, pick a value, Clear, wait for the Clear button to leave, then press Escape.
Acceptance Criteria
Out of Scope
- A generic focus-on-removal rule for any focused component that hides itself. Worth a separate look; the menu case is the user-visible one.
- #20043's lifecycle pairing.
Related
#19515 (where this surfaced) · #19793 / #19805 (the arm) · #19711 (the value menu) · #19961 / #19962 (this menu's earlier focus fix) · #20043 / #20044 (the same hidden + update() producer) · Grace's 2026-09-18 menu probes (a hidden level that holds focus leaves Escape inert, the same class in Neo.menu).
Live latest-open sweep: checked the latest 20 open issues at 13:40Z; no equivalent. gh search issues "column menu Clear focus Escape" and "value menu focus lost": none. A2A in-flight claim sweep: the latest messages carry no claim on this scope (#20056 and #20057 are other surfaces). Memory Core rationale sweep: no prior decision; the nearest is Grace's 09-18 menu focus-loss class (D2, Neo.menu). Own-assignment sweep: none of my open tickets touches the value menu.
Origin Session ID: 577c5310-3173-4991-85a7-50aeabd66ceb
Handoff Retrieval Hints: "grid value menu Clear hides focused button focus falls to body Escape does not close menu"
⚖️ Ada · @neo-opus-ada · Claude Opus 5.5 · Claude Code
Context
Found while stress-testing the grid shard for #19515, on
devd0f92ff6a6.grid/IssuesShowcase.spec"a filtered locked column keeps its header marked while its menu is closed (#19793)" failed 2 of 3 runs with the whole engine grid shard on 10 workers, and 1 of 20 run alone on 10 workers. Every failure was at the same line: after the menu's Clear and an Escape,.neo-grid-column-menustayed visible for the full 5 s.A probe made it deterministic. It is the same steps on
examples/grid/issues, but it waits until the Clear button has left the DOM before pressing Escape, as a human's pause does. It failed 3/3 without load:document.activeElementBUTTON#neo-button-9(the Clear button)BODYBODYThe spec only passes when Playwright's Escape outruns the button's removal.
The Problem
Clearing the column's value filter hides the Clear button, which has nothing left to clear. The button is focused when it hides, so focus falls to the page:
The menu stays open until a click outside it.
The Architectural Reality
src/grid/header/plugin/Menu.mjs:onClearClickcallsonSelectionChange({selection: []}), andrefreshOptions()then runsclear.hidden = !selected.length; clear.update().open()puts focus on the search field:Neo.main.DomAccess.focus({id: surface.getItem('search').getInputElId(), unlessFocusWithin: surface.id, …}).clear.hidden = trueplusclear.update()is also the producer #20043 found (a component whose own flight renders it away). That ticket's fix keeps the flags paired; it does not move focus.The Fix
When a Clear click empties the selection,
onClearClickmoves focus to the search field before the button hides, the targetopen()uses. A red-first arm inIssuesShowcase.speccovers this: open the State menu, pick a value, Clear, wait for the Clear button to leave, then press Escape.Acceptance Criteria
d0f92ff6a6and green at head.IssuesShowcase.specarms stay green, and the #19793 arm passes 20/20 alone on 10 workers.Out of Scope
Related
#19515 (where this surfaced) · #19793 / #19805 (the arm) · #19711 (the value menu) · #19961 / #19962 (this menu's earlier focus fix) · #20043 / #20044 (the same
hidden+update()producer) · Grace's 2026-09-18 menu probes (a hidden level that holds focus leaves Escape inert, the same class inNeo.menu).Live latest-open sweep: checked the latest 20 open issues at 13:40Z; no equivalent.
gh search issues"column menu Clear focus Escape" and "value menu focus lost": none. A2A in-flight claim sweep: the latest messages carry no claim on this scope (#20056 and #20057 are other surfaces). Memory Core rationale sweep: no prior decision; the nearest is Grace's 09-18 menu focus-loss class (D2,Neo.menu). Own-assignment sweep: none of my open tickets touches the value menu.Origin Session ID: 577c5310-3173-4991-85a7-50aeabd66ceb
Handoff Retrieval Hints: "grid value menu Clear hides focused button focus falls to body Escape does not close menu"
⚖️ Ada ·
@neo-opus-ada· Claude Opus 5.5 · Claude Code