Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
4f91747 to
895bf52
Compare
PR Analysis Report📚 Storybook Preview🧪 Sandbox PreviewModified ComponentsContextMenu (@astryxdesign/core) · View in Storybook
Component Size
Sizes are gzip. Import counts the JavaScript the import loads eagerly; CSS counts the package stylesheet rules referenced by the modules it can load from its own package, lazily loaded ones included. Bundle Size SummaryGzip figures measure each package's entry file, not the code an import pulls in.
Accessibility AuditStatus: No accessibility violations detected. Visual Regression4 of 8 shot(s) changed. A change here is a question, not a failure: check whether the after is the
Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
There was a problem hiding this comment.
Thanks — the implementation itself looks sound: a pointer open now focuses the menu with no row pre-highlighted, the keyboard path still lands on the first row, and the tests covering right-click, long press, and keyboard invocation pass.
Approval is waiting on one maintainer decision rather than on code changes. This pointer/keyboard open-focus split is recorded as proposed FR9, and the ContextMenu spec on main is still a draft with no rule for where focus goes when the menu opens; the established press-model rules cover the highlight following a held pointer, but they do not by themselves settle initial focus on open. A maintainer needs to either approve FR9 as the ContextMenu rule or point to the existing governing spec claim for pointer-open focus. Once that is settled in favour of this behavior, I found nothing else blocking: no public API change, no concrete defects, and the bottom-sheet path is unchanged.
[Automated review]
895bf52 to
6031f46
Compare
There was a problem hiding this comment.
Thanks — approval is waiting on a maintainer decision plus one fix. The ContextMenu spec on main is still a draft with no rule for where focus lands when the menu opens, so a maintainer needs to approve the proposed FR9 (pointer opens focus the menu, keyboard opens focus the first row) or point to the existing spec that governs it. Separately, the keyboard path regresses in Chromium: Shift+F10 and the Menu key are reported at the focused element's position rather than (0, 0), so they take the pointer path, and keyboard users land on the menu with no highlighted row and no visible focus indicator where main lands them on the first row. Please detect keyboard invocation from a signal real browsers provide (for example the shared last-input modality), add a Shift+F10 case to the new Chromium spec, and update the changeset and FR9 wording to match.
[Automated review]
| localX, | ||
| localY, | ||
| e.currentTarget as HTMLElement, | ||
| isKeyboardInvoked ? 'keyboard' : 'pointer', |
There was a problem hiding this comment.
In real Chromium a keyboard-invoked contextmenu (Shift+F10 or the Menu key while focus is on an element inside the trigger) is reported at that element's position with detail: 0 and button: -1, not at (0, 0). In the inline-trigger story it arrived at (615, 388). So isKeyboardInvoked is false here, the open is classified as 'pointer', and focus lands on the menu itself with no row highlighted and its ring suppressed by outline: 'none'. On main the same keypress lands on the first row.
Consider classifying keyboard invocation from a signal real browsers provide, for example the shared last-input modality in utils/interactionModality.ts. ContextMenu would need to mount useInteractionModalityTracking(); a Shift+F10 or Menu-key keydown sets keyboard. Keep (0, 0) with no detail as an extra keyboard signal. Also add a Shift+F10 case to ContextMenuOpenFocus.a11y.chromium.spec.ts: the jsdom keyboard case only covers the synthetic (0, 0) event.
There was a problem hiding this comment.
Fixed in c2a1151. ContextMenu now mounts useInteractionModalityTracking() and treats the open as a keyboard open when getInteractionModality() is keyboard, keeping (0, 0) with no detail as a second signal. A right-click's own pointerdown sets pointer. Two new cases: a jsdom Shift+F10 reported at the focused element, and a real-Chromium Shift+F10 on the inline-trigger story. The Chromium one failed against the previous head's build (the menu opened with no row focused) and passes now.
| '@astryxdesign/core': patch | ||
| --- | ||
|
|
||
| [fix] A ContextMenu opened by a right-click or a long press no longer highlights its first row: focus goes to the menu itself, so the highlight starts where the pointer goes, as a DropdownMenu opened from its trigger already does. A keyboard-invoked open (Shift+F10, the Menu key) still lands on the first row. |
There was a problem hiding this comment.
At this head the last sentence does not hold in Chromium. Shift+F10 and the Menu key are reported at the focused element's position, so they take the pointer path and land on the menu itself, not on the first row. Worth re-checking once the keyboard detection is fixed.
There was a problem hiding this comment.
Updated in c2a1151. The changeset and FR9 now say the keyboard open is detected from the last input being a key. With the fix the sentence holds in Chromium, checked by the new Shift+F10 case.
|
Decision (ENGOWNER), settling the open question: FR9 is admitted for ContextMenu. A right-click or a long press opens with focus on the menu itself and no row highlighted, as a pointer-opened DropdownMenu does. A keyboard-invoked open (Shift+F10 or the Menu key, detected from the last input being a key, or an event at (0, 0) with no detail) focuses the first enabled row. FR9 in this PR records it. |
c2a1151 to
237f2ff
Compare
237f2ff to
e863173
Compare
|
CI note: the one red case on the previous head, |
There was a problem hiding this comment.
Thanks — in real Chromium this does what it says: a right-click or a long press now opens the menu with no row highlighted, ArrowDown then reaches the first row, and Shift+F10 and the Menu key still land on the first row exactly as before. Approval is waiting on a maintainer decision: the ContextMenu spec on main is still a draft with no rule for where focus lands when the menu opens, and the decision recorded on this PR comes from its author, so a maintainer needs to approve FR9 (pointer opens focus the menu, keyboard opens focus the first enabled row) or point to the existing spec that governs open focus. One fix is needed either way: when no row is enabled, a keyboard open now moves focus to the menu container, whose static outline: 'none' hides the focus indicator the interaction-modality rules require after keyboard input, so please limit that suppression to pointer opens or keep focus on the invoking element in that case.
[Automated review]
e863173 to
2d9a920
Compare
There was a problem hiding this comment.
Approval is waiting on a maintainer decision: the ContextMenu record on main is still a draft with no rule for where focus lands when the menu opens, and the decision comment on this PR comes from its author, so a maintainer needs to approve the proposed FR9 (a right-click or long press focuses the menu with no row highlighted; a keyboard open focuses the first enabled row, or the menu if none can) or point to the existing spec that governs open focus. In real Chromium the change does what it says: no row is lit after a right-click, and Shift+F10 still lands on the first row exactly as on main. One fix is needed either way: when no row is enabled, a keyboard open now moves focus to the menu container, whose static outline: 'none' hides the focus indicator the interaction-modality rules require after keyboard input, so please limit that suppression to pointer opens or keep focus on the invoking element in that case.
[Automated review]
2d9a920 to
2fdb50f
Compare
|
Rebased onto main 6227933 (after #7369). One adjacent conflict in |
2fdb50f to
73fbc9e
Compare
There was a problem hiding this comment.
Thanks — in real Chromium this does what it says: a right-click or a long press now opens the menu with no row highlighted, Shift+F10 and the Menu key still land on the first enabled row, and the record now calls FR10 proposed in both places. Approval is waiting on a maintainer decision rather than on code changes: the ContextMenu spec on main is still a draft with no rule for where focus lands when the menu opens, so a maintainer other than the author needs to approve the proposed FR10 as written (a pointer open focuses the menu with no row lit; a keyboard open focuses the first enabled row, or leaves focus on the invoking element when none can take it) or point to the current spec that governs open focus. I found nothing else blocking.
[Automated review]
340dbff to
d2c9db7
Compare
There was a problem hiding this comment.
Thanks — in real Chromium this does what it says: a right-click or a long press now opens the menu with no row highlighted, and Shift+F10 and the Menu key still land on the first enabled row exactly as before. Approval is waiting on a maintainer decision rather than on code changes: the ContextMenu spec on main is still a draft with no rule for where focus lands when the menu opens, so a maintainer other than the author needs to approve the proposed FR10 as written or point to the current spec that governs open focus. If FR10 is approved, it would help for it to say how an open that arrives with no key press after earlier pointer use, such as an assistive tool's own context-menu command, should be treated; today it takes the pointer path. I found nothing else blocking.
[Automated review]
| | FR7 | Sub-menu rows follow `component:DropdownMenu` FR12 inside the pointer menu: ContextMenu mounts the same drill-in view stack, named after its `label`, so a sub-menu drills in on a phone here too. | `component:DropdownMenu/DEC-2` | Proposed; verified in jsdom; owner decision pending | | ||
| | FR8 | In the pointer menu ArrowDown on the last enabled row wraps to the first and ArrowUp on the first to the last; PageDown and PageUp page as in DropdownMenu FR6; a held key's auto-repeat does not activate; typeahead matches the row's label element alone. | Current source and tests; shared `useListFocus` and `useTypeahead` suites | Proposed; verified in jsdom; owner decision pending | | ||
| | FR9 | While the Pointer menu surface is open, it participates in `family:overlay-dismissal` through the shared stack and provides descendant depth. One Escape press affects only the top-most present nested surface; ContextMenu closes only when it is that surface. | `family:overlay-dismissal` FR1–FR6; `ContextMenu.test.tsx` nested-layer case | Current family projection; verified in jsdom | | ||
| | FR10 | A right-click or a long press MUST open the Pointer menu surface with focus on the menu itself (`tabIndex={-1}`, no focus outline) and no row highlighted, so the highlight starts where the pointer goes; a keyboard-invoked contextmenu (Shift+F10 or the Menu key: the last input was a key, or the event is at (0, 0) with no detail) MUST focus the first enabled row, and with none leaves focus on the invoking element. | DropdownMenu trigger opens; `module:DropdownMenu/useMenuPress` AR1; tests | Proposed; pending owner review | |
There was a problem hiding this comment.
If the owner approves FR10, it may be worth saying which way an open goes when it arrives with no key press after earlier pointer use and away from (0, 0), such as an assistive tool's own context-menu command. With "the last input was a key, or the event is at (0, 0) with no detail", that open takes the pointer path today: focus lands on the menu, not its first row.
There was a problem hiding this comment.
Added in cc07014, rebased onto main 2c3ed99. FR10 now ends: "Any other open, as from an assistive technology, is a pointer open." That is how it behaves today. An assistive technology's context-menu command after pointer use arrives with no key press and away from (0, 0), so focus lands on the menu, and its arrow keys reach the rows, as after a right-click. The page cannot tell that open from a pointer's. The owner decision on FR10 stays open.
d2c9db7 to
cc07014
Compare
There was a problem hiding this comment.
Thanks — in real Chromium this does what it says: a right-click or a long press now opens the menu with no row highlighted, ArrowDown then reaches the first row, and Shift+F10 and the Menu key still land on the first enabled row exactly as before. Approval is waiting on a maintainer decision rather than on code changes: the ContextMenu spec on main is still a draft with no rule for where focus lands when the menu opens, so a maintainer other than the author needs to approve the proposed FR10 as written, including its assistive-technology clause, or point to the current spec that governs it. One wording point to settle with that decision: FR10 calls an open that arrives before any input on the page a pointer open, but the code gives it the keyboard result (the first row), because the shared input modality starts as keyboard.
[Automated review]
| | FR7 | Sub-menu rows follow `component:DropdownMenu` FR12 inside the pointer menu: ContextMenu mounts the same drill-in view stack, named after its `label`, so a sub-menu drills in on a phone here too. | `component:DropdownMenu/DEC-2` | Proposed; verified in jsdom; owner decision pending | | ||
| | FR8 | In the pointer menu ArrowDown on the last enabled row wraps to the first and ArrowUp on the first to the last; PageDown and PageUp page as in DropdownMenu FR6; a held key's auto-repeat does not activate; typeahead matches the row's label element alone. | Current source and tests; shared `useListFocus` and `useTypeahead` suites | Proposed; verified in jsdom; owner decision pending | | ||
| | FR9 | While the Pointer menu surface is open, it participates in `family:overlay-dismissal` through the shared stack and provides descendant depth. One Escape press affects only the top-most present nested surface; ContextMenu closes only when it is that surface. | `family:overlay-dismissal` FR1–FR6; `ContextMenu.test.tsx` nested-layer case | Current family projection; verified in jsdom | | ||
| | FR10 | A right-click or a long press MUST open the Pointer menu surface with focus on the menu (`tabIndex={-1}`, no focus outline) and no row highlighted; a keyboard open (Shift+F10 or the Menu key: the last input was a key, or the event sits at (0, 0) with no detail) MUST focus the first enabled row, and with none leaves focus on the invoking element. Any other open, as from an assistive technology, is a pointer open. | DropdownMenu trigger opens; `module:DropdownMenu/useMenuPress` AR1; tests | Proposed; pending owner review | |
There was a problem hiding this comment.
If FR10 is approved, its keyboard test may want to match the code for one case: an open that arrives before any input on the page. The code reads the shared last-input modality, which starts as keyboard, so in Chromium a contextmenu with no prior key or click lands on the first row, while this row's "the last input was a key" plus "Any other open ... is a pointer open" would make it a pointer open. Wording the condition as "the shared input modality is keyboard (as it is before any input)" would close the gap; the changeset sentence could follow.
There was a problem hiding this comment.
Done in c3f043a. FR10's keyboard condition is now "the input modality is keyboard, as before any input, or an event at (0, 0) with no detail", matching the code. The changeset says the shared input modality is keyboard when "a key was the last input, or there has been none yet". A new case pins an open before any input, away from (0, 0), landing on the first row. The FR10 cell keeps its width.
There was a problem hiding this comment.
Thanks — in real Chromium this does what it says: a right-click or a long press now opens the menu with no row highlighted, ArrowDown then reaches the first row, and Shift+F10 and the Menu key still land on the first enabled row exactly as before. Approval is waiting on a maintainer decision rather than on code changes: the ContextMenu spec on main is still a draft with no rule for where focus lands when the menu opens, so a maintainer needs to approve the proposed FR10 exactly as written at this head, including its reworded keyboard condition and its assistive-technology clause, or point to the current spec that governs open focus. FR10 now matches the code for an open before any input, and I found nothing else blocking.
[Automated review]
c3f043a to
b3d4580
Compare
There was a problem hiding this comment.
Thanks — in real Chromium this does what it says: a right-click or a long press now opens the menu with no row highlighted, ArrowDown then reaches the first row, and Shift+F10 and the Menu key still land on the first enabled row exactly as before. Approval is waiting on a maintainer decision rather than on code changes: the ContextMenu spec on main is still a draft with no rule for where focus lands when the menu opens, so a maintainer needs to approve the proposed FR10 exactly as written, including its keyboard condition and its assistive-technology clause, or point to the current spec that governs open focus. I found nothing else blocking.
[Automated review]
… it (#7308) ## User impact On a phone, a `ContextMenu` a long press opens closes at once: as the finger lifts, Chromium sends the held element a compatibility `mousedown`, read as a press outside. ## Problem and solution fit - Why it occurs: the menu closes on any document `mousedown` outside it, and a touch's compatibility events target the held trigger. - Why it harms: no touch path. - Why it matters: iOS opens one only by a long press. ## Expected behavior and authority `spec:AST-094` (current) FR33: with a finger or pen, "the long press that opens a ContextMenu MUST NOT close it at the lift". `component:ContextMenu` FR5 routes the long-press lift there, and `architecture:interaction-modality` (current) INV4 asks for an operable path per modality. This PR implements that clause only; FR33's outside press (FR32), lift and handoff stay with their own work, and it changes no record row. #7303 proposes FR10 (focus on open); #7840, FR12. Overlap search over open PRs and records (`component:ContextMenu`, `layer-runtime.md`; "outside press", "long press", "compatibility"): #7303 and #7840 touch the same listener. ## Smallest restoration `main`'s outside `mousedown` listener stays, shadow-root handling included. It skips the compatibility mouse events of the finger press that opened the menu: the long press, or a touch `contextmenu` where Chromium sends one, recorded by the shared gesture counter (`Layer/gestureCounter`), which advances on every `pointerdown` and `keydown`. Any later press is a new gesture, so every other outside press keeps its outcome: a mouse or pen closes at the press, a tap on its compatibility `mousedown`, while a scroll, a cancelled or stopped `pointerdown`, an unpanned drag or a second finger leaves it open. A mouse or keyboard open records no gesture. No listener, API or default is added; `architecture:layer-runtime` names the skip. ## Evidence - Before, in real Chromium (CDP touch): the menu opens at about 510 ms; on lift come `pointerup`, `touchend`, then trusted `mousedown`, `mouseup` and `click` on the trigger, and it closes. - After: the menu stays open through that `click`, in a shadow root too; a tap or mouse click outside still closes it. - iOS Safari reportedly sends the `mousedown` mid-hold; the same gesture is skipped, but WebKit was not run here. - Regression proof: the long-press, touch `contextmenu` and moved-menu unit cases and both Chromium long-press cases fail on `main`; the mouse, pen and no-`mousedown` cases fail on the previous head and pass on `main`. ## Writing rubric results R1 narration: the layer-runtime line is present tense. R2 research: none. R3 evidence: none in the record; the tests below verify the line. R4 rejected alternatives: none. R5 change references: none. R6 open questions: none. ## Scope - [x] One defect is restored. - [x] Separable contradictory or unsettled tagalongs were removed or split. - [x] No new public API, visual representation, default, or interaction model is hidden under the bug-fix label. - [x] Public text and artifacts contain no internal Meta context. ## Testing - Maintainer merge 690291d brought in `main`: `ContextMenu.spec.md` takes `main`'s table, whose FR5 already routes the long-press lift to `spec:AST-094` FR33, so this PR no longer proposes FR11; the changeset names only the Chromium lift the tests show. The code, tests and `layer-runtime.md` line are unchanged. - Review round (163af16, rebased onto `main` 8b74911): narrowed to the long-press lift per the owner's requested change. `main`'s outside `mousedown` listener returns with one skip, the opening finger press's compatibility events (shared gesture counter); the pointer listeners, the nested-root levels and the five other outcome changes are gone. FR11, `layer-runtime.md` and the changeset say only that. ContextMenu, DropdownMenu, hooks, Layer and CLI suites: 1422 tests; long-press, shadow-root and ContextMenu audit Chromium specs: 23; native types, typecheck, `eslint` (strict), `check:knowledge` and the Storybook build pass. - Rebased onto `main` 39b5981 (486cec8), patch unchanged: the `typecheck` job's native platform types step runs a script `main` added in #8024, which 1fe5329's older base lacked. ContextMenu, DropdownMenu, hooks and CLI suites: 1216 tests; the long-press and shadow-root Chromium specs: 5; the native typecheck, build and platform-types steps, typecheck, `eslint` (strict), `check:knowledge` and the Storybook build pass. - Review round (1fe5329): the document `pointerup`/`pointercancel` listeners come on with an outside finger or pen press and off once none is live, instead of staying for the whole open menu (`architecture:react-component-runtime` INV5); `layer-runtime.md` says so. A new case shows none attached while the menu is open at rest and none after the lift; it fails on the previous head. ContextMenu, DropdownMenu, hooks and CLI suites: 1151 tests; the long-press and shadow-root Chromium specs: 5; typecheck, `eslint` (strict), `check:knowledge` and the Storybook build pass. ``` Rebased onto main 9f3ab05 (a5784a5, one commit): #7914 judged presses inside a shadow root with a `mousedown` listener on the menu's root, run before the document's. Capture reaches the document first, so each root from the document down to the menu's own now listens in the capture phase and defers a press on the host of the next root down; a press on such a host itself is judged by that host, whatever the host's own listeners do. #7914's open, closed and nested cases fire pointer events and also lift a finger on the menu; a new case stops presses in each root and on a host. They fail with the document judging every press (#7914's cases), with roots listening as the press bubbles, and with only the menu's own root listening (the new case). The `a11y/Menu press in a shadow root` stories gain a ContextMenu; the shadow-root spec checks in Chromium that a clicked item is picked (red with the document judging every press), that a press or a tap on the host closes the menu, and that its opening long press does not. `layer-runtime.md` names the extra listeners. vitest ContextMenu, DropdownMenu, Selector, hooks, Breadcrumbs Tests 1193 passed playwright MenuPressShadowRoot, ContextMenuLongPress, ContextMenuAudit --project=chromium 23 passed typecheck, lint:strict, check:knowledge, storybook:build ✓ Review round 3: rebased onto main 95e1674 as one commit; the rule is FR11, since #7303 proposes FR10 in the same record: vitest ContextMenu, DropdownMenu, useLongPress, docProp* Tests 376 passed playwright ContextMenu/__tests__ --project=chromium 23 passed typecheck, lint:strict, check:knowledge, storybook:build ✓ Review round 2: the listeners run in the capture phase, so a control that stops the press (ResizeHandle, Table's column-resize handle) still closes the menu; new case "closes on a press whose control stops it" fails with bubble-phase listeners: vitest ContextMenu, DropdownMenu, useLongPress, docProp* Tests 374 passed (DropdownMenuLazySheet's import hook timed out at 10 s under load; 2 passed alone) playwright ContextMenu/__tests__ --project=chromium 23 passed typecheck, lint:strict, check:knowledge, storybook:build ✓ Review round: the three changed presses are named (changeset, body, commit message), a new case pins the cancelled press, the unpanned drag and a second finger's tap (it fails on `main`), and docs/architecture/layer-runtime.md names the new listeners: vitest ContextMenu, DropdownMenu, useLongPress, docProp* Tests 375 passed playwright ContextMenu/__tests__ --project=chromium 23 passed typecheck, lint:strict, check:knowledge, storybook:build ✓ Rebased onto main 22c592a as one commit. Main's record now has FR9 (overlay dismissal), so this rule was proposed FR10 (now FR11, beside #7303's FR10): vitest ContextMenu, DropdownMenu, hooks, docProp* Tests 854 passed playwright ContextMenu/__tests__ --project=chromium 23 passed typecheck, lint:strict, check:knowledge, storybook:build ✓ red on main: `ContextMenuLongPress.a11y.chromium.spec.ts` against a `main` build: 1 failed (the long press and lift), 1 passed (the guard) pnpm exec vitest run packages/core/src/ContextMenu/ContextMenu.test.tsx -t "ContextMenu outside dismissal" main's ContextMenu.tsx: 3 failed, 3 passed (tap/scroll, mouse and mid-tap re-render guards) · with the change: 6 passed (the pen case fails on main, where a pen closes it at once; the re-render case failed on an earlier head) pnpm exec vitest run packages/core/src/ContextMenu packages/core/src/DropdownMenu packages/core/src/hooks/useLongPress.test.tsx \ packages/core/src/hooks/useMenuPress.test.tsx packages/core/src/docPropLiterals.test.ts \ packages/core/src/docPropReferences.test.ts --maxWorkers=8 Test Files 9 passed (9) Tests 324 passed (324) pnpm storybook:build (this branch; main for the red arm) ASTRYX_STORYBOOK_DIR=<main build> pnpm exec playwright test \ packages/core/src/ContextMenu/__tests__/ContextMenuLongPress.a11y.chromium.spec.ts --project=chromium 1 failed, 1 passed (long press: the menu is gone after the lift's click; mouse guard passes) pnpm exec playwright test packages/core/src/ContextMenu/__tests__/ContextMenuLongPress.a11y.chromium.spec.ts --project=chromium 2 passed · --repeat-each=2: 4 passed pnpm -F @astryxdesign/core typecheck, pnpm lint:strict, check:knowledge ✓ ```
openAtLocalPoint focused the first row on every open, so a right-click or a long press opened the menu with that row lit as if chosen. A pointer open now focuses the menu itself (tabIndex -1, no outline, as DropdownMenu does for its trigger), so the highlight starts where the pointer goes; a keyboard-invoked contextmenu (Shift+F10, the Menu key) still focuses the first row. Proposed FR9 of component:ContextMenu records it.
…n the invoking element With every row disabled, Shift+F10 or the Menu key no longer moves focus to the menu container, which draws no indicator; focus and its ring stay on the element that invoked the menu, as before this change. A right-click or a long press still focuses the menu.
… the pointer path An assistive technology's context-menu command after pointer use arrives with no key press and away from (0, 0), and opens as a right-click does: focus on the menu, whose arrows reach the rows. FR10 now says that any open matching neither keyboard condition is a pointer open. Record wording only; the cell keeps its length so the table is not re-padded.
…odality, keyboard before any input The code opens on the first row when the shared input modality is keyboard, which it is before any input on the page; FR10 said "the last input was a key" and called every other open a pointer open, so an open before any input was described wrongly. FR10 and the changeset now name the modality, and a case pins an open before any input landing on the first row. The FR10 cell keeps its width.
b3d4580 to
9b1d25c
Compare
There was a problem hiding this comment.
In real Chromium this does what it says: a right-click or a long press now opens the menu with no row highlighted, ArrowDown then reaches the first row, and Shift+F10 and the Menu key still land on the first enabled row exactly as before. Approval is waiting on a spec decision rather than on code changes: the long-press part already matches the touch-presentations spec (AST-094 FR33) and the MoreMenu record now states the same split for its own trigger, but no current spec decides where a ContextMenu right-click puts focus or which opens count as keyboard opens, so an engineering owner needs to approve proposed FR10 in the ContextMenu record exactly as written, including its keyboard condition and its assistive-technology clause, or point to the current spec that governs it. An engineering owner records that decision by commenting /approve-spec <full head SHA> on this pull request, and the author may do so if they are an engineering owner. I found nothing else blocking.
[Automated review]
Main's meta#8648 added ContextMenu FR10 (ContextMenu is built on the public headless context menu), taking the number this branch proposed. Its text and verification row are kept as merged; this branch's open-focus rule becomes proposed FR11, and FR5's closing sentence points at FR11.
There was a problem hiding this comment.
Full review of 1446c9e; the incremental delta could not be read: the merge with main resolved a conflict inside the ContextMenu spec record, moving the open-focus rule from FR10 to FR11.
In real Chromium the change does what it says: a right-click or a long press opens the menu with no row highlighted, ArrowDown then reaches the first row, and Shift+F10 still lands on the first enabled row exactly as before. Approval now waits on a spec decision rather than on code changes, because the public gesture hooks spec that landed on main (AST-107 FR8) says the headless context menu that ContextMenu is built on starts focus on the first enabled row after a right click too, so proposed FR11 contradicts a current spec, while the long-press part already matches the touch-presentations spec (AST-094 FR33). An engineering owner needs to decide whether pointer opens should light no row: if so, AST-107 FR8's focus sentence has to be amended alongside FR11, here or on main first, and an engineering owner records approval of FR11 by commenting /approve-spec <full head SHA> on this pull request, which the author may do as an engineering owner; if not, a right-click should keep focusing the first enabled row and only the long press changes.
[Automated review]
| | FR8 | In the pointer menu ArrowDown on the last enabled row wraps to the first and ArrowUp on the first to the last; PageDown and PageUp page as in DropdownMenu FR6; a held key's auto-repeat does not activate; typeahead matches the row's label element alone. | Current source and tests; shared `useListFocus` and `useTypeahead` suites | Proposed; verified in jsdom; owner decision pending | | ||
| | FR9 | While the Pointer menu surface is open, it participates in `family:overlay-dismissal` through the shared stack and provides descendant depth. One Escape press affects only the top-most present nested surface; ContextMenu closes only when it is that surface. | `family:overlay-dismissal` FR1–FR6; `ContextMenu.test.tsx` nested-layer case | Current family projection; verified in jsdom | | ||
| | FR10 | ContextMenu is built on the public headless context menu (`spec:AST-107` FR8): its invocation, open state, and cleanup are the factory's, with no behavior of its own beside the factory's. | Owner decision, 2026-10-26; `spec:AST-107` FR8 | Decided | | ||
| | FR11 | A right-click or long press MUST open the Pointer menu surface with the menu focused (`tabIndex={-1}`, no outline) and no row highlighted; a keyboard open (Shift+F10, Menu key: the input modality is keyboard, as before any input, or an event at (0, 0) with no detail) MUST focus the first enabled row, or with none keep focus on the invoking element. Any other open, as an assistive technology's, is a pointer open. | DropdownMenu trigger opens; `module:DropdownMenu/useMenuPress` AR1; tests | Proposed; pending owner review | |
There was a problem hiding this comment.
FR11 contradicts current spec:AST-107 FR8, which says the headless context menu this record's FR10 builds ContextMenu on opens on "a long press, a right click, or Shift+F10" and "its menu follows the WAI-ARIA menu pattern: focus starts on the first enabled row". If an engineering owner keeps FR11, FR8's focus sentence needs the same pointer-open carve-out, here or on main first, and FR11's basis can cite it; otherwise the right-click branch should keep focusing the first enabled row, leaving only the long press to change under spec:AST-094 FR33.
|
I'm pausing this work for now to reduce contention on the repo. Thank you for the reviews and the spec guidance. |
User impact
What led to it: this comes from moving every menu and picker in our app onto Astryx, which began with a press, slide and lift bug in its phone menus. Doing that showed that right-clicking or long-pressing opens a
ContextMenuwith its first row already lit.Why: that row looks chosen before the person has moved, in every context menu a pointer opens. A
DropdownMenuopened by a pointer lights nothing.Problem and solution fit
openAtLocalPointfocuses the first row on every open, and in a menu the lit row is the focused row. Now a right-click or a long press focuses the menu itself, so nothing is lit until the pointer or an arrow key moves; a keyboard open (Shift+F10, the context-menu key) still focuses the first row.Expected behavior and authority
module:DropdownMenu/useMenuPress(current) says the lit row is the focused row, and under a held press the row under the pointer.component:DropdownMenualready splits pointer and keyboard opens this way. This PR proposescomponent:ContextMenuFR11 for the same split, pending owner review.Owner question:
spec:AST-107FR8 says focus starts on the first enabled row after any context request. This PR's FR11 lights no row after a pointer request (right click, long press), matchingDropdownMenu's pointer/keyboard split andspec:AST-094FR33. Should FR8 say that a pointer request focuses the menu with no row lit, and a keyboard request focuses the first row?Smallest restoration
spec:AST-107FR8 as written, but a right click still opens with a lit row, unlikeDropdownMenu.DropdownMenu. The cost is a small rule for telling the two apart: a keyboard open is one whose last input was a key, or acontextmenuevent at (0, 0) with no detail.No API, default or visual change; the bottom sheet is unchanged.
Evidence
In Chromium, a right-click or a touch long press used to leave a row focused; now the menu holds focus and ArrowDown reaches the first row, while a real Shift+F10 still focuses the first row. Three of the six new cases in
ContextMenu.test.tsxand both cases inContextMenuOpenFocus.a11y.chromium.spec.tsfail onmain.Writing rubric results
R1 narration: none in FR11.
R2 research: none.
R3 evidence: FR11 cites a module record and tests.
R4 rejected alternatives: none added.
R5 change references: none.
R6 open questions: none.
Scope
Testing
In Storybook, open Core/ContextMenu → Default.