Context
Neo has inline Menu examples and a Button-owned floating menu example, but no permanent example for the common application pattern: open a floating menu from onContextMenu at the pointer coordinate. No Engine whitebox journey covers real right-click input, nested menu focus, outside-pointer dismissal, or viewport-edge placement.
A temporary complete Body example proved why the missing example matters:
- center placement through direct fixed
left/top was exact;
- near
(1260,700) in a 1280×720 viewport, the menu overflowed to right=1361.63, bottom=789;
- real nested submenu clicks were green on this machine, while a downstream report observed a load-sensitive root unmount;
- non-focusable outside clicks left both Menu and Picker open because focus did not move.
The permanent example is the consumer proof for the alignment and floating-dismissal prerequisites, not a place to reimplement them.
The Problem
Developers currently have to infer five non-obvious pieces from unrelated sources: contextmenu default prevention, reusable Menu construction, pointer geometry, floating alignment, and focus/dismissal lifecycle. The predictable result is application-root listeners, direct coordinate styles, removed parentComponent links, synthetic-click false greens, and business-app-specific fixes.
The Architectural Reality
examples/menu/ is the canonical Body example family. A complete examples/menu/context/ app matches the existing list/ and panel/ structure.
- The example consumes serialized point alignment from #17824 and pointer-complete Menu dismissal from #17825.
- Context menus are not Button menus: they have no persistent trigger component. The pointer point is the alignment target, and the Menu's own outside-pointer contract owns dismissal.
- Whitebox E2E belongs at
test/playwright/e2e/rendering/ContextMenuNL.spec.mjs, beside ButtonBaseNL.spec.mjs.
- Physical behavior must use real Playwright mouse input. Synthetic
click/contextmenu dispatch does not prove browser focus transitions.
The Fix
Add a small, public examples/menu/context/ application:
- one non-focusable workspace region and one naturally focusable item;
onContextMenu creates/reuses one floating Neo.menu.List with nested and leaf actions;
- native context-menu default is prevented on the example surface;
- the Menu aligns to
{x: clientX, y: clientY, width: 0, height: 0} with edgeAlign: 't0-b0', axisLock: true, and viewport constraint;
- a visible status component records the selected leaf action without business-domain logic.
Add a whitebox journey that drives the real browser and asserts both rendered and worker truth.
Contract Ledger
| Target Surface |
Source of Authority |
Proposed Behavior |
Fallback / Edge Case |
Docs |
Evidence |
New examples/menu/context/ |
This ticket + existing Menu examples |
Teach the minimal reusable right-click Menu pattern |
No application root listener or direct left/top fallback |
Example JSDoc and visible instructions |
Browser + Neural Link journey |
| Pointer placement |
#17824 |
Open at the pointer and stay fully inside the viewport through flip/constrain |
Reopen at a new point updates the same Menu instance |
Example code |
Center + four-edge geometry assertions |
| Menu lifecycle |
#17825 |
Nested real clicks stay open; leaf, Escape, focusable outside, and non-focusable outside paths settle correctly |
No wall-clock sleeps as correctness assertions |
Example code |
Worker state + activeElement + DOM presence |
| Real-input evidence |
Whitebox E2E protocol |
Use page.mouse right/left clicks and keyboard Escape, then assert Engine state via Neural Link |
Synthetic event dispatch is not accepted as the only positive path |
Spec comments only |
Exact custom E2E command |
Decision Record impact
none — this adds a canonical consumer and executable documentation for existing Engine components.
Acceptance Criteria
Out of Scope
- Business permissions, editor commands, occurrence search, delete-key behavior, or any downstream application code.
- A context-menu framework subclass, application controller scaffold, guide archaeology, or multiple demo variants.
- Touch long-press, OS-native menus, or custom animation design.
- Fixing alignment or dismissal inside the example PR; it consumes the prerequisite contracts.
Avoided Traps
- Copying the downstream workaround: would publish application ownership for framework behavior.
- Synthetic-click proof: misses the exact real-focus failure class.
- Oversized studio demo: obscures the reusable menu contract behind product code.
Related
Live latest-open sweep: checked the latest 20 open issues plus exact context-menu / right-click / example / whitebox searches at 2026-08-28T08:17:48Z; no equivalent found beyond prerequisites #17824 and #17825 created in this lane. A2A all-status recency sweep: 30 messages; no competing claim.
Origin Session ID: d893ccaa-a773-4796-a67c-748667ab2563
Retrieval Hint: "examples menu context real right click nonfocusable outside submenu viewport edge whitebox"
Context
Neo has inline Menu examples and a Button-owned floating menu example, but no permanent example for the common application pattern: open a floating menu from
onContextMenuat the pointer coordinate. No Engine whitebox journey covers real right-click input, nested menu focus, outside-pointer dismissal, or viewport-edge placement.A temporary complete Body example proved why the missing example matters:
left/topwas exact;(1260,700)in a1280×720viewport, the menu overflowed toright=1361.63,bottom=789;The permanent example is the consumer proof for the alignment and floating-dismissal prerequisites, not a place to reimplement them.
The Problem
Developers currently have to infer five non-obvious pieces from unrelated sources: contextmenu default prevention, reusable Menu construction, pointer geometry, floating alignment, and focus/dismissal lifecycle. The predictable result is application-root listeners, direct coordinate styles, removed
parentComponentlinks, synthetic-click false greens, and business-app-specific fixes.The Architectural Reality
examples/menu/is the canonical Body example family. A completeexamples/menu/context/app matches the existinglist/andpanel/structure.test/playwright/e2e/rendering/ContextMenuNL.spec.mjs, besideButtonBaseNL.spec.mjs.click/contextmenudispatch does not prove browser focus transitions.The Fix
Add a small, public
examples/menu/context/application:onContextMenucreates/reuses one floatingNeo.menu.Listwith nested and leaf actions;{x: clientX, y: clientY, width: 0, height: 0}withedgeAlign: 't0-b0',axisLock: true, and viewport constraint;Add a whitebox journey that drives the real browser and asserts both rendered and worker truth.
Contract Ledger
examples/menu/context/left/topfallbackpage.mouseright/left clicks and keyboard Escape, then assert Engine state via Neural LinkDecision Record impact
none— this adds a canonical consumer and executable documentation for existing Engine components.Acceptance Criteria
examples/menu/context/and passes the examples Body-only/build guards.Out of Scope
Avoided Traps
Related
Live latest-open sweep: checked the latest 20 open issues plus exact context-menu / right-click / example / whitebox searches at
2026-08-28T08:17:48Z; no equivalent found beyond prerequisites #17824 and #17825 created in this lane. A2A all-status recency sweep: 30 messages; no competing claim.Origin Session ID:
d893ccaa-a773-4796-a67c-748667ab2563Retrieval Hint: "examples menu context real right click nonfocusable outside submenu viewport edge whitebox"