Repository navigation
feat(ContextMenu): where a coarse pointer's held finger opens the menu (presentation unset, or adaptive where it stays a popover), the same finger slides onto an item and its lift selects it - #8133
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
11d17f0 to
30320a7
Compare
There was a problem hiding this comment.
This pull request is on hold for an engineering owner's decision: sliding the finger that opened a ContextMenu onto an action is a clear win on touch, but a lift before the finger has moved 10 px acts on nothing even over a row, which departs from the current useMenuPress FR1 ("A row MUST act when a press is released over it"), and no spec record states that handoff yet. An engineering owner can settle it by amending the useMenuPress record with the handoff exception (or asking for FR1 behavior), approving or rejecting the new draft requirements (AST-094, the touchOpen press mode in FR9 and DEC-8), and recording the decision by commenting /approve-spec 30320a7995ce2444f8b9a8a3abfee712ce6c1655 on this pull request; the author may do so as an engineering owner. Independently of that decision, please narrow this pull request to the ContextMenu change once its dependencies land (it currently carries about 27,000 authored lines) and fix these:
useMenuPress.spec.mdstill lists a 500 ms long-press delay whileuseMenuPress.tsnow uses 150 ms.- The
isOpenEffect inContextMenu.tsxsets state after the menu closes; do that work in the close handler instead. MenuPressContinuationdocumentsxandy, whichcontinueGesturenever reads.
[Automated review]
PR Analysis Report
Generated by PR Enrichment workflow | View current CI run |
30320a7 to
8507258
Compare
There was a problem hiding this comment.
This pull request is on hold for an engineering owner's decision: letting the finger that opened a ContextMenu slide onto an action is a clear improvement on iPhone and iPad, but a lift before that finger has moved 10 px acts on nothing even over a row, which departs from the current useMenuPress FR1 ("A row MUST act when a press is released over it"), and the branch also adds draft requirements no owner has approved yet (AST-094, the rewritten useMenuPress FR9 and DEC-8, and DropdownMenu FR8). An engineering owner can settle it by amending the useMenuPress record with the handoff exception (or asking for FR1 behavior), approving or rejecting those draft requirements, and recording the decision by commenting /approve-spec 8507258b8d930890afc2e5c68bc86d6ca7bbe152 on this pull request; the author may do so as an engineering owner. Independently of that decision, please narrow this pull request to the ContextMenu change once its dependencies land (it currently carries about 28,000 authored lines) and fix these:
useMenuPress.spec.mdstill lists a 500 ms long-press delay whileuseMenuPress.tsnow uses 150 ms.- The
isOpenEffect inContextMenu.tsxsets state after the menu closes; do that work in the close handler, or name the external system it synchronizes. MenuPressContinuationdocumentsxandy, whichcontinueGesturenever reads.
[Automated review]
8507258 to
53ad03a
Compare
|
Addressed in 53ad03a:
|
There was a problem hiding this comment.
This pull request is on hold for an engineering owner's decision: letting the finger that opened a ContextMenu slide onto an action is a clear improvement on touch screens, but a lift before that finger has moved 10 px acts on nothing even over a row, which departs from the current useMenuPress FR1 ("A row MUST act when a press is released over it"), and the branch also adds draft requirements no owner has approved yet (AST-094, the rewritten useMenuPress FR9 and DEC-8, and DropdownMenu FR8). An engineering owner can settle it by amending the useMenuPress record with the handoff exception (or asking for FR1 behavior), approving or rejecting those draft requirements, and recording the decision by commenting /approve-spec 53ad03a281b02154cf8d36087e0436518cc2dfb8 on this pull request; the author may do so as an engineering owner. Independently of that decision, please narrow this pull request to the ContextMenu change once its dependencies land (it carries about 34,000 authored lines today) and fix these:
- ContextMenu's import grows by about 28 KB gzip of touch-only code; load it lazily for coarse pointers or justify the cost, as
component-style-authoringINV6 requires. - The new
platformtheme-adaptation condition is outside the closed vocabulary ofAST-012FR2; drop it or have FR2 amended first. - CI's
pressableCoverage.test.tsfails becauseContextMenu.tsxcallsusePressFeedback()without a press arm the guard recognises. useMenuPress.spec.mdstill lists a 500 ms delay and the settle rule for the opening finger; #8078's current head already fixes both.- The slide-to-pick changeset says Android keeps today's menu, and the touch-presentation changeset says a theme's
mdis followed; neither matches the code. MenuPressContinuationdocumentsxandy, whichcontinueGesturenever reads.
[Automated review]
53ad03a to
263437c
Compare
There was a problem hiding this comment.
This pull request is on hold for an engineering owner's decision: letting the finger that opened a ContextMenu slide onto an action is a clear improvement on touch screens, but a lift before that finger has moved 10 px acts on nothing even over a row, which departs from the current useMenuPress FR1 ("A row MUST act when a press is released over it"), and the branch also adds draft requirements no owner has approved yet (AST-094, the rewritten useMenuPress FR9 and DEC-8, and DropdownMenu FR8). An engineering owner can settle it by amending the useMenuPress record with the handoff exception (or asking for FR1 behavior), approving or rejecting those draft requirements, and recording the decision by commenting /approve-spec 86076e91586049ffb2f1c493270f5b0998440577 on this pull request; the author may do so as an engineering owner. Independently of that decision, please narrow this pull request to the ContextMenu change once its dependencies land (it carries about 38,500 authored lines today) and fix these:
- An explicit
presentation="popover"no longer opens the menu from a held finger, so on iPhone and iPad that ContextMenu cannot be opened by touch at all; keep the previous long press there, asAST-017FR3 requires of the restoring value. - ContextMenu's import grows by about 31 KB gzip of touch-only code, including spring rows it never reads; load it lazily for coarse pointers or justify the cost, as
component-style-authoringINV6 requires. useMenuPress.spec.mdstill lists a 500 ms delay and the settle rule for the opening finger, while the code uses 150 ms and the 10 px handoff.- The slide-to-pick changeset says Android keeps today's menu, and the touch-presentation changeset says a theme's
mdis followed; neither matches the code. MenuPressContinuationdocumentsxandy, whichcontinueGesturenever reads.- The new
@astryxdesign/core/motion/reducedMotion.stylexsubpath is stable and cites anAST-094open question that does not exist; drop it or keep it experimental.
[Automated review]
…droid 15 Chromium 158)
86076e9 to
a885d27
Compare
Main's meta#11735 re-aligned spec:AST-094's verification table and widened its FR5 row. The one conflict is that table. The merge takes main's table and re-applies this pull request's two additions to the FR15-FR17 row: the late-deadline cases and the failure they catch.
Brings the arena fix's ec2e905: main 64806d0, FR16's third sentence in the first sentence's gate, and two dropped comments. The one conflict is spec:AST-094's verification table, which main's meta#11735 re-aligned. The merge takes main's table and re-adds this pull request's FR43 late-begin row.
spec:AST-094's FR16 gap note said a late deadline waits 50 ms or more. Since the arena fix, that holds only while the latest contact is a finger or a pen, as FR16 says. ContextMenu's touch hold is a finger's or a pen's, so its menu can still show that much later.
The proof turned touch on only after the page loaded, then pressed at once and gave the menu 2 s. The touch layer loads after the first paint, when the page is idle, within 2 s. A finger that lands sooner starts its hold only when the layer mounts. On a busy machine the menu then opened after 2 s, and the proof failed. Touch is now on from the first paint. In the touch-model case the proof waits for the layer's chunk, its module and two frames, as the interaction proof does, then presses. The popover story keeps today's long press and loads no layer, so it does not wait. With the chunk held 2.5 s, the old proof fails and the new one passes.
Brings meta#8125's test fix: the lift's click proof turns touch on from the first paint and waits for the touch layer. No conflicts.
After a failed load, only a touch on a trigger should ask again. A trigger that mounts is no intent, so it must start no load. This case fails here: the failure path clears the windows that scheduled the load, so the next trigger to mount schedules a new one.
The failure path cleared the windows that had scheduled the load, so the next trigger to mount started a new load with no intent. The windows now keep their mark, and only a touch on a trigger asks again, as the touch layer's load rule says.
The comment said a finger's pointerdown follows its touchstart "as in WebKit", with no record or probe behind it. It now names only the order it handles.
The shared-identity check flags four module-scope bindings in the touch loader: its state, the windows that scheduled the load, the load in flight and the listeners. Each copy of Core loads and renders its own touch layer, whose component reads that copy's contexts, so the state stays per copy. The baseline allows the four with that reason.
Brings meta#8125's fixes from review: after a failed load only a touch asks again, the pointer-order comment, and the touch loader's per-copy state in the shared-identity baseline. No conflicts.
From review: one sentence of the press feedback's growth comment ran 26 words. It is now two: the press machine never ends the growth; the recognizer ends it, and the menu holds and returns it.
From review: the trigger pairs a late finger with its pointer in both orders, but only pointerdown-then-touchstart had a case. This one sends the touchstart first, holds the finger through the load, and slides it onto Share. With meta#8125's branch for that order removed, it fails on both platforms, since Share never takes the focus; the pointerdown-first case still passes. With the branch, both pass.
The public hook stripped prepare() and releasePrepared() from its return with a memo and a rest copy, on every page that uses a layer. Only ContextMenu calls them, through useLayerInternal. The public type already hides them, so the hook now returns the object as is. A page with DropdownMenu but no ContextMenu drops 25 B gzip.
Brings meta#8125's change that hides prepare() from the public useLayer by type only, sparing every page with a layer the runtime strip. No conflicts.
From review: after a failed load, a trigger whose window never scheduled the load, such as one in a same-origin frame, still starts one when it mounts. Only a touch should ask again, in every window. This case mounts such a trigger after the failure; it fails here.
After a page-wide failure, a trigger whose window had not scheduled the load still scheduled one as it mounted, with no intent. The load now waits for a touch in every window: scheduleLoad does nothing once the latest load has failed.
From review: since add87da the public useLayer returns the implementation's object, so it carries prepare() and releasePrepared() at runtime. Only its return type leaves them out. The layer-runtime record now says so.
Brings meta#8125's fixes from review: after a failed load no window schedules another, and the layer-runtime record says prepare() is hidden from useLayer's type only. No conflicts.
|
/approve-spec 8f14c7c |
There was a problem hiding this comment.
Changes requested. An engineering owner approved this head's record text and every earlier code finding is fixed; what remains is device evidence at this head:
- The Android emulator takes the touch-presentation record requires at the exact head (Chrome with Gboard at normal animation scale, with animations removed, and on a slow-device profile) are not stated, so run them at the landing head and state each result in the description.
- The real-iPhone side-by-side against the head the owner passed does not carry here, because this branch changed ContextMenu, its touch layer, loader and press, and the gesture arena and host since the last take, so run the six cases again and state the result.
A new head needs a fresh /approve-spec <full head SHA> from an engineering owner (the author may, as one). Non-blocking: name Layer and the gesture arena in the Scope line, since the outside-press watch gains a press listener and the arena's wait now reaches every touch recognizer.
Claims and files checked
Review mode: same-head; reason: none
- Changeset, outside-press watch: a mouse or pen press closes the menu at its press in the menu's own document, and a press in the page no longer closes a menu in another frame: verified (
Layer/outsidePress.ts:226-245; the ContextMenu case for the menu's own document). - Changeset, slide to pick: after the hold opens the menu, the same finger picks the action it lifts over once it has moved 10 px, a still lift picks nothing, and a lift over no action leaves the menu open: verified (ContextMenu slide cases;
useMenuPresscontinuation suite). - Changeset, touch timeline: growth from 150 ms toward the held size on the lift spring, commit at 400 ms, menu at 735 ms or at a lift after 400 ms, 11.5 px drift, early-lift return, pan-outside close, no row lit on a touch open, the 500 ms long press under a fine pointer and with
presentation="popover", and the touch code loaded after first paint: verified against the constants and unit cases; device behavior not verified at this head. - Changeset, gesture arena: a late finger or pen deadline waits 50 ms for queued input, a mouse keeps the one-task yield, and a deadline among coalesced samples runs between them: verified (arena unit cases); the List and Pager outcomes rest on the same shared arena.
- Changeset, menu press continuation:
useMenuPressreturnscontinueGesture, and the hooks entry exportsMenuPressContinuation: verified (hooks/useMenuPress.ts:1074-1096,hooks/index.ts, built API surface). - Description: the menu that opens under a held finger takes it as its opening press, and a menu opened at the lift hands nothing over: verified (
ContextMenuTouchLayer.tsx:91-101,ContextMenu.tsx:874-885). - Description: a finger held through the touch layer's load hands over too: verified (the held-through-load slide case).
- Description: mouse, keyboard, popover presentation and fine pointers are unchanged: verified (touch and coarse-pointer gating in the code).
- Description: line counts over the growth pull request's head: verified (numstat).
- Description: first-load gzip on the four reference pages: stated, not re-measured.
- Description: the iPhone side-by-side and Android takes have not run at this head: verified, so neither is evidence yet.
- Description: the unit, typecheck and merge claims: the units this change reaches pass (79 files, 2,230 tests), the core typecheck passes, and the head merges with
mainwithout conflict; browser specs not re-run. - Files read by their whole diff: ContextMenu, its touch layer, loader, press recognizer and press feedback, the context-menu constants, the private trigger attribute, the menu press hook with its docs and export, Layer's show path and outside-press watch, the gesture arena, host and types, the motion README, the five changesets, the four records, the component docs, the story and the two data files: findings as above, the rest clear.
- Test files: all unit files run; the slide, late-begin, failed-load and arena cases read; the browser specs and the rest of the test diff not read line by line.
| * The latest event's positions at the times they came with, oldest first, | ||
| * ending with the current one. The arena's clock never runs back, so it | ||
| * holds a late input's `time` and filters `samples`; it does not change | ||
| * these. |
There was a problem hiding this comment.
Non-blocking (architecture:knowledge-contracts INV29): "it holds a late input's time and filters samples; it does not change these" has no clear referent for "it" and "these". Suggested: "The latest event's positions at the times they came with, oldest first, ending with the current one. The arena may hold time back for a late input. These samples keep the times the input came with."
Stack: #11837 → #8125 → #9816 → #8133 → #8201
Merge group: #8125, #9816, #8133
User need
A long press opens the ContextMenu under the finger, but that finger can't pick: the user lifts and presses again. DropdownMenu and iOS context menus let it slide onto an item and lift.
Problem and solution fit
pointerIdOfnames its pointer, andcontinueGesturetakes it as the opening press.spec:AST-094FR33). Past 10 px from the first position the open menu sees, the item under the finger lights and the lift selects it. A still lift selects nothing.Current specification
module:DropdownMenu/useMenuPressFR11 asks for this continuation, andcomponent:ContextMenuFR5 for the handoff. New FR13 states the slide. After the touch model's hold opens the menu at the finger, the same finger may slide onto an item without lifting. Lifting over an item selects it, and lifting over no item leaves the menu open. FR33's handoff follows.Public delta and caller burden
useMenuPress's return gains a documentedcontinueGesture, with an exportedMenuPressContinuationtype. First-load gzip over #9816: menu +115 B, table +142 B.Design and alternatives
Rejected: ContextMenu tracking the finger, since the shared press model owns the highlight, pick and stray click.
continueGestureis ported from #8507, which closes as absorbed.Evidence
The real-device iPhone side-by-side against f913915 and the Android (DEC-27) emulator takes have not run at this head. At 936263c, on an iPhone 14 (iOS 26.2 Safari), it matched f913915 in all six cases. They are the hold, early lift, drift, slide onto an item, still lift and pan outside.
Scope
Components: ContextMenu, useMenuPress
Writing rubric results
Over
component:ContextMenu: FR13 adds the slide, then FR33's handoff; FR5 points to it in place of its gap, at the same cell width. FR11 ofmodule:DropdownMenu/useMenuPressnames it, and its public contract and concepts table namecontinueGesture.module:DropdownMenu/useMenuPressFR11 andspec:AST-094FR33.Testing
This round, at 8f14c7c, on main 64806d0:
ContextMenu.tsx, the imports take this pull request's held-pointer type and feat(ContextMenu): open from a held finger on iOS 26's timeline #8125's late-touch type and retry. The record keeps this pull request's rows and takes feat(ContextMenu): open from a held finger on iOS 26's timeline #8125's FR12 additions.useCommittedRefInto(architecture:react-component-runtimeINV17).presentation="popover"under a coarse pointer.useLayerslimming. No conflicts.useMenuPress'scontinueGesture, which only ContextMenu calls. The rest, about 1,679 B, is ContextMenu's own code. Measured as.github/scripts/lib/component-size.jsmeasures an import: the size report's esbuild options, eager chunks only.spec:AST-094DEC-31).Local checks at bd883b0, one worker:
test:ui --changed, the boundary test included): 519 files, 15,472 passed;pnpm review:pre(0 findings; merges clean).Final local checks at 8aed263, one worker:
test:ui --changed, the boundary test included), from a fresh results cache: 519 files, 15,475 passed. Runs that reused an earlier run's order timed out four tests at the cold start. They are main'ssemanticFence.sharedanduseToast.fallback.sharedtests, and ContextMenu's two sheet-loading tests, from main's perf(ContextMenu): load the touch sheet's action list only for the sheet presentation #11616. On main in that order, the sheet-loading file took 27.5 s, near the 30 s limit;pnpm review:pre(0 findings; merges clean).At 8f14c7c, which brings #8125's loader fix, the ContextMenu, Layer, DropdownMenu and
useMenuPressunits ran again: 1,420 passed. So did the core typecheck, strict eslint, prettier, check:knowledge, the shared-identity check andpnpm review:pre(0 findings; merges clean).The previous round, at 9df32ef:
ContextMenu.tsx: this pull request'sContextMenuHeldPointerjoins feat(ContextMenu): open from a held finger on iOS 26's timeline #8125's type-only import of the layer, so the layer stays out of the first load;ContextMenuTouchLayer.tsx: the doc comment keeps this pull request's "A finger still down goes on into the menu" and feat(ContextMenu): open from a held finger on iOS 26's timeline #8125's before-load sentence;component:ContextMenuFR12: feat(ContextMenu): open from a held finger on iOS 26's timeline #8125's before-load sentence and its evidence, on this pull request's table.ContextMenu.tsximports and FR12's evidence row..github/scripts/lib/component-size.jsmeasures an import: the size report's esbuild options, eager chunks only.spec:AST-094DEC-31). They are the real-device side-by-side against f913915 and the Android emulator takes.Local checks at 9df32ef, one worker:
test:ui --changed, the boundary test included): 517 files, 15,432 passed;lazy-sheet-bundle.test.mjs: 4 passed;pnpm review:pre(0 findings; merges clean).The previous round, at acd9841:
utils/pressFeedback.tsand the bottom sheet'sListItem, which main's feat(core): swipe actions come from createSwipe on the shared drag path #8690 changed since 936263c. So the device runs start again at acd9841: the real-device side-by-side against f913915 and the Android emulator takes.Local checks at acd9841, one worker:
test:ui --changed): 516 files, 15,408 passed;The previous round, at 936263c:
Layer/useLayer.tsx. It merges with no conflict, and this pull request's own diff over feat(ContextMenu): a held finger grows the trigger on UIKit's lift spring #9816 is unchanged (same patch-id).Layer/useLayer.tsxat run time, and main's fix(layer): a release does not dismiss the layer it opened #11258 and fix(layer): a press on another trigger of an open layer opens it there #11337 changed it since e165a7b. So the device runs started again at 936263c.Local checks at 936263c, one worker:
test:ui --changed): 500 files, 14,933 passed;The previous round, at ace89cf:
DropdownMenu/DropdownMenu.tsx, whichContextMenu.tsximports types from (import type). None of them changed, and a type import is erased at build. No file this pull request's code loads at run time changed since e165a7b, where the real-device side-by-side ran. The Android emulator takes did not run at that head.Local checks at ace89cf, one worker:
test:ui --changed): 499 files, 14,845 passed;The previous round, at a4b9181:
Local checks at a4b9181, one worker:
useMenuPressunits, 87 passed;The previous round, at e165a7b:
continueGesturehas no touchstart in the menu. When another finger lands while it slides, that touchstart named the other finger. The guard then left the handed finger's touchend alone. The case fails at 759c540 and passes with the hook and guard from before fix(menu press): cancel only the lifted finger's touchend #11164.continueGestureattaches without naming a touch. The guard then takes the next touchend, which follows the handed finger's pointerup.Local checks at e165a7b, one worker. The unit and DropdownMenu runs are at 460e05d, an earlier version of e165a7b that is not in this pull request. It differs only in the long-press spec:
test:ui --changed): 499 files, 14,817 passed;The previous round, at 469ef88:
hooks/useMenuPress.ts, which this pull request also changes, and git merged it with no conflict. Main also changed three files it imports directly:Layer/layerAnimations.stylex.ts,Layer/useLayer.tsxandgestures/GestureHost.ts.useMenuPress'soptionsRefthroughuseCommittedRef, socontinueGesture's callback lists it in its deps. The ref is the same object on every render, so nothing changes.Local checks at 469ef88, one worker (the browser runs at 0ab5763, which differs only in that deps list):
test:ui --changed): 497 files, 14,576 passed;The previous round, at 01f789a:
heldargument now goes toonOpenitself, since feat(ContextMenu): open from a held finger on iOS 26's timeline #8125 removedonOpenRef. The stays-put case takes feat(ContextMenu): a held finger grows the trigger on UIKit's lift spring #9816's fix in place of this pull request's earlier one (17cab2a). This pull request's own diff over feat(ContextMenu): a held finger grows the trigger on UIKit's lift spring #9816 changes only in those two places.Local checks at 01f789a, one worker (the unit and DropdownMenu runs at 8ee6c8d, whose product code is the same):
test:ui --changed): 488 files, 14,426 passed;Android (DEC-27), earlier, at 292bbe9: normal, 4× CPU, no animations, 2 takes each. Slide onto an item and lift picks it 6/6. Hold and lift picks nothing, and the menu stays open 6/6. Slide off and lift picks nothing 6/6. Reduced motion verified in-page. Earlier, on the iOS 26.2 Simulator at efe3f12: hold, menu, tap outside and early lift.
The previous round, at 7295d1b: it merges #9816's head 8fc523e. That head merges #8125's main merge 330fcc9 and times a pen's growth from its landing, as a finger's. It merges with no conflict. This pull request's own diff over #9816 is unchanged (same patch-id and files).
Local checks at 7295d1b, one worker:
test:ui --changed): 489 files, 14,436 passed;The previous round, at f7d5dd0:
continueGestureandMenuPressContinuationlose their@internaltag.@astryxdesign/core/hooksexports the type. The hook's docs list the member with its usage, and a[feat]changeset names both. No behavior changes.module:DropdownMenu/useMenuPressnames the member in its public contract. Its concepts table says what it does and when ContextMenu calls it.API report, core built at 4b1f2a7 and at f7d5dd0:
UseMenuPressReturn.continueGestureloses@internal, andMenuPressContinuation(pointerId,pointerType,time) joins the exports.Local checks at f7d5dd0, one worker:
test:ui --changedover 4b1f2a7): 232 files, 6,702 passed;The previous round, at 4b1f2a7: it merges #9816's head 8fb305f, with its iframe-clock fix and its comment and record changes from review. The touch layer's header keeps both sides' sentences. This pull request's own diff over #9816 is otherwise unchanged (same patch-id and files).
Local checks at 4b1f2a7, one worker:
test:ui --changed): 486 files, 14,298 passed;The previous round, at 3f21ccf:
module:DropdownMenu/useMenuPress's FR11 row gains "The opener hands the pointer over throughcontinueGestureonuseMenuPress's return."continueGesturegoes.useDropdownMenuPressinto the oneuseMenuPress. The continuation moves with it:continueGestureandMenuPressContinuationsit onUseMenuPressReturn, marked@internal, and ContextMenu callsuseMenuPress. The test that said the public return carries no continuation goes.Local checks at 3f21ccf, one worker:
test:ui --changed): 486 files, 14,297 passed;The previous head, 17cab2a, sat on b80098f, which merges #9816's head 0b1f31c with no conflict. That brings #8125's final head cae3644. There a menu timer that runs more than a frame late waits up to 50 ms for moves queued behind the block. The press reads the page's time from the arena's injected clock.
17cab2a makes the stays-put anchor case read the menu as laid out, not as painted. The menu's entrance plays as a transform on its layer. WebKit's software GL compiles that layer's shaders on its first draw. On a cold cache, the case's first read caught the entrance's first frame, 4 px off. An anchor that moved the menu still moves its laid-out box. With a fresh shader cache, the old read failed 3 of 3 runs, and the new one passed 3 of 3.
Local checks at 17cab2a, one worker:
The previous head, ac3dab7, merged #9816's 782cdbd. There the press judges each coalesced sample at its own time, and an on-time finger gets the menu at 735 ms.
The previous head, 967b5f6, merged #9816's e25ec8c with no conflict. It brought #9816's set-height fix for the inner visual box and its trigger attribute test.
The previous head, ec0cc34, merged #9816's 2ef1714; its checks ran at e687ed5, the same tree.
At earlier heads, below, "this head" means f62eada.
Android exit timing (contextmenu-default): main none/64 ms, head none/86 ms (6 interleaved rounds; main max gap 92 ms)Replayed onto main cd748d0 after #9814's squash: 983e46f is one commit with this pull request's own diff at bc4efd0. Its message lists the folded commits. Then 8130a0b, 08a3ad5 and ad37823 merge #9816's heads 8da39a8, 343df06 and c9d07a9. 0ac4cb7 records ContextMenuLongPress's WebKit time (below), and this head, f62eada, merges #9816's cc254d7 (#8125's two record sentences; check:knowledge rc 0). It adds and removes the same lines in the same 10 files (612 added, 75 removed). The patch-id moved only because the
onOpen(…, held)lines now sit beside two new touch-layer props and inside aflushSync. Its ContextMenu files equal e2f6057's plus #8125's second-document test, 735 ms proof, PR1 sentences and one lint-directive comment line. So the menu behaves the same. The tree also carries main 92784f6, which #8125 merges. Local checks at ad37823:ContextMenuLongPressin Chromium (24 passed, 1 skipped) and in WebKit under the CI profile (20 passed, 5 skipped). At 08a3ad5, which differs only in #8125's 735 ms proof: core typecheck; the ContextMenu, Layer and DropdownMenu units (1,143 passed);CI=true pnpm lint(0 errors); check:knowledge. There the ui suite passed 22,774.DropdownMenuLazySheet's keyboard-open case failed once under load, and it passes alone on main and here. The node suite (test:node) passed 17,446, with one failure (below). Earlier versions of this description saidCI=true pnpm lint, but those runs werepnpm lint, which reports@eslint-react/dom-no-flush-synconly as a warning; that claim is corrected here.WebKit leg budget:
playwright-legs.test.mjsprices a release-wide WebKit run at no more than four 510 s legs (2,040 s).ContextMenuLongPress.interaction.browser.spec.tshad no recorded WebKit time, so the planner priced it at 1.64 s a test. Three CI-profile WebKit runs of ad37823 (one worker, 4 CPUs, the CI image) were timed as the planner'srecordLogtimes a CI log. They took 58.2, 58.3 and 58.7 s for its 25 tests: 2.33 s a test. This pull request's CI has not run WebKit at a head with this spec, so no CI log has the number. This head records the median, 58.3 s, in.github/playwright-leg-durations.json. The release-wide estimate is then 2,054 s (2,045 s with the prior), so the case still fails here; main, #8125 and #9816 pass it. CI & Release's #10631 adds a sixth WebKit leg, and no proof is cut.Earlier, restacked by merge on main 6cbcbf8 (#10260) over #9816's head 63c7a6c. This pull request's own diff was unchanged (same patch-id and files as at 9e92240). Local checks at bc4efd0: core typecheck (0 errors); the touch-support bundle test (11 passed); the ContextMenu, Layer, hooks, utils and gestures units (3,696 passed).
Earlier, restacked on main 4598223, which has #10275's guarded presentation read, over #9816's head 27de157. The slide changeset names its scope. The primary pointer is coarse, and the menu opens at the finger (
presentationunset, oradaptivewhere it stays a popover). Apresentation="popover"or fine-pointer long press hands nothing over.useMenuPress's header keeps main's @output sentence and adds one. Local checks at the stack's top on the same base:ContextMenuLongPressin Chromium (22 passed, 1 skipped) and in WebKit under the CI profile (19 passed, 4 skipped);Android is retaken at the landing head.
Earlier, restacked for the chain landing on #9816's head (main 79cc4ac): FR5 points the slide to FR13. Local checks at ebe2c47: core typecheck; the Layer, ContextMenu, Indicator, utils, motion, gestures and DropdownMenu units (3,932 passed); eslint on the changed files; check:knowledge; check:changesets.
On #9816 at 4efcbc4, over #8125 c4f8964 and the merge worker's #9814 head (main 3731ec3). This pull request carries only its own five commits, the same ones that passed the stack's gates on main 9e559e9 (6b4f1dc). Two lines met #9816's: the touch story's wording keeps the coarse-pointer condition, and FR5's row points to FR13 on main's text. FR12 keeps #9816's springs.
The stack at fec928b differs in what #9816 and #8125 name:
springs.contextMenuLiftandsprings.contextMenuDismiss(docs(AST-094, AST-057): motion guidance; gesture springs; swipe-row returns #9915);This pull request's slide onto an item is unchanged.
Local checks at efe3f12. Later commits change changesets, docs, comments, the story text, test titles and FR13's scope (a long press that opens the menu at the finger). They also bring #9816's never-read field and its anchor fix (only the trigger's own growth is cancelled). At this head, f913915: core typecheck and the ContextMenu units (171 passed). On its code before a one-helper move (8bb478c):
CI=true pnpm lint(0 errors), check:knowledge and check:changesets;At efe3f12:
CI=true pnpm lint(0 errors), core typecheck, check:knowledge and check:changesets;useMenuPress.test.tsx, each fail before the change.presentation="popover"path changes.App-level size measured then, at 4b1f2a7 and for the set from main b8835b8, predates the deferred touch layer. Those figures no longer hold, and this round's first-load figures replace them.
Public and internal API delta
Public, documented:
useMenuPress's return gainscontinueGesture(pointer), and the hooks entry exports itsMenuPressContinuationtype (module:DropdownMenu/useMenuPressFR11). Its record, docs and a changeset name both. Usage:menuPress.continueGesture({pointerId, pointerType, time: Date.now()}).Why: the menu that opens under a held finger takes that finger as its opening press. So the slide picks through the shared press model's highlight, pick and stray-click handling. Existing ones considered: ContextMenu tracking the finger itself, a second press path (Design). And a separate internal hook beside
useMenuPress, which main's #8078 removed for one press path.Lines, over #9816's head:
useMenuPress.ts+63/−8,ContextMenuTouchLayer.tsx+42/−12,ContextMenu.tsx+18/−13,hooks/index.ts+5/−1);