Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
|
/approve-spec 578373e |
PR Analysis Report
Generated by PR Enrichment workflow | View current CI run |
There was a problem hiding this comment.
Changes requested. The spec side is settled: an engineering owner approved ContextMenu FR11 at this head. Each item below still needs a fix before this can merge.
- The growth and its early-lift return read the generic
--duration-medium,--duration-fastand--ease-movetokens, whichspec:AST-094FR4 does not allow for touch motion ("MUST be a motion role named for its use"), so amend FR4 in this pull request or move the growth onto named motion roles. - If
isDisabledturns true while a finger-opened menu is up, the touch layer unmounts and disposes its animator without restoring the trigger's inlinescale, so the trigger stays about 7% larger after the menu closes (contextMenuPressFeedback.ts, the unmount cleanup). - ContextMenu now has two outside-press paths, the shared
watchOutsidePressfor touch and its ownmousedownEffect with a different shadow-root rule for everything else, so extend the shared watch to close at the press for a mouse and a pen and delete the Effect (architecture:react-component-runtimeINV16). useContextMenuPressFeedbackruns its own attach, replace and dispose lifecycle for its animator and press observer, so move both ontouseAttachment, which the same layer'suseGestureRecognizeralready uses.- The outside-press changeset says "No component passes these options yet", but ContextMenu passes all three at this head, so reword it.
- The diff against
mainis 4,013 authored lines because it carries #9814 and #8125, so land those first or base this branch on #8125 to leave this pull request's own 1,915 lines.
A few smaller comment and wording notes are inline.
[Automated review]
578373e to
0d1fdb7
Compare
|
/approve-spec 0d1fdb7 |
There was a problem hiding this comment.
Changes requested. The spec side is settled: an engineering owner approved ContextMenu FR11, and that approval still covers this head.
- The growth and its early-lift return play the generic
--duration-medium,--duration-fastand--ease-movetokens, whichspec:AST-094FR1 and FR4 do not yet allow for touch motion, so rebase after #9706 lands and cite its FR45 in FR11, or amend FR1 and FR4 here. ContextMenuTouchLayersubscribes to its recognizer's transitions from an Effect whose only dependency never changes, so add that listener in the recognizer factory passed touseGestureRecognizerand delete the Effect.ContextMenuPressRecognizergains anonPressStartoption that only a unit test passes, and its doc says the press feedback starts from it, so remove the option.- The diff against
mainis 4,132 authored lines because it carries #9814 and #8125, so land those first, or declare the stack with one identicalStack: #9814 → #8125 → #9816line in all three descriptions.
Thanks for fixing the stuck trigger scale and moving the press feedback onto useAttachment. The changeset and the story still say the trigger "springs back" after an early lift, which FR11 now times as a curve on the theme's tokens.
[Automated review]
0d1fdb7 to
caf271c
Compare
|
/approve-spec caf271c |
There was a problem hiding this comment.
Changes requested for this stack: #8125 is ready, and #9814 and #9816 each need one fix. A pull request lands only when it and every pull request below it are approved.
#9814: changes requested
- Miss: the title and
.changeset/outside-press-pan-watch.mdsay the watch can now "judge a press inside a shadow root", but a press inside an open shadow root was already judged through the event's composed path and every new test uses a closed root, so please say "closed shadow root" in both.
#8125: approved
Approved pending CI: CI has not run on this head yet, and it lands after #9814.
#9816: changes requested
- Miss:
PressTimingandtimedCurveincontextMenuPressTiming.ts, andthemeTimingincontextMenuPressFeedback.ts, copyThemeTiming,timedCurveandthemeTimingOffromSegmentedControl/useSegmentedSelectionMotion.ts, so please move them into one shared motion module that both components call. - Non-blocking: ContextMenu FR11 at this head no longer cites the measurement behind the 400 ms commit and 735 ms display, or the tests that verify them, which #8125's FR11 did.
Whole stack
The combined change adds no public API and follows spec:AST-094 and ContextMenu FR11, but it passes only once the two fixes above land.
[Automated review]
b168c85 to
037a530
Compare
|
/approve-spec 037a530 |
From review: the late deadline's wait reads no pointer kind and can re-arm itself. - A mouse's late deadline keeps the one-task yield it has on main, with no wait. The Pager's mouse catch case returns to main's form. - A pen's late deadline waits, as a finger's does. - A wait whose own timer runs late, with nothing queued, runs the deadline instead of waiting again.
From review, and the owners' ruling on desktop timing: - A late deadline waits for queued input only while the latest contact is a finger or a pen, and only their late input keeps it waiting. A mouse or trackpad keeps the one-task yield it has on main. - Only the deadline's own timer counts as late. A wait whose own timer runs late runs the deadline, since only input from before the deadline extends a wait. spec:AST-094 FR16 states the gate, and its cost line names a finger's or pen's deadline. The changeset names the gesture arena's users only.
Brings meta#8125's merge of the arena fix's finger and pen gate. No conflicts.
The header's sentence on the late wait ran past 25 words. It is now two sentences. No code changes.
From review's two non-blocking notes: - spec:AST-094 FR16's third sentence now uses the first sentence's gate, "while the latest contact is a finger or a pen", as the arena does. It no longer names a finger's or pen's deadline. - GestureArena.ts drops the two comments that restated isFingerOrPenContact and isFingerOrPen. noteArrival's comment now says why only a finger's or pen's late input is noted. No code changes.
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.
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 9c1cd2b |
There was a problem hiding this comment.
Changes requested: one evidence item remains, and no code change is needed. An engineering owner approved the record changes at this head, and every behavior and API change matches a current or owner-approved claim.
Required
- Take the touch-presentation spec's real-device iOS run and its Android-emulator runs (Chrome with Gboard, animations at normal scale and removed, plus a slow-device profile) at the head that lands, and state each in the description's text, because the earlier runs do not carry over this head's changes to
ContextMenu.tsx,ContextMenuTouchLayer.tsx,contextMenuTouchLoader.tsand the gesture arena and host.
Non-blocking
ContextMenu.spec.mdCurrent-state impact still says ContextMenu owns its outside-press listener, which FR10's new gap text replaces.- Two comments in
ContextMenu.tsxcould be tighter: renametoTriggerLocaltotoAnchorLocal, and split the 28-word sentence about Android's own long-press menu.
The fixes since the earlier review hold: the description's first-load figures, the failed-load fallback, and a clean merge with main.
Claims and files checked
Review mode: same-head; reason: none
Claims:
- Outside press goes through the layer's watch; a mouse or pen press closes at its mousedown in the menu's own document, so an iframe or Picture-in-Picture menu no longer closes on a page press — verified (
ContextMenu.tsx:669-692,outsidePress.ts:226-245, the second-document unit case) - A held finger opens the menu on the measured iOS timeline where the primary pointer is coarse — verified (
ContextMenu.tsx:452,contextMenuPress.ts, the 735 ms unit cases) - A block trigger whose menu opens at the finger grows from 150 ms toward its held size on the lift spring, on the compositor — verified (
contextMenuPressFeedback.ts:173-200,:257-293; phone-profile capture at 1.0735) - The growth scales an inner box, so the menu never takes the press's scale — verified (
ContextMenu.tsx:1182-1188, the layer-runtime browser case, the capture's unchanged menu position) - At 400 ms the press takes the finger: its lift sends no click and the page cannot scroll under it — verified (
contextMenuPress.ts:175-191, unit 'claims the finger at the commit') - The menu opens at 735 ms for a finger still down, or at a lift after 400 ms — verified (unit cases; the 650 ms capture opens at the lift)
- A lift before 400 ms or a drift past 11.5 px on either axis gives no menu, and the trigger springs back — verified (
contextMenuPress.ts:133-168,ContextMenuTouchLayer.tsx:120-125) - The page stays free to scroll; a touch outside closes the menu as it pans or at its lift — verified (
ContextMenu.tsx:685-689, unit pan cases) - The trigger returns to its size when the menu closes — verified (
ContextMenu.tsx:517-519,contextMenuPressFeedback.ts:226-237) - A touch open lights no row; keyboard and pointer opens focus the first item — verified (capture: focus on the menu; unit focus cases)
- A second finger cancels before 400 ms; after it, the menu still opens — verified (
contextMenuPress.test.ts) - A fine pointer keeps the right-click menu, and a finger there keeps the 500 ms long press — verified (fine-pointer unit cases; pixel-identical right-click capture)
- The touch code loads after first paint; a finger held earlier starts its hold when it loads — verified (
contextMenuTouchLoader.ts:99-116, the boundary test, the before-load cases) presentation="popover"keeps the released menu and 500 ms long press — verified (unit case, popover story)- A finger's or pen's deadline whose timer runs over 17 ms late waits 50 ms, each late earlier input extends the wait, a mouse or trackpad does not wait, and coalesced samples straddling a deadline are split — verified (
GestureArena.ts:1121-1146,:1294-1337, the late-deadline unit cases) - A List reorder hold or a Pager catch whose finger drifted or lifted in time now ends as it should — verified through the shared arena deadline (the reorder hold is a long-press recognizer; the Pager test shows its catch waiting on the arena), not reproduced per component
- Description: the growth starts in the first frame at or after the onset, from rest, and returns on the dismiss spring; none for an inline trigger, a sheet or Reduce Motion; a nested trigger grows alone — verified (
contextMenuPressFeedback.ts:173-200,ContextMenu.tsx:1205,contextMenuTrigger.stylex.ts) - Description: no API change — verified for this pull request's own part over #8125; judged against
mainit also carries #8125's recordedpresentationdefault move - Description: the motion engine loads with the touch layer, after first paint — verified (only
contextMenuPressFeedback.tsimports the animator, reached through the loader's dynamic import) - Description: first-load gzip figures over #8125 and over
main— stated, not re-measured - Description: device takes at this head have not run — verified (the blocking item)
- Description: local check runs at earlier heads — describe earlier heads and were not rechecked; the unit run at this head passed 923 tests
Files:
.changeset/contextmenu-outside-press-watch.md— clear.changeset/contextmenu-touch-timeline.md— clear.changeset/gesture-arena-late-input.md— clearapps/storybook/stories/ContextMenu.stories.tsx— cleardocs/architecture/layer-runtime.md— clear (owner-approved)docs/specs/AST-094-touch-presentations/spec.md— clear (owner-approved)docs/specs/components/ContextMenu/ContextMenu.spec.md— owner-approved; non-blocking: a Current-state line still says ContextMenu owns its outside-press listenerpackages/core/src/ContextMenu/ContextMenu.doc.mjs— clearpackages/core/src/ContextMenu/ContextMenu.tsx— non-blocking comment suggestions (two)packages/core/src/ContextMenu/ContextMenu.test.tsx— clearpackages/core/src/ContextMenu/ContextMenu.touchLoadFailure.test.tsx— clearpackages/core/src/ContextMenu/ContextMenu.triggerProps.test.tsx— clearpackages/core/src/ContextMenu/ContextMenuTouchGrowth.test.tsx— clearpackages/core/src/ContextMenu/ContextMenuTouchLayer.tsx— clearpackages/core/src/ContextMenu/ContextMenuTouchLayerProps.test.tsx— clearpackages/core/src/ContextMenu/__tests__/ContextMenuLongPress.a11y.chromium.spec.ts— clearpackages/core/src/ContextMenu/__tests__/ContextMenuLongPress.interaction.browser.spec.ts— clearpackages/core/src/ContextMenu/contextMenuPress.test.ts— clearpackages/core/src/ContextMenu/contextMenuPress.ts— clearpackages/core/src/ContextMenu/contextMenuPressFeedback.test.tsx— clearpackages/core/src/ContextMenu/contextMenuPressFeedback.ts— clearpackages/core/src/ContextMenu/contextMenuTouchLoader.boundary.test.ts— clearpackages/core/src/ContextMenu/contextMenuTouchLoader.ts— clearpackages/core/src/Indicator/boxHold.test.tsx— clearpackages/core/src/Layer/outsidePress.test.ts— clearpackages/core/src/Layer/outsidePress.ts— clear (behavior tag-along note only)packages/core/src/Layer/useLayer.test.tsx— clearpackages/core/src/Layer/useLayer.tsx— clearpackages/core/src/gestures/GestureArena.ts— clearpackages/core/src/gestures/GestureHost.ts— clearpackages/core/src/gestures/__tests__/GestureHost.test.ts— clearpackages/core/src/gestures/__tests__/arena.test.ts— clearpackages/core/src/gestures/__tests__/arenaTimersAndClaims.test.ts— clearpackages/core/src/gestures/__tests__/harness.ts— clearpackages/core/src/gestures/types.ts— clearpackages/core/src/hooks/usePager.test.ts— clearpackages/core/src/motion/README.md— clearpackages/core/src/motion/uikit/contextMenu.ts— clearpackages/core/src/privateAttributes/contextMenuTrigger.stylex.ts— clearscripts/shared-identity.baseline.json— clear
| // The browser's own long-press menu (Android Chrome) for a finger the | ||
| // recognizer is timing, or will time once the touch layer loads: the |
There was a problem hiding this comment.
Non-blocking (INV29): this 28-word sentence carries two topics. Suggested:
// Android Chrome opens its own long-press menu. The recognizer decides for a
// finger it times, or will time after the layer loads.
Stack: #11837 → #8125 → #9816 → #8133 → #8201
Merge group: #8125, #9816, #8133
Behavior module: ContextMenu's press feedback.
User need
A held finger should see the trigger grow from 150 ms, as UIKit's view does, before the menu at 735 ms.
Problem and solution fit
springs.contextMenuLift.springs.contextMenuDismisswhen the hold ends with no menu or the menu closes, and holds while the menu is up.architecture:layer-runtimeINV22).Current specification
component:ContextMenuFR5 (since #9915) makes the long press a gesture component: the lift playssprings.contextMenuLift, the returnsprings.contextMenuDismiss(spec:AST-094FR7, FR45). FR12 adds the growth on those springs.design:reduced-motiongoverns.Public delta and caller burden
No API change. A block trigger grows about 7%; its docs ask for room. Its children sit in one inner box, laid out as before. The motion engine loads with the touch layer, after first paint. First-load gzip over #8125: menu +255 B, table +234 B.
Design and alternatives
Evidence
spec:AST-094Platform support:Scope
Writing rubric results
Over
component:ContextMenu: FR12 adds the growth on FR5's springs beside the hold's internal moments; Ownership names the trigger mark's module. Owner-gated.Testing
This round, at 9c1cd2b, on main 64806d0:
prepare()from the publicuseLayerby type only.useLayer's return type..github/scripts/lib/component-size.jsmeasures an import: the size report's esbuild options, eager chunks only.Layer/useLayer.tsx,Layer/outsidePress.ts,GestureArena.tsandGestureHost.tschange in feat(ContextMenu): open from a held finger on iOS 26's timeline #8125 and fix(gestures): a deadline runs after the input stamped before it #11837, not in this pull request's own diff. The figures over main cover them.spec:AST-094DEC-31).Local checks at cdd8ebc, one worker:
test:ui --changed, the boundary test included): 518 files, 15,375 passed;pnpm review:pre(0 findings; merges clean).Final local checks at 8ed1ce9, one worker:
test:ui --changed, the boundary test included), from a fresh results cache: 518 files, 15,376 passed. Runs that reused an earlier run's order timed out main'ssemanticFence.sharedtest at the cold start;pnpm review:pre(0 findings; merges clean).This pull request's own change since cdd8ebc is one comment. #8125's changes ran in #8125's browser specs.
At 9c1cd2b, which brings #8125's loader fix, the ContextMenu, Layer, DropdownMenu and
useMenuPressunits ran again: 1,400 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 d5a7049:
component:ContextMenuFR12: this pull request's growth wording, and feat(ContextMenu): open from a held finger on iOS 26's timeline #8125's before-load sentence with its evidence;ContextMenu.tsx: this pull request'sendTouchOpen, beside feat(ContextMenu): open from a held finger on iOS 26's timeline #8125's loader hook and late-touch slot;ContextMenuTouchLayer.tsx: the header, the imports and the doc comment, each with both sides' lines.lazy-sheet-bundle.test.mjsdrops ContextMenu's eager-animator row and reads as on main.presentation="popover"the touch layer never loads, so the popover case no longer waits for it. It checks that the page never requests the layer's chunk..github/scripts/lib/component-size.jsmeasures an import: the size report's esbuild options, eager chunks only.spec:AST-094DEC-31). The device runs start again at 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's head, which contains this head.Local checks at d5a7049, one worker:
test:ui --changed, the boundary test included): 516 files, 15,337 passed;lazy-sheet-bundle.test.mjs: 4 passed;pnpm review:pre(0 findings; merges clean).The previous round, at cda2451:
toTriggerLocal, where this pull request's sentence on the press feedback now follows feat(ContextMenu): open from a held finger on iOS 26's timeline #8125's new wording. This pull request's own diff over feat(ContextMenu): open from a held finger on iOS 26's timeline #8125 is otherwise unchanged.utils/pressFeedback.ts(feat(core): swipe actions come from createSwipe on the shared drag path #8690) directly, so earlier device runs do not carry (spec:AST-094DEC-31). The device runs start again at 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's head, which contains cda2451.Local checks at cda2451, one worker:
test:ui --changed): 515 files, 15,313 passed;The previous round, at eb3d17d:
Layer/useLayer.tsx(see feat(ContextMenu): open from a held finger on iOS 26's timeline #8125). It merges with no conflict, and this pull request's own diff over feat(ContextMenu): open from a held finger on iOS 26's timeline #8125 is unchanged (same patch-id).Layer/useLayer.tsx, a shared layer module this pull request's code loads, so earlier device runs do not carry (spec:AST-094DEC-31). The Android emulator takes did not run at that head.Local checks at eb3d17d, one worker:
test:ui --changed): 499 files, 14,838 passed;The previous round, at a42af3e:
DropdownMenu/DropdownMenu.tsx, whichContextMenu.tsximports types from (import type). None of them changed. The Android emulator takes did not run at that head.Local checks at a42af3e, one worker:
test:ui --changed): 498 files, 14,750 passed;The previous round, at cd6d257:
Local checks at cd6d257, one worker:
The previous round, at 44ab755:
Local checks at 44ab755, one worker (the unit, gesture and a11y runs at b8c7cb2, which differs only in that spec):
test:ui --changed): 498 files, 14,722 passed;The previous round, at c11eb1f:
motion/animator.ts, whichcontextMenuPressFeedback.tsimports. No press-feedback call passes the newstart: 'next-frame', so each keeps its start.Local checks at c11eb1f, one worker:
test:ui --changed): 496 files, 14,484 passed;The previous round, at a1cc302:
isShown.useCommittedRef. It writes whether the recognizer follows a contact withuseCommittedRefInto, into the ref the press feedback was handed. The press feedback readsisShownthroughuseCommittedRef. No committed ref is read in an Effect cleanup.release()goes. Two test headers and a test comment say the growth follows a finger or a pen. The popover story again says it has no growth.Local checks at a1cc302, one worker (the unit, gesture and a11y runs at 01f5f22, which differs only in that spec):
test:ui --changed): 487 files, 14,335 passed;The previous round, at 8fc523e:
Local checks at 8fc523e, one worker:
test:ui --changed): 488 files, 14,345 passed;The previous round, at 8fb305f, from review:
Local checks at 1d6ec37, one worker (8fb305f changes one comment):
test:ui --changed): 485 files, 14,214 passed;The previous round, at 850a9c2:
data-astryx-context-menu-trigger, written and read through one owner module. A nested trigger still grows alone.component:ContextMenu's Ownership names that module, its writer and its reader.ContextMenuTouch.tsgoes, so the touch layer importscontextMenuPressandcontextMenuPressFeedbackdirectly. A press that ends with no menu springs back and releases what the commit mounted. The long-press spec keeps both pull requests' cases.Local checks at 850a9c2, one worker:
test:ui --changed): 485 files, 14,213 passed;The previous head, 0b1f31c, merged #8125's head cae3644 with no conflict. There the press reads the page's time from the arena's injected clock, which is
performance.now()in a browser. Before it, 2a36eba merged #8125's 45bfb44. There a menu timer that runs more than a frame late waits up to 50 ms for moves queued behind the block. 782cdbd merged #8125's cad79ec. There the press judges each coalesced sample at its own time. The menu waits at its moment only when the page is behind its input, so an on-time finger gets it at 735 ms. Before that, e25ec8c merged #8125's 88cc0d8, and its one conflict dropped the touch layer's pointer follow. Before that, c346da0 merged #8125's a4e0404, and three commits answer the review of 2ef1714:Under a fine pointer, all 31 ContextMenu story captures match main's pixel for pixel: 18 stories at rest, 13 with the menu open. That ran at 55f84be, whose
ContextMenu.tsxdiffers from 850a9c2's in one comment line. The change adds no publicdata-*attribute; 4e93b5f's privatedata-astryx-context-menu-triggerhas its owner module (INV23).Local checks at 0b1f31c, one worker:
The previous head, 2ef1714, sat on a merge of #8125's head a5a0e12 (704cff3). The one conflict put two new browser cases side by side in the long-press spec. Three commits follow:
architecture:layer-runtimeINV21 and INV22 (spec:AST-059DEC-9 and DEC-10, from#11024). A finger's or a pen's press leaves the open menu as an unpressed open. A layout case checks block, row and grid triggers against plain boxes.Red first, at fb27cdc (the same tree as 06c942c), in Chromium and WebKit: the press cases fail. The menu's box matched, but the trigger above the anchor carried scale 1.0735, and the anchor carried an inline counter-scale and translate. The layout case passed, as it should with no inner box.
Local checks at 9de7a99, which differs from 2ef1714 only in that changeset sentence, one worker:
Before and after, a finger held near the card's corner, at 450, 900 and 1,400 ms. The top row is before the inner box, the bottom row 850a9c2. The menu opens at the same place under the finger, and only the card grows: capture.
At earlier heads, below, "this head" means cc254d7.
Android exit timing (contextmenu-default): main none/70 ms, head none/90 ms (6 interleaved rounds; main max gap 107 ms)Frames, not timers, decide the onset: Chromium holds a page's timers for about 100 ms after it handles a touchstart.
Replayed onto main cd748d0 after #9814's squash: 1cedda2 carries this pull request's earlier own diff (old head 63c7a6c). Its message lists the folded commits, and the newer commits sit on top of it. It sits on #8125's 3d78dae, which now carries the menu's commit inside its deciding task and its commit-time mount. With those, this head's ContextMenu files equal 0c316d9's plus #8125's second-document test, its 735 ms proof, its PR1 sentences and one lint-directive comment line. So the menu behaves the same. The tree also carries main 92784f6, which #8125 merges. Commits c9d07a9 and cc254d7 merge #8125's heads. FR8 keeps main's text from #10160 in this pull request's table. Red first: 791357d (a touch 90 ms late, 3 of 3 red before the frame watch).
Touch to first grown frame, Chromium phone profile: 170–173 ms at normal speed and 164–182 ms at 4× CPU. With a 60 ms input lag, it is 166–167 ms (183 ms, at 1.0110, before the frame watch). Each first frame shows the spring's one-frame value, 1.0033, after an exact 1.000. A quick tap starts no animation and writes no style. The touch handlers' cost does not change. It is 1.50 / 1.85 ms at 1× (1.50 / 1.70 ms before) and 6.60 / 7.95 ms at 4× (6.70 / 8.30 ms before).
A lift between the commit and 735 ms shows the menu 2–3 ms into the lift's own dispatch in WebKit. Before #8125's commit-time mount, it took 17 ms. The lift proof, d44956d, asserts that dispatch, not a time. Under Reduce Motion, the 735 ms proof also wants the show inside its deciding task (4edb900).
App-level size and the eager-animator bundle row measured then predate the deferred touch layer, so they no longer hold. This round's first-load figures replace them.
Local checks at an earlier head, cc254d7, which adds only #8125's two record sentences: check:knowledge. At c9d07a9:
ContextMenuLongPressin Chromium (21 passed, 1 skipped) and in WebKit under the CI profile (17 passed, 5 skipped). At 343df06, which differs only in #8125's 735 ms proof: core typecheck; the ContextMenu, Layer and DropdownMenu units (1,135 passed);CI=true pnpm lint(0 errors); check:knowledge. At the stack's top on the same main, 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; its one failure is the WebKit leg budget (see #8133). 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.The Android run at an earlier head, cc254d7 (Chrome with Gboard; normal, 4× CPU and animations removed):
Earlier, at 0c316d9, the takes were Chrome with Gboard: normal ×2, 4× CPU ×2 and animations removed ×2. There, the growth animation's start time is 152–165 ms after the landing. It starts from 1.000 (first frames 1.000, then 1.002–1.005), with no back-dated jump. This head carries 0c316d9's ContextMenu files apart from one lint-directive comment line, and it also carries main's own changes. Both returns take about 285–354 ms, and Reduce Motion shows no growth. At 63c7a6c, an earlier head, the animation was created about 238 ms after the landing with a back-dated start. So its first painted frame was already at 1.016–1.039 after an exact 1.000.
Public and internal API delta
Public: none.
Internal, new:
privateAttributes/contextMenuTrigger.stylex.ts: the owner module of the privatedata-astryx-context-menu-triggerattribute (architecture:public-component-apiINV23), named incomponent:ContextMenu's Ownership.markContextMenuTrigger(trigger)marks a trigger while its touch press feedback is attached and returns the call that unmarks it.closestContextMenuTrigger(element)finds the trigger a press belongs to. Usage:const unmark = markContextMenuTrigger(trigger);.Why: a press on a nested trigger grows only that trigger. Existing ones considered:
data-astryx-pressable, which also sits on every pressable control inside a trigger. So the nearest one can be a nested control, not the trigger. A module-level set of mounted triggers came before; the mark replaces it.ContextMenu/contextMenuPressFeedback.ts:useContextMenuPressFeedback, the trigger's growth (component:ContextMenuFR12), used only by the touch layer. Usage:const feedback = useContextMenuPressFeedback(triggerRef, visualRef, isShown, isFollowedRef);.Why: the growth's timing is ContextMenu's own. It starts 150 ms after the landing the recognizer records, holds while the menu is up, and plays UIKit's springs. Existing ones considered: core's press machine (
utils/pressFeedback.ts). Its mark comes late inside a scroll view, and never for a press that travels past 10 px first. So the hook times a finger and a pen from the landing.Lines, over #8125's head:
contextMenuPressFeedback.ts+296,ContextMenu.tsx+60/−6,ContextMenuTouchLayer.tsx+50/−7,motion/uikit/contextMenu.ts+35/−8,privateAttributes/contextMenuTrigger.stylex.ts+27,contextMenuPress.ts+6);