Skip to content

feat(ContextMenu): a held finger grows a block trigger on UIKit's lift spring - #9816

Draft
vjeux wants to merge 204 commits into
meta:mainfrom
vjeux:uikit/c20-contextmenu-growth
Draft

vjeux wants to merge 204 commits into
meta:mainfrom
vjeux:uikit/c20-contextmenu-growth

Conversation

@vjeux

@vjeux vjeux commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

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 in UIKit, before the menu at 735 ms.

Problem and solution fit

  • The growth starts at the first frame at or after the hold's start plus 150 ms, toward 1.0735× on springs.contextMenuLift.
  • It returns on springs.contextMenuDismiss when the hold ends with no menu or the menu closes, and holds while the menu is up.
  • None inline, behind a sheet, or under Reduce Motion. A nested trigger grows alone. An enabled touch-model trigger joins core's press machine.
  • The growth scales an inner box holding the trigger's children. It is a box once the touch layer has loaded for a block trigger whose menu opens at the finger. The menu's anchor stays on the untransformed trigger (architecture:layer-runtime INV22).

Current specification

component:ContextMenu FR5 makes the long press a gesture component: the lift plays springs.contextMenuLift, the return springs.contextMenuDismiss (spec:AST-094 FR7, FR45). FR12 adds the growth on those springs. design:reduced-motion governs.

Public delta and caller burden

No API change of its own. With #8125 under it, an omitted presentation follows the touch model under a coarse pointer, as component:ContextMenu and spec:AST-094 FR25 already record. presentation="popover" keeps the released behavior. A block trigger grows ~7%; its docs ask for room. The motion engine loads with the touch layer. First-load gzip over #8125: menu +156 B, table +266 B.

Design and alternatives

  • A late frame starts the grow-in from rest, never mid-spring.
  • The springs play on the compositor, so a busy main thread does not stall them.

Evidence

spec:AST-094 Platform support:

  • Chromium (phone emulation) and WebKit (CI profile): the long-press proofs, red first (Testing).
  • iOS 26.2 Simulator at efe3f12 (same motion): a 400 ms block freezes the frame clock 23 frames; the card keeps growing (strip).
  • No device runs here; Cindy Zhang will check iOS (Testing).

Scope

  • One capability is added.
  • Unrelated fixes, cleanup, and policy changes were removed or split.
  • Consumer docs, focused tests, and migration evidence ship with the feature.
  • Public text and artifacts contain no internal Meta context.

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.

  • R3 evidence: FR12's basis names UIKit's measured moments and growth, and FR5's gesture-component decision.
  • R1 narration, R2 research, R4 rejected alternatives, R5 change references, R6 open questions, R7 project status: none.

Testing

This round, from review, at b337bd9, on main 4d0a3d8:

  • 063e6ec, red first: the touch stories gain a web component card. Its shadow root renders the trigger around a slot, and its own label is slotted in.
    • A unit case lands on a control slotted into a trigger. The long-press spec holds a finger on the slotted label and reads the trigger's growth.
    • At 063e6ec, the unit case and the spec in Chromium and in WebKit fail. The menu opens, but the trigger stays at scale 1.
    • The lookup climbed the slotted label's own parents, outside the shadow root that holds the trigger.
  • b337bd9: the lookup follows the flat tree, with core's flat-tree parent: slotted content goes to its slot, and a shadow root to its host. The slotted and shadow-root cases pass in both engines.
  • utils/flatTree.ts changes only its header comment, so its other users run unchanged code. They are Layer, Popover, Selector, the gesture host, native scroll, scroll lock, the mobile keyboard, motion's presentation, the scroll view, selection lock and lab's Tour.
    • At this head, the preflight below ran their unit tests, and 1,161 tests in 23 files passed. WebKit's run below includes the gesture specs.
  • First-load JS gzip over feat(ContextMenu): open from a held finger on iOS 26's timeline #8125's head: menu +156 B, table +266 B; docs and form +0 B.
  • This round changes privateAttributes/contextMenuTrigger.stylex.ts, so earlier device runs do not carry (spec:AST-094 DEC-31).
  • Real-device iOS: not run here; Cindy Zhang will check it from the preview deploy at the final head.

On b337bd9's tree, pnpm preflight --browser, based on 46c21bf's tree:

  • pnpm review:pre (0 findings), the build, the typecheck, strict eslint and prettier on the changed files, check:knowledge and the changeset checks;
  • the ui tests it selects: 951 files, 24,148 passed. The node tests: 1,798 files, 28,202 passed, 3 expected failures;
  • the a11y specs it selects: 166 passed. The Chromium interaction specs it selects: 2,085 passed, 55 skipped.

Prettier, with no ignore file and a misformatted control in the same run, passes the 19 changed files and refuses the control.

WebKit, on the interaction specs CI selects: 418 passed, 61 skipped.

The previous round, from review, at 031f8e1, on main 4d0a3d8:

  • dee55df, red first: the touch stories gain a card whose label renders inside an open shadow root, as a web component's does.
    • A unit case lands on a control inside a shadow root in the trigger. The long-press spec holds a finger on the card's label and reads the trigger's growth.
    • At dee55df, the unit case and the spec in Chromium and in WebKit fail. The menu opens, but the trigger stays at scale 1.
    • The trigger lookup used closest, which stops at a shadow root.
  • 031f8e1: the lookup goes on from each shadow root's host, open or closed, so it finds the innermost trigger at or above the landing. The three cases pass.
  • The previous round's sentence on the cut read now says what the layer reads: a cut that a commit or a resize starts.
  • First-load JS gzip over feat(ContextMenu): open from a held finger on iOS 26's timeline #8125's head: menu +156 B, table +264 B; docs and form +0 B.
  • This round changes privateAttributes/contextMenuTrigger.stylex.ts, so earlier device runs do not carry (spec:AST-094 DEC-31).

On 031f8e1's tree, pnpm preflight --browser, based on 46c21bf's tree:

  • pnpm review:pre (0 findings), the build, the typecheck, strict eslint and prettier on the changed files, check:knowledge and the changeset checks;
  • the ui tests it selects: 878 files, 22,073 passed. The node tests: 1,798 files, 28,202 passed, 3 expected failures;
  • the a11y specs it selects: 166 passed. The Chromium interaction specs it selects: 2,083 passed, 55 skipped;
  • one more case, a check of the interaction harness itself, failed while the box was short of memory, so it gives no result. This stack does not change the harness. Run again on a quiet box at this head, it passes 20 of 20.

WebKit, on the interaction specs CI selects: 417 passed, 61 skipped.

The previous round, from review, at 382d939, on main 4d0a3d8:

  • 4734004, red first: the trigger-layouts story gains a trigger that cuts its text only in a viewport 480 px wide or less. A plain box with the same style sits beside it.
    • The spec loads the touch layer in an 800 px viewport, narrows it to 360 px and compares the pair's pixels.
    • It fails at 4734004 in Chromium and in WebKit. The layer read the cut only at mount and on a class change, so the visual kept no ellipsis.
  • 789a0c7: the touch layer reads the cut at each commit, when the trigger resizes and when the window resizes, through core's shared input stream. So it reads a cut that a commit or a resize starts. A cut that starts with neither is read at the next commit or resize. That includes a contrast, color-scheme or forced-colors change, or a class set through the forwarded ref.
    • The read stays in the touch layer, so the first load carries none of it.
    • The new case passes in both engines. So does the whole long-press spec: 39 passed, 1 skipped in Chromium, 30 passed, 10 skipped in WebKit. The ContextMenu units (247) pass.
    • The visual's comments and this description now say where it is a box, as the review asked.
  • 8c8f1a1 merges feat(ContextMenu): open from a held finger on iOS 26's timeline #8125's bb96dd1, its popover-scoped scroll sentence. One conflict, that changeset line, keeps this pull request's line with that edit.
  • 1dabfe7 merges feat(ContextMenu): open from a held finger on iOS 26's timeline #8125's c723e88, which carries main 4d0a3d8, with no conflict. This pull request's own diff is unchanged.
  • 382d939 merges feat(ContextMenu): open from a held finger on iOS 26's timeline #8125's 46c21bf: two comments, in the gesture arena and the gesture types, with no conflict. They change no code, so the gate below, at 1dabfe7, stands.
    • At 382d939: prettier, the baseline check and the public-text check pass.
  • First-load JS gzip over feat(ContextMenu): open from a held finger on iOS 26's timeline #8125's head: menu +156 B, table +266 B; docs and form +0 B.
  • This round changes ContextMenuTouchLayer.tsx, so earlier device runs do not carry (spec:AST-094 DEC-31).

On 1dabfe7's tree, pnpm preflight --browser, based on c723e88's tree:

  • pnpm review:pre (0 findings), the build, the typecheck, strict eslint and prettier on the changed files, check:knowledge and the changeset checks;
  • the ui tests it selects: 878 files, 22,072 passed. The node tests: 1,798 files, 28,202 passed, 3 expected failures;
  • the a11y specs it selects: 166 passed. The Chromium interaction specs it selects: 2,083 passed, 55 skipped.

WebKit, on the interaction specs CI selects: 416 passed, 61 skipped.

The previous round, from review, at b31c5fd, on main 3e9743a:

  • 7ddbbf3, red first: the trigger-layouts story gains triggers that clip, cut, scroll or overflow their content, each beside a plain box with the same style.
    • One clips a header pulled into its padding and nowrap text. Others clip a child's ring, cut a multi-line label, let a badge overflow, or scroll.
    • Two specs compare each pair's pixels: under the touch model once the touch layer loads, and with a mouse.
    • Both fail at 7ddbbf3 in Chromium and WebKit. The visual took the trigger's overflow, so it clipped at the content edge and scrolled in the trigger's place.
  • 4e1cc60: the visual is no box (display: contents) unless the hold can grow it. It stays the same element, so the children never remount.
    • The hold grows a block trigger whose menu opens at the finger, once the touch layer has loaded.
    • There the visual takes the trigger's overflow only when the trigger cuts its own text (text-overflow), so the ellipsis stays. The touch layer reads that, so the first load carries none of it.
    • Both specs pass in both engines. So do the whole long-press spec (Chromium 38 passed, 1 skipped; WebKit 29 passed, 10 skipped), the ContextMenu units (247) and the core typecheck.
  • e5ae83a merges feat(ContextMenu): open from a held finger on iOS 26's timeline #8125's 030309c. Two conflicts, the touch-timeline changeset and FR12, keep this pull request's lines with feat(ContextMenu): open from a held finger on iOS 26's timeline #8125's three wording edits.
  • a5fc8b6, record only: the current-state note says an outside press closes ContextMenu through the shared outside-press watch.
  • b31c5fd merges feat(ContextMenu): open from a held finger on iOS 26's timeline #8125's 265bc98, its "a finger down before" wording in FR12 and spec:AST-094. One conflict, FR12's row, keeps this pull request's line with that edit.
    • At b31c5fd, check:knowledge (no warnings), prettier, the provenance baseline check and the public-text check pass. The gate below, at e5ae83a, stands.
  • First-load JS gzip over feat(ContextMenu): open from a held finger on iOS 26's timeline #8125's head: menu +130 B, table +282 B; docs and form +0 B.
  • This round changes ContextMenu.tsx and ContextMenuTouchLayer.tsx, so earlier device runs do not carry (spec:AST-094 DEC-31).

On e5ae83a's tree, pnpm preflight --browser, based on 030309c's tree:

  • pnpm review:pre (0 findings), the build, the typecheck, strict eslint and prettier on the changed files, check:knowledge and the changeset checks;
  • the ui tests it selects: 875 files, 21,973 passed. The node tests: 1,794 files, 28,121 passed, 3 expected failures;
  • the a11y specs it selects: 166 passed. The Chromium interaction specs it selects: 2,074 passed, 55 skipped.

WebKit, on the interaction specs CI selects: 415 passed, 61 skipped.

The previous round, from review, at a7c1bd7, on main 3e9743a:

On 6eb342b's tree, pnpm preflight --browser, based on eab562a's tree:

  • pnpm review:pre (0 findings), the build, the typecheck, strict eslint and prettier on the changed files, check:knowledge and the changeset checks;
  • the ui tests it selects: 875 files, 21,973 passed. The node tests: 1,794 files, 28,121 passed, 3 expected failures;
  • the a11y specs it selects: 166 passed. The Chromium interaction specs it selects: 2,072 passed, 55 skipped. PageControl's held-finger case failed; fix(gestures): behind a blocked page, a deadline waits for touch input stamped before it #11837's 35f9cb0 fixes that proof, and it passes at this head.

WebKit, on the interaction specs CI selects: 414 passed, 61 skipped.

The previous round, at 03955ac, on main 3e9743a:

Before #8125's test-only fc6df46 came in, pnpm preflight --browser against #8125's merge ran on this merge's tree. Its interaction step hit a 3 h limit, so the whole suite below stands in. The rest passed, except as noted:

  • pnpm review:pre (0 findings), the build, the typecheck, strict eslint and prettier on the changed files, check:knowledge and the changeset checks;
  • the ui tests it selects: 875 files, 21,973 passed. The node tests: 1,794 files, 28,121 passed, 3 expected failures;
  • its a11y specs failed only the two cases fc6df46 fixes.

On the same tree, the whole Chromium interaction suite: 2,072 passed, 55 skipped. WebKit, on the interaction specs CI selects: 413 passed, 61 skipped.

At 03955ac: the a11y specs this change selects, 382 passed; TableCellMenus in WebKit, three runs, 18 passed; the build and the typecheck pass.

The previous round, at 9c1cd2b, on main 64806d0:

Local checks at cdd8ebc, one worker:

  • the tests this change reaches on main 64806d0 (test:ui --changed, the boundary test included): 518 files, 15,375 passed;
  • the lazy-sheet and touch-loader boundary tests: 6 passed;
  • 16 interaction specs: ContextMenu's long press, the gesture system, and the touch adopters (BottomSheet, List, Slider, SnapPaging, Switch and the pager). Chromium 379 passed, 15 skipped; WebKit under the CI profile 316 passed, 78 skipped;
  • 9 a11y specs in Chromium, 90 passed. The lift's click proof failed once there, on the touch layer's late load; feat(ContextMenu): open from a held finger on iOS 26's timeline #8125's db994d9 fixes that proof. The cursor-anchor and Layer context-menu specs in WebKit, 7 passed;
  • the Storybook build, the core typecheck, strict eslint and prettier on the changed files, changeset coverage, check:changesets, check:knowledge, check:component-import-boundaries, and pnpm review:pre (0 findings; merges clean).

Final local checks at 8ed1ce9, one worker:

  • the tests this change reaches on main 64806d0 (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's semanticFence.shared test at the cold start;
  • the Storybook build, the core typecheck, strict eslint and prettier on the changed files, changeset coverage and check:changesets. Also check:knowledge, check:component-import-boundaries, the shared-identity check (7 passed), and 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 useMenuPress units ran again: 1,400 passed. So did the core typecheck, strict eslint, prettier, check:knowledge, the shared-identity check and pnpm review:pre (0 findings; merges clean).

The previous round, at d5a7049:

Local checks at d5a7049, one worker:

  • the tests this change reaches on main 4800d99 (test:ui --changed, the boundary test included): 516 files, 15,337 passed;
  • lazy-sheet-bundle.test.mjs: 4 passed;
  • the long-press and keyboard-capped lists specs, every case three times: Chromium 129 passed, 3 skipped; WebKit under the CI profile 102 passed, 30 skipped;
  • the gesture specs: Chromium 84 passed, 4 skipped; WebKit 76 passed, 12 skipped;
  • in Chromium: the ContextMenu audit, long-press a11y, cursor-anchor, menu hover-focus, ChatComposer dialog and Table resize-edge specs (35 passed); in WebKit: the cursor-anchor spec (3 passed);
  • the core typecheck, strict eslint and prettier on the changed files, changeset coverage, check:changesets, check:knowledge, and pnpm review:pre (0 findings; merges clean).

The previous round, at cda2451:

Local checks at cda2451, one worker:

  • the tests this change reaches on main 4800d99 (test:ui --changed): 515 files, 15,313 passed;
  • the long-press and keyboard-capped lists specs, every case three times: Chromium 117 passed, 3 skipped; WebKit under the CI profile 93 passed, 27 skipped;
  • the gesture specs: Chromium 84 passed, 4 skipped; WebKit 76 passed, 12 skipped;
  • in Chromium: the ContextMenu audit, long-press a11y, cursor-anchor, menu hover-focus, ChatComposer dialog and Table resize-edge specs (35 passed); in WebKit: the cursor-anchor spec (3 passed);
  • the core typecheck, strict eslint and prettier on the changed files, changeset coverage, check:changesets and check:knowledge.

The previous round, at eb3d17d:

Local checks at eb3d17d, one worker:

  • the tests this change reaches on main 36f68b0 (test:ui --changed): 499 files, 14,838 passed;
  • the long-press and keyboard-capped lists specs, every case three times: Chromium 114 passed, 3 skipped; WebKit under the CI profile 90 passed, 27 skipped;
  • the gesture specs: Chromium 84 passed, 4 skipped; WebKit 76 passed, 12 skipped;
  • in Chromium: the ContextMenu audit, long-press a11y, cursor-anchor and menu hover-focus specs (31 passed); in WebKit: the cursor-anchor spec (3 passed);
  • the core typecheck, strict eslint and prettier on the changed files, changeset coverage, check:changesets and check:knowledge.

The previous round, at a42af3e:

Local checks at a42af3e, one worker:

  • the tests this change reaches on main 56680f6 (test:ui --changed): 498 files, 14,750 passed;
  • the long-press and keyboard-capped lists specs, every case three times: Chromium 114 passed, 3 skipped; WebKit under the CI profile 90 passed, 27 skipped;
  • the gesture specs: Chromium 84 passed, 4 skipped; WebKit 76 passed, 12 skipped;
  • in Chromium: the ContextMenu audit, long-press a11y, cursor-anchor and menu hover-focus specs (31 passed); in WebKit: the cursor-anchor spec (3 passed);
  • the core typecheck, strict eslint and prettier on the changed files, changeset coverage, check:changesets and check:knowledge.

The previous round, at cd6d257:

Local checks at cd6d257, one worker:

  • check:knowledge, check:changesets, prettier on the changed files, and strict eslint on the spec;
  • the long-press and keyboard-capped lists specs, every case three times: Chromium 114 passed, 3 skipped; WebKit under the CI profile 90 passed, 27 skipped.

The previous round, at 44ab755:

  • b8c7cb2 merges feat(ContextMenu): open from a held finger on iOS 26's timeline #8125's head 5adbafb, which merges main 50beab9 and fixes the shift cases' timing in the long-press spec. 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 and files).
  • 44ab755, tests only. The case "a touch that reaches the page late grows from the first frame at its onset" failed once in three Chromium runs. Its frame read 149.6 ms after the touch, against 150. The press feedback starts the growth in the first frame whose callback runs at or after the onset. The curve starts when that callback runs. The case checked the frame's own time, which can fall just before the onset. It now checks that the growth animation's own start time is at or after the onset. The two-frame bound stays.
  • Red first: a frame callback that ran 8 ms ahead of the press feedback's widened that gap. The old check then failed 8 of 20 times, at about 142 ms, and the new one passed 20 of 20. Unprobed, it passed 20 of 20.

Local checks at 44ab755, one worker (the unit, gesture and a11y runs at b8c7cb2, which differs only in that spec):

  • the tests this change reaches on main 50beab9 (test:ui --changed): 498 files, 14,722 passed;
  • the long-press and keyboard-capped lists specs, every case three times: Chromium 114 passed, 3 skipped; WebKit under the CI profile 90 passed, 27 skipped;
  • the gesture specs: Chromium 84 passed, 4 skipped; WebKit 76 passed, 12 skipped;
  • in Chromium: the ContextMenu audit, long-press a11y, cursor-anchor and menu hover-focus specs (31 passed); in WebKit: the cursor-anchor spec (3 passed);
  • the core typecheck, strict eslint and prettier on the changed files, changeset coverage, check:changesets and check:knowledge.

The previous round, at c11eb1f:

Local checks at c11eb1f, one worker:

  • the tests this change reaches on main 4d1cb82 (test:ui --changed): 496 files, 14,484 passed;
  • the long-press and keyboard-capped lists specs, every case three times: Chromium 111 passed, 3 skipped; WebKit under the CI profile 90 passed, 24 skipped;
  • the gesture specs: Chromium 84 passed, 4 skipped; WebKit 76 passed, 12 skipped;
  • in Chromium: the ContextMenu audit, long-press a11y, cursor-anchor and menu hover-focus specs (31 passed); in WebKit: the cursor-anchor spec (3 passed);
  • the core typecheck, strict eslint and prettier on the changed files, changeset coverage, check:changesets and check:knowledge.

The previous round, at a1cc302:

Local checks at a1cc302, one worker (the unit, gesture and a11y runs at 01f5f22, which differs only in that spec):

  • the tests this change reaches on main 1740654 (test:ui --changed): 487 files, 14,335 passed;
  • the long-press and keyboard-capped lists specs, every case three times: Chromium 111 passed, 3 skipped; WebKit under the CI profile 90 passed, 24 skipped;
  • the stays-put case ten more times in WebKit: 10 passed;
  • the gesture specs: Chromium 83 passed, 4 skipped; WebKit 75 passed, 12 skipped;
  • in Chromium: the ContextMenu audit, long-press a11y, cursor-anchor and menu hover-focus specs (31 passed); in WebKit: the cursor-anchor spec (3 passed);
  • the core typecheck, strict eslint and prettier on the changed files, changeset coverage, check:changesets and check:knowledge.

The previous round, at 8fc523e:

Local checks at 8fc523e, one worker:

  • the tests this change reaches on main 6ab0c2e (test:ui --changed): 488 files, 14,345 passed;
  • the long-press and keyboard-capped lists specs, every case three times: Chromium 108 passed, 3 skipped; WebKit under the CI profile 87 passed, 24 skipped;
  • the gesture specs: Chromium 83 passed, 4 skipped; WebKit 75 passed, 12 skipped;
  • in Chromium: the ContextMenu audit, long-press a11y, cursor-anchor and menu hover-focus specs (31 passed); in WebKit: the cursor-anchor spec (3 passed);
  • the core typecheck, strict eslint and prettier on the changed files, changeset coverage, check:changesets and check:knowledge.

The previous round, at 8fb305f, from review:

  • da14211 merges feat(ContextMenu): open from a held finger on iOS 26's timeline #8125's head 69e6dd8, whose comments stop naming a press feedback there. The touch layer's header keeps both sides' sentences.
  • cecb382, comments only: the timeline's header and the long-press spec name the press feedback again, since it ships here.
  • 3e17bd2, red first: in a same-origin iframe, a finger's growth starts at that window's onset. That is the first frame at or after 150 ms past the landing. At 850a9c2 it started in the first frame, dated on the page's clock.
  • 69a6851 fixes it. The press feedback reads the trigger's window for its frames and clock, and for another window its animator runs on that window's clock and frames. The page's own document keeps the defaults. A comment that only restated a name goes.
  • 1d6ec37, records only: the End-user impact row drops its "does not yet" sentence, a gap that Current-state impact states against FR5.
  • 8fb305f, comments only: the press feedback's file comment keeps one line; the rest repeated the hook's JSDoc.

Local checks at 1d6ec37, one worker (8fb305f changes one comment):

  • the tests this change reaches on main b8835b8 (test:ui --changed): 485 files, 14,214 passed;
  • the long-press spec, every case three times: Chromium 87 passed, 3 skipped; WebKit under the CI profile 66 passed, 24 skipped;
  • the keyboard-capped lists spec: Chromium 7 passed; WebKit 7 passed;
  • the gesture specs: Chromium 77 passed, 4 skipped; WebKit 69 passed, 12 skipped; presented hit testing 6 passed in each;
  • in Chromium: the ContextMenu audit (18 passed), long-press a11y (3 passed), cursor-anchor (3 passed) and menu hover-focus (7 passed) specs;
  • in WebKit: the cursor-anchor spec (3 passed);
  • the core typecheck, strict eslint and prettier on the changed files, changeset coverage, check:changesets and check:knowledge.

The previous round, at 850a9c2:

  • 4e93b5f replaces the module-level set of mounted triggers with a private attribute, data-astryx-context-menu-trigger, written and read through one owner module. A nested trigger still grows alone.
  • f908089, records only: component:ContextMenu's Ownership names that module, its writer and its reader.
  • 850a9c2 merges feat(ContextMenu): open from a held finger on iOS 26's timeline #8125's head fac565a. ContextMenuTouch.ts goes, so the touch layer imports contextMenuPress and contextMenuPressFeedback directly. 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:

  • the tests this change reaches on main b8835b8 (test:ui --changed): 485 files, 14,213 passed;
  • the long-press spec, every case three times: Chromium 87 passed, 3 skipped; WebKit under the CI profile 66 passed, 24 skipped;
  • the keyboard-capped lists spec: Chromium 7 passed; WebKit 7 passed;
  • the gesture specs: Chromium 77 passed, 4 skipped; WebKit 69 passed, 12 skipped; presented hit testing 6 passed in each;
  • in Chromium: the ContextMenu audit (18 passed), long-press a11y (3 passed), cursor-anchor (3 passed) and menu hover-focus (7 passed) specs;
  • in WebKit: the cursor-anchor spec (3 passed);
  • the core typecheck, strict eslint and prettier on the changed files, changeset coverage, check:changesets and check:knowledge.

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:

  • d26b15b adds a set-height trigger with a full-height child to 'Touch / trigger layouts' and its layout case. It fails at that commit: the child measured 24 px in the 160 px trigger.
  • 7d23141 makes the inner box take the trigger's height in block layout, as it already does in flex and grid.
  • a75cf09 checks that the trigger keeps its own attributes, and that the inner box carries only its class.

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.tsx differs from 850a9c2's in one comment line. The change adds no public data-* attribute; 4e93b5f's private data-astryx-context-menu-trigger has its owner module (INV23).

Local checks at 0b1f31c, one worker:

  • the long-press spec: Chromium 28 passed, 1 skipped; WebKit under the CI profile 22 passed, 7 skipped;
  • the keyboard-capped lists spec: Chromium 7 passed; WebKit 7 passed;
  • the gesture specs: Chromium 76 passed, 4 skipped; WebKit 68 passed, 12 skipped; presented hit testing 6 passed in each;
  • the ContextMenu audit (18 passed), long-press a11y (3 passed) and cursor-anchor specs in Chromium (3 passed), and the cursor-anchor spec in WebKit (3 passed);
  • the ContextMenu, Layer, motion, DropdownMenu, hooks, gestures, utils and lift units (5,369 passed), the core typecheck, eslint, check:changesets and check:knowledge.

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:

  • 06c942c adds the cases for architecture:layer-runtime INV21 and INV22 (spec:AST-059 DEC-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.
  • 597e158 grows an inner visual box, and the touch changeset says so. The anchor stays outside it, and the script that cancelled the scale at the anchor is gone.
  • 2ef1714 turns the long-press cases' fifteen fixed waits into conditions. Each waits on the page clock from the touch, the menu's moment plus a task, the lift plus a frame, or a settled menu.

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:

  • the long-press spec: Chromium 25 passed, 1 skipped; WebKit under the CI profile 19 passed, 7 skipped. Twice more each: Chromium 50 passed, 2 skipped; WebKit, with the keyboard-capped lists spec, 52 passed, 14 skipped;
  • the keyboard-capped lists spec in Chromium (7 passed);
  • the ContextMenu audit in Chromium (18 passed);
  • the cursor-anchor, long-press and menu hover-focus a11y specs in Chromium (13 passed), and the cursor-anchor spec in WebKit (3 passed);
  • the ContextMenu, Layer, motion, DropdownMenu and hooks units (3,317 passed), the core typecheck, eslint, check:changesets and check:knowledge.

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: ContextMenuLongPress in 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 said CI=true pnpm lint, but those runs were pnpm lint, which reports @eslint-react/dom-no-flush-sync only 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):

  • the growth starts 151 ms after the landing (164 ms at 4×), with no back-dated start, and peaks at 1.0746;
  • an early lift returns in 314 / 327 ms, and the return as the menu closes takes 297 / 307 ms;
  • with animations removed, there is no growth and no return.

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 of its own; #8125's default move shows in this diff against main.

Internal, new:

  • privateAttributes/contextMenuTrigger.stylex.ts: the owner module of the private data-astryx-context-menu-trigger attribute (architecture:public-component-api INV23), named in component: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, along the flat tree: through a slot and out of a shadow root. 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:ContextMenu FR12), 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:

  • product +568/−23 (contextMenuPressFeedback.ts +296, ContextMenuTouchLayer.tsx +101/−7, ContextMenu.tsx +86/−6, privateAttributes/contextMenuTrigger.stylex.ts +41, motion/uikit/contextMenu.ts +35/−8, contextMenuPress.ts +6, utils/flatTree.ts +3/−2);
  • tests +2,486/−104, records +40/−35, docs +19/−4, story +359/−3, changesets +1/−1.

Drafted with an AI coding agent; the tests were run as described.

@vercel

vercel Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Dec 3, 2026 1:42am UTC

Request Review

@astracat-bot

astracat-bot Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟡 Reviewed (for maintainers only) Dec 3, 2026, 2:15 AM UTC

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 3, 2026
@github-actions github-actions Bot added the needs:design-review Affects visuals — Design should review label Nov 3, 2026
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Nov 3, 2026
@cixzhang

cixzhang commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

/approve-spec 578373e

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Nov 3, 2026
@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

Current run: The current CI run concluded skipped. Current analysis is unavailable.


Generated by PR Enrichment workflow | View current CI run

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-fast and --ease-move tokens, which spec:AST-094 FR4 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 isDisabled turns true while a finger-opened menu is up, the touch layer unmounts and disposes its animator without restoring the trigger's inline scale, 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 watchOutsidePress for touch and its own mousedown Effect 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-runtime INV16).
  • useContextMenuPressFeedback runs its own attach, replace and dispose lifecycle for its animator and press observer, so move both onto useAttachment, which the same layer's useGestureRecognizer already 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 main is 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]

Comment thread .changeset/outside-press-pan-watch.md Resolved
@vjeux
vjeux force-pushed the uikit/c20-contextmenu-growth branch from 578373e to 0d1fdb7 Compare November 3, 2026 22:56
@cixzhang

cixzhang commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

/approve-spec 0d1fdb7

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-fast and --ease-move tokens, which spec:AST-094 FR1 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.
  • ContextMenuTouchLayer subscribes to its recognizer's transitions from an Effect whose only dependency never changes, so add that listener in the recognizer factory passed to useGestureRecognizer and delete the Effect.
  • ContextMenuPressRecognizer gains an onPressStart option that only a unit test passes, and its doc says the press feedback starts from it, so remove the option.
  • The diff against main is 4,132 authored lines because it carries #9814 and #8125, so land those first, or declare the stack with one identical Stack: #9814 → #8125 → #9816 line 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]

@vjeux
vjeux force-pushed the uikit/c20-contextmenu-growth branch from 0d1fdb7 to caf271c Compare November 4, 2026 09:37
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Nov 4, 2026
@cixzhang

cixzhang commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

/approve-spec caf271c

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Nov 4, 2026

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.md say 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: PressTiming and timedCurve in contextMenuPressTiming.ts, and themeTiming in contextMenuPressFeedback.ts, copy ThemeTiming, timedCurve and themeTimingOf from SegmentedControl/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]

Comment thread .changeset/outside-press-pan-watch.md Resolved
@vjeux
vjeux force-pushed the uikit/c20-contextmenu-growth branch from b168c85 to 037a530 Compare November 4, 2026 10:36
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Nov 4, 2026
@cixzhang

cixzhang commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

/approve-spec 037a530

vjeux added 5 commits December 1, 2026 18:25
FR12 said "a finger that lands before the touch layer has loaded",
which the knowledge check reads as project status and warns on. It now
says "a finger down before", with the same meaning.
AST-094's late-begin evidence row said "a finger that lands before its
recognizer attaches", which the knowledge check reads as project
status and warns on. It now says "a finger down before", with the same
meaning.
The record's current-state note still said ContextMenu owns its
outside-press listener. Its outside press now goes through the shared
outside-press watch, for a mouse and a finger alike. The note now says
so: ContextMenu owns its invocation and open state, and it closes on
an outside press through that watch, against AST-107 FR8.
@vjeux

vjeux commented Dec 2, 2026

Copy link
Copy Markdown
Contributor Author

toTriggerLocal, the Android long-press comment, and the touch-layer wait that five browser specs copy are #8125's lines. None is in main or in this pull request's own diff. They stay as they are while #8125's device evidence carries, and get a follow-up after the stack lands. The stale current-state line is fixed in a5fc8b6.

@cixzhang

cixzhang commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

/approve-spec b31c5fd

@astracat-bot astracat-bot Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes requested. The record changes are owner-approved at this head, and clipping, ringed, badged and scrolling div triggers draw exactly as on main under a mouse and under a finger (checked locally at this head in Chromium). Three things still block.

Required

  • The touch layer reads the trigger's text-overflow only when it mounts and when the trigger's class changes (ContextMenuTouchLayer.tsx:121-135), so a truncation set by a media or container query or a StyleX dynamic style loses its ellipsis under a finger after it changes (reproduced locally at this head with a dynamic style): read it again at each commit and when the viewport or container changes, or bound the description to a text-overflow the trigger's class sets.
  • The description's "a box only where the hold grows it" is broader than the code, because under Reduce Motion the inner box is still a box that never grows; say "a box once the touch layer has loaded for a block trigger whose menu opens at the finger".
  • At the head that lands, state in the description the touch-presentation spec's real-device iOS run and its Android runs (Chrome with Gboard, animations at normal scale and removed, plus a slow-device profile), because the earlier runs do not carry over the ContextMenu.tsx and ContextMenuTouchLayer.tsx changes at this head.

Approval

A new commit voids the record approval, so an engineering owner comments /approve-spec with the full SHA of the head that lands; the author may do so as an engineering owner.

Non-blocking

  • Layer/outsidePress.ts:281 adds a document mousedown listener in Layer that only ContextMenu uses; the comment notes on toTriggerLocal and the 28-word Android comment stand, as you said, for a follow-up.
Claims and files checked

Review mode: same-head; reason: none

Changed rules (0): none

Claims:

  • Title (live): feat(ContextMenu): a held finger grows a block trigger on UIKit's lift spring — verified (contextMenuPressFeedback.ts plays the lift spring; ContextMenu.tsx gives only a block trigger at the finger a growing box)
  • Description: the growth starts at the first frame at or after the hold's start plus 150 ms, from rest, toward 1.0735 on the lift spring; an earlier finger's hold starts at the load — verified (frame watch from the landing plus 150 ms; late touch begun as the touch layer mounts)
  • Description: it returns on the dismiss spring when the hold ends with no menu or the menu closes, and holds while the menu is up — verified (end, release and hold in the press feedback)
  • Description: none inline, behind a sheet or under Reduce Motion; a nested trigger grows alone; an enabled touch-model trigger joins core's press machine — verified
  • Description: the growth scales an inner box, a box only where the hold grows it — false: under Reduce Motion the box is still a box and never grows
  • Description: the menu's anchor stays on the untransformed trigger — verified (the cursor anchor sits outside the box; the INV22 browser case)
  • Description: no API change of its own; the omitted presentation follows the touch model as the records already state, and popover keeps the released behavior — verified (one changed default in the API surface comparison run locally at this head)
  • Description: a block trigger grows about 7% and its docs ask for room; the motion engine loads with the touch layer — verified (ContextMenu.doc.mjs; the animator is imported only through the touch layer)
  • Description: a late frame starts the grow-in from rest; the springs play on the compositor — verified
  • Description (Testing): the visual is no box unless the hold can grow it, and stays the same element — verified
  • Description (Testing): there the visual takes the trigger's overflow only when the trigger cuts its own text, so the ellipsis stays — false: a text-overflow that changes without a class change is never read again (reproduced locally at this head)
  • Description (Testing): the touch layer reads that, so the first load carries none of it — verified
  • Description: line counts over the touch-hold pull request — verified
  • Description: first-load sizes, local test, browser and simulator runs, and earlier device runs — reported
  • Description: device takes at this head have not run — verified (the missing evidence above)
  • Touch-timeline release note: the measured timeline, growth from 150 ms, no growth under Reduce Motion, the 400/735 ms moments, the drift and second-finger rules, the deferred load and the failed-load long press — verified; its new wording (keyboard and pointer opens of a popover menu focus the first item; the next touch asks for the code again) — verified
  • Arena release note: a late deadline waits 50 ms when its timer is more than 17 ms late while the latest contact is a finger or a pen; finger or pen input over 33 ms late keeps it waiting 50 ms more; a mouse never makes it wait 50 ms; a deadline among coalesced samples runs between them — verified (GestureArena.ts timer and late-input logic)
  • Outside-press release note: a popover menu closes through the layer's outside-press watch, a bottom-sheet menu as BottomSheet does, and a mouse or pen closes it at its mousedown in the menu's own document — verified
  • Description (internal API): the private trigger mark's owner module marks a trigger while its press feedback is attached, returns the unmark call, and finds the trigger a press belongs to — verified (privateAttributes/contextMenuTrigger.stylex.ts; contextMenuPressFeedback.ts:262, :281)
  • Description (internal API): the growth hook is used only by the touch layer — verified (a search of the head's packages and apps finds one caller, ContextMenuTouchLayer.tsx:109, beside its own test)
  • Description: core's press machine marks late inside a scroll view and never for a press that travels past 10 px — reported (the author's reason for timing from the landing)
  • Description (Scope): public text and artifacts carry no internal context — verified (no match in the title, body, branch or commit messages)

Files:

  • .changeset/contextmenu-outside-press-watch.md — clear
  • .changeset/contextmenu-touch-timeline.md — clear
  • .changeset/gesture-arena-late-input.md — clear
  • apps/storybook/stories/ContextMenu.stories.tsx — clear
  • docs/architecture/layer-runtime.md — clear (owner-approved at this head)
  • docs/specs/AST-094-touch-presentations/spec.md — clear (owner-approved at this head)
  • docs/specs/components/ContextMenu/ContextMenu.spec.md — clear (owner-approved at this head)
  • internal/eslint-plugin-astryx/no-comment-provenance.baseline.json — clear
  • packages/core/src/ContextMenu/ContextMenu.doc.mjs — clear
  • packages/core/src/ContextMenu/ContextMenu.test.tsx — clear
  • packages/core/src/ContextMenu/ContextMenu.touchLoadFailure.test.tsx — clear
  • packages/core/src/ContextMenu/ContextMenu.triggerProps.test.tsx — clear
  • packages/core/src/ContextMenu/ContextMenu.tsx — clear (the box fix holds; non-blocking comment notes carried)
  • packages/core/src/ContextMenu/ContextMenuTouchGrowth.test.tsx — clear
  • packages/core/src/ContextMenu/ContextMenuTouchLayer.tsx — finding: text-overflow re-read only on a class change
  • packages/core/src/ContextMenu/ContextMenuTouchLayerProps.test.tsx — clear
  • packages/core/src/ContextMenu/__tests__/ContextMenuLongPress.a11y.chromium.spec.ts — clear
  • packages/core/src/ContextMenu/__tests__/ContextMenuLongPress.interaction.browser.spec.ts — clear (its pixel pairs set no text-overflow after load)
  • packages/core/src/ContextMenu/__tests__/ContextMenuLongPressLink.a11y.chromium.spec.ts — clear
  • packages/core/src/ContextMenu/contextMenuPress.test.ts — clear
  • packages/core/src/ContextMenu/contextMenuPress.ts — clear
  • packages/core/src/ContextMenu/contextMenuPressFeedback.test.tsx — clear
  • packages/core/src/ContextMenu/contextMenuPressFeedback.ts — clear
  • packages/core/src/ContextMenu/contextMenuTouchLoader.boundary.test.ts — clear
  • packages/core/src/ContextMenu/contextMenuTouchLoader.ts — clear
  • packages/core/src/Indicator/boxHold.test.tsx — clear
  • packages/core/src/Layer/outsidePress.test.ts — clear
  • packages/core/src/Layer/outsidePress.ts — clear (behavior tag-along note only)
  • packages/core/src/Layer/useLayer.test.tsx — clear
  • packages/core/src/Layer/useLayer.tsx — clear
  • packages/core/src/Table/__tests__/TableCellMenus.a11y.browser.spec.ts — clear
  • packages/core/src/gestures/GestureArena.ts — clear
  • packages/core/src/gestures/GestureHost.ts — clear
  • packages/core/src/gestures/__tests__/GestureHost.test.ts — clear
  • packages/core/src/gestures/__tests__/arena.test.ts — clear
  • packages/core/src/gestures/__tests__/arenaTimersAndClaims.test.ts — clear
  • packages/core/src/gestures/__tests__/harness.ts — clear
  • packages/core/src/gestures/types.ts — clear
  • packages/core/src/hooks/__tests__/MenuPressShadowRoot.a11y.chromium.spec.ts — clear
  • packages/core/src/hooks/usePager.test.ts — clear
  • packages/core/src/motion/README.md — clear
  • packages/core/src/motion/uikit/contextMenu.ts — clear (named by owner-approved lines)
  • packages/core/src/privateAttributes/contextMenuTrigger.stylex.ts — clear (named by owner-approved lines)
  • packages/lab/src/PageControl/__tests__/PageControl.interaction.browser.spec.ts — clear
  • packages/lab/src/PageControl/__tests__/holdBegin.test.ts — clear
  • packages/lab/src/PageControl/__tests__/holdBegin.ts — clear
  • scripts/shared-identity.baseline.json — clear

Automated review (maintainer link)

vjeux added 11 commits December 1, 2026 21:54
The touch timeline's note said the page stays free to scroll while the
menu is up. A bottom-sheet menu's scrim locks the page's scroll, so the
note now says that of a popover menu, as the outside-press note does.
The touch layer read whether the trigger cuts its own text only as it
mounted and when the trigger's class changed. A cut that a media query
starts after the load then lost its ellipsis under the touch model. The
trigger-layouts story gains a trigger that cuts its text only in a
narrow viewport, beside a plain box with the same style. The spec loads
the touch layer in a wide viewport, narrows it, and compares the pair's
pixels. It fails here.
The touch layer read whether the trigger cuts its own text only as it
mounted and when the trigger's class changed. A cut that a media or
container query or a dynamic style starts later lost its ellipsis under
the touch model. The layer now reads it at each commit, when the
trigger resizes and when the window resizes; the window's resize comes
through core's shared input stream. The read stays in the touch layer,
so the first load carries none of it. The visual's comments now say
where it is a box: once the touch layer has loaded, for a block trigger
whose menu opens at the finger.
The comment on the arena's latest-contact flag opened by restating the
field's name. It now says only what the name does not: a late deadline
waits for queued input only while the flag is true, and a mouse keeps
the one-task yield.
The comment on a touch's input samples said "the arena's clock never
runs back, so it holds a late input's time", where "it" reads as the
clock. The arena holds that time and filters the samples, and it leaves
the input's positions as they came. The comment now names the arena
as the subject of each sentence.

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes requested: the text-overflow read and the box wording from the last review are fixed, and three things still block.

Required

  • Miss: a finger held on a part of a block trigger that sits in a shadow root (a web component child) opens the menu but never grows the trigger, because closestContextMenuTrigger uses element.closest(), which stops at the shadow root (privateAttributes/contextMenuTrigger.stylex.ts:26, reached from contextMenuPressFeedback.ts:281; reproduced locally with a unit probe), so walk the flat tree there and add a case with a shadow-root child.
  • The description's "a class, a dynamic style, a media query, or a container query on a trigger that resizes with its container is read" is broader than the code, which reads only at a commit or a resize, so a media feature that changes with no resize (prefers-contrast, prefers-color-scheme, forced-colors) or a class set through the forwarded ref is not read; bound it to "a class or dynamic style ContextMenu renders, a media query on the viewport's size, or a container query on a trigger that resizes with its container".
  • At the head that lands, state in the description the touch-presentation spec's real-device iOS run and its Android runs (Chrome with Gboard, animations at normal scale and removed, plus a slow-device profile), because the earlier runs do not carry over this round's ContextMenuTouchLayer.tsx change.

A new commit voids the record approval, so an engineering owner comments /approve-spec with the full SHA of the head that lands; the author may do so as an engineering owner.

Non-blocking

  • Layer/outsidePress.ts:281 adds a document mousedown listener in Layer that only ContextMenu uses; the comment notes on toTriggerLocal and the Android comment stand, as you said, for a follow-up.
Claims and files checked

Review mode: incremental; reason: none

Changed rules (2): Claim bounding in one round (edited); For a claim about focus, events or DOM placement (new)

  • Claim bounding in one round: finding (both falsifying cases of the text-overflow claim, and the shadow-root growth case marked as missed by earlier reviews)
  • For a claim about focus, events or DOM placement: finding (the shadow-root case falsifies the growth and nested-trigger claims); checked the touch-timeline and outside-press notes and the description's anchor and nested-trigger claims against an unfocused, SVG, second-document, shadow-root, disabled or removed opener, a stacked surface and a focus-target prop (ContextMenu has none)

Claims:

  • Title (live): a held finger grows a block trigger on UIKit's lift spring — false for a finger on a shadow-root part of the trigger (first finding); otherwise verified (the press feedback plays the lift spring on the trigger's visual)
  • Description: the growth starts at the first frame at or after the landing plus 150 ms, toward 1.0735 on the lift spring — verified (growth unit cases, run locally)
  • Description: it returns on the dismiss spring when the hold ends with no menu or the menu closes, and holds while the menu is up — verified (end, release and hold in the press feedback; unit cases)
  • Description: no growth inline, behind a sheet or under Reduce Motion — verified (isShown, the reduced-motion check at the onset)
  • Description: a nested trigger grows alone — verified for nesting in the light DOM; a press inside a shadow root grows no trigger at all (first finding)
  • Description: an enabled touch-model trigger joins core's press machine — verified (pressableProps under the touch model)
  • Description: the growth scales an inner box, a box once the touch layer has loaded for a block trigger whose menu opens at the finger — verified (growsVisual)
  • Description: the menu's anchor stays on the untransformed trigger — verified (the cursor anchor sits outside the visual)
  • Description: no API change of its own; the omitted presentation follows the touch model and popover keeps the released behavior — verified (one changed default)
  • Description: a block trigger grows about 7% and its docs ask for room; the motion engine loads with the touch layer — verified (the docs; the touch-loader boundary test, run locally)
  • Description: a late frame starts the grow-in from rest; the springs play on the compositor — verified
  • Description (Testing): the touch layer reads the cut at each commit, when the trigger resizes and when the window resizes, through the shared input stream — verified (the touch layer's layout effect, resize observer and window resize subscription)
  • Description (Testing): so a class, a dynamic style, a media query or a container query on a trigger that resizes with its container is read — false (second finding)
  • Description (Testing): the read stays in the touch layer, so the first load carries none of it — verified (the boundary test, run locally)
  • Description (Testing): the three merges resolve as described and leave this pull request's own diff otherwise unchanged — verified (merge diffs and the patch comparison)
  • Description: first-load sizes, red-first and green browser runs, preflight counts, simulator and earlier device runs — reported
  • Description: no device takes at this head — verified (the missing evidence above)
  • Description (internal API): the trigger mark's owner module marks a trigger while its feedback is attached and finds the trigger a press belongs to — false for a press inside a shadow root (first finding)
  • Description (internal API): the growth hook is used only by the touch layer — verified (a search of the head's packages and apps finds one caller beside its own test)
  • Description: core's press machine marks late inside a scroll view and never past 10 px — reported
  • Description (Scope): public text and artifacts carry no internal context — verified
  • Touch-timeline note: the measured timeline, growth from 150 ms, no growth under Reduce Motion, the 400/735 ms moments, the drift and second-finger rules, the deferred load and the failed-load long press; while a popover menu is up the page stays free to scroll — verified
  • Arena note: the late-deadline waits for a finger or a pen, none for a mouse, and a deadline among coalesced samples runs between them — verified (the arena's timer and late-input logic; gesture units, run locally)
  • Outside-press note: a popover menu closes through the layer's outside-press watch, a mouse or pen at its mousedown in the menu's own document, so a menu in an iframe or a Picture-in-Picture window no longer closes on a press in the page — verified (the second-document unit case; the same document path serves a Picture-in-Picture window; main listened on the page's document)

Files:

  • .changeset/contextmenu-outside-press-watch.md — clear
  • .changeset/contextmenu-touch-timeline.md — clear (the popover-only scroll wording holds)
  • .changeset/gesture-arena-late-input.md — clear
  • apps/storybook/stories/ContextMenu.stories.tsx — clear (the narrow-viewport cut case)
  • docs/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 — clear (owner-approved)
  • internal/eslint-plugin-astryx/no-comment-provenance.baseline.json — clear
  • packages/core/src/ContextMenu/ContextMenu.doc.mjs — clear
  • packages/core/src/ContextMenu/ContextMenu.test.tsx — clear
  • packages/core/src/ContextMenu/ContextMenu.touchLoadFailure.test.tsx — clear
  • packages/core/src/ContextMenu/ContextMenu.triggerProps.test.tsx — clear
  • packages/core/src/ContextMenu/ContextMenu.tsx — clear (non-blocking comment notes carried)
  • packages/core/src/ContextMenu/ContextMenuTouchGrowth.test.tsx — gap: no case presses a shadow-root part of the trigger
  • packages/core/src/ContextMenu/ContextMenuTouchLayer.tsx — clear (the text-overflow read is fixed; the description over-claims it)
  • packages/core/src/ContextMenu/ContextMenuTouchLayerProps.test.tsx — clear
  • packages/core/src/ContextMenu/__tests__/ContextMenuLongPress.a11y.chromium.spec.ts — clear
  • packages/core/src/ContextMenu/__tests__/ContextMenuLongPress.interaction.browser.spec.ts — clear (the narrowed-viewport pair)
  • packages/core/src/ContextMenu/__tests__/ContextMenuLongPressLink.a11y.chromium.spec.ts — clear
  • packages/core/src/ContextMenu/contextMenuPress.test.ts — clear
  • packages/core/src/ContextMenu/contextMenuPress.ts — clear
  • packages/core/src/ContextMenu/contextMenuPressFeedback.test.tsx — clear
  • packages/core/src/ContextMenu/contextMenuPressFeedback.ts — finding: the onset check misses a shadow-root target
  • packages/core/src/ContextMenu/contextMenuTouchLoader.boundary.test.ts — clear
  • packages/core/src/ContextMenu/contextMenuTouchLoader.ts — clear
  • packages/core/src/Indicator/boxHold.test.tsx — clear
  • packages/core/src/Layer/outsidePress.test.ts — clear
  • packages/core/src/Layer/outsidePress.ts — clear (behavior tag-along note only)
  • packages/core/src/Layer/useLayer.test.tsx — clear
  • packages/core/src/Layer/useLayer.tsx — clear
  • packages/core/src/Table/__tests__/TableCellMenus.a11y.browser.spec.ts — clear
  • packages/core/src/gestures/GestureArena.ts — clear (comment edit)
  • packages/core/src/gestures/GestureHost.ts — clear
  • packages/core/src/gestures/__tests__/GestureHost.test.ts — clear
  • packages/core/src/gestures/__tests__/arena.test.ts — clear
  • packages/core/src/gestures/__tests__/arenaTimersAndClaims.test.ts — clear
  • packages/core/src/gestures/__tests__/harness.ts — clear
  • packages/core/src/gestures/types.ts — clear (comment edit)
  • packages/core/src/hooks/__tests__/MenuPressShadowRoot.a11y.chromium.spec.ts — clear
  • packages/core/src/hooks/usePager.test.ts — clear
  • packages/core/src/motion/README.md — clear
  • packages/core/src/motion/uikit/contextMenu.ts — clear (named by owner-approved lines)
  • packages/core/src/privateAttributes/contextMenuTrigger.stylex.ts — finding: closestContextMenuTrigger stops at a shadow root
  • packages/lab/src/PageControl/__tests__/PageControl.interaction.browser.spec.ts — clear
  • packages/lab/src/PageControl/__tests__/holdBegin.test.ts — clear
  • packages/lab/src/PageControl/__tests__/holdBegin.ts — clear
  • scripts/shared-identity.baseline.json — clear

Automated review (maintainer link)

@cixzhang

cixzhang commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

/approve-spec 382d939

vjeux added 2 commits December 2, 2026 03:26
A finger held on a block trigger's child that renders inside an open
shadow root opens the menu, but the trigger never grows: the press
feedback finds the trigger a landing belongs to with `closest`, which
stops at the shadow root. A unit case lands on a control inside a
shadow root in the trigger. The touch stories gain a card whose label
renders inside an open shadow root, and the long-press spec holds a
finger on it and reads the trigger's growth. Both fail here.
The press feedback finds the trigger a landing belongs to with
`closest`, which stops at a shadow root. A finger held on a trigger's
child inside a shadow root opened the menu, but the trigger never grew.
The lookup now goes on from each shadow root's host, open or closed, so
the innermost trigger at or above the landing is found.
@cixzhang

cixzhang commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

/approve-spec 031f8e1

@astracat-bot astracat-bot Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes requested: the record changes are approved by an engineering owner for this head, and two things still block.

Required

  • A finger held on content slotted into a trigger (ContextMenu rendered inside a web component's shadow root around a <slot>) opens the menu but never grows that trigger, and grows an outer trigger instead when the web component sits inside one, because closestContextMenuTrigger climbs only closest() and shadow hosts while the gesture host routes the touch through the slot (privateAttributes/contextMenuTrigger.stylex.ts:33-43; reproduced locally with a unit probe), so walk parentAcrossShadow from utils/flatTree there and add slotted-content cases, alone and inside an outer trigger.
  • At the head that lands, state in the description the touch-presentation spec's real-device iOS run and its Android runs (Chrome with Gboard, animations at normal scale and removed, plus a slow-device profile), because the earlier runs do not carry over the contextMenuTrigger.stylex.ts change.

A new commit voids the record approval, so an engineering owner comments /approve-spec with the full SHA of the head that lands; the author may do so as an engineering owner.

Non-blocking

  • Layer/outsidePress.ts:281 adds a document mousedown listener in Layer that only ContextMenu uses; the toTriggerLocal name and the Android comment stand, as you said, for a follow-up.
Claims and files checked

Review mode: same-head; reason: none

Changed rules (0): none

Claims:

  • Title (live): feat(ContextMenu): a held finger grows a block trigger on UIKit's lift spring — false for a trigger whose content is slotted in (first finding); otherwise verified (growth unit cases, run locally; an earlier Chromium capture of the shadow-root story at this head)
  • Description: the growth starts at the first frame at or after the landing plus 150 ms, toward 1.0735 on the lift spring — verified (growth unit cases, run locally)
  • Description: it returns on the dismiss spring when the hold ends with no menu or the menu closes, and holds while the menu is up — verified (end, release and hold in the press feedback; unit cases, run locally)
  • Description: no growth inline, behind a sheet or under Reduce Motion — verified (isShown, the reduced-motion check at the onset)
  • Description: a nested trigger grows alone — verified for light-DOM and shadow-root children; false for slotted content, where no trigger or the outer one grows (first finding; unit probe, run locally)
  • Description: an enabled touch-model trigger joins core's press machine — verified (pressableProps under the touch model)
  • Description: the growth scales an inner box, a box once the touch layer has loaded for a block trigger whose menu opens at the finger — verified (growsVisual)
  • Description: the menu's anchor stays on the untransformed trigger — verified (the cursor anchor sits outside the visual)
  • Description: no API change of its own; the omitted presentation follows the touch model and popover keeps the released behavior — verified (one changed default, from the API report generator at this head)
  • Description: a block trigger grows about 7% and its docs ask for room; the motion engine loads with the touch layer — verified (the docs; the touch-loader boundary test, run locally)
  • Description: a late frame starts the grow-in from rest; the springs play on the compositor — verified
  • Description (Testing): the trigger lookup used closest, which stops at a shadow root — verified
  • Description (Testing): the lookup goes on from each shadow root's host, open or closed, so it finds the innermost trigger at or above the landing — verified for open and closed shadow roots; false for content slotted into the trigger (first finding)
  • Description (Testing): red first, the unit case and the browser spec fail before the fix and pass after it — the unit case passes here, run locally; the fail-before run and the Chromium capture come from an earlier review of this head; the WebKit runs reported
  • Description (Testing): the touch layer reads a cut that a commit or a resize starts, and a cut that starts with neither waits for the next one — verified (the touch layer's layout effect, resize observer and window resize subscription)
  • Description (Testing): the read stays in the touch layer, so the first load carries none of it — verified (the boundary test, run locally)
  • Description (Testing): earlier device runs do not carry, and no device takes exist at this head — verified (the missing evidence above)
  • Description: first-load sizes, preflight counts, WebKit counts, simulator and earlier device runs — reported
  • Description (internal API): the trigger mark's owner module finds the trigger a press belongs to, out of shadow roots in the trigger too — false for content slotted into the trigger (first finding)
  • Description (internal API): the growth hook is used only by the touch layer — verified (one caller beside its own test)
  • Description: core's press machine marks late inside a scroll view and never past 10 px — reported
  • Description (Scope): public text and artifacts carry no internal context — verified
  • Touch-timeline note: the measured timeline, growth from 150 ms, no growth under Reduce Motion, the 400/735 ms moments, the drift and second-finger rules, the deferred load and the failed-load long press whose popover menu focuses its first item; while a popover menu is up the page stays free to scroll — verified
  • Arena note: the late-deadline waits for a finger or a pen, none for a mouse, and a deadline among coalesced samples runs between them — verified (gesture units, run locally)
  • Outside-press note: a popover menu closes through the layer's outside-press watch, a mouse or pen at its mousedown in the menu's own document — verified (the second-document unit case, run locally)

Files:

  • .changeset/contextmenu-outside-press-watch.md — clear
  • .changeset/contextmenu-touch-timeline.md — clear
  • .changeset/gesture-arena-late-input.md — clear
  • apps/storybook/stories/ContextMenu.stories.tsx — clear
  • docs/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 — clear (owner-approved)
  • internal/eslint-plugin-astryx/no-comment-provenance.baseline.json — clear
  • packages/core/src/ContextMenu/ContextMenu.doc.mjs — clear
  • packages/core/src/ContextMenu/ContextMenu.test.tsx — clear
  • packages/core/src/ContextMenu/ContextMenu.touchLoadFailure.test.tsx — clear
  • packages/core/src/ContextMenu/ContextMenu.triggerProps.test.tsx — clear
  • packages/core/src/ContextMenu/ContextMenu.tsx — clear (non-blocking comment notes)
  • packages/core/src/ContextMenu/ContextMenuTouchGrowth.test.tsx — clear
  • packages/core/src/ContextMenu/ContextMenuTouchLayer.tsx — clear
  • packages/core/src/ContextMenu/ContextMenuTouchLayerProps.test.tsx — clear
  • packages/core/src/ContextMenu/__tests__/ContextMenuLongPress.a11y.chromium.spec.ts — clear
  • packages/core/src/ContextMenu/__tests__/ContextMenuLongPress.interaction.browser.spec.ts — clear
  • packages/core/src/ContextMenu/__tests__/ContextMenuLongPressLink.a11y.chromium.spec.ts — clear
  • packages/core/src/ContextMenu/contextMenuPress.test.ts — clear
  • packages/core/src/ContextMenu/contextMenuPress.ts — clear
  • packages/core/src/ContextMenu/contextMenuPressFeedback.test.tsx — gap: no case lands on content slotted into the trigger
  • packages/core/src/ContextMenu/contextMenuPressFeedback.ts — finding: the onset check gets no trigger, or the outer one, for slotted content
  • packages/core/src/ContextMenu/contextMenuTouchLoader.boundary.test.ts — clear
  • packages/core/src/ContextMenu/contextMenuTouchLoader.ts — clear
  • packages/core/src/Indicator/boxHold.test.tsx — clear
  • packages/core/src/Layer/outsidePress.test.ts — clear
  • packages/core/src/Layer/outsidePress.ts — clear (behavior tag-along note only)
  • packages/core/src/Layer/useLayer.test.tsx — clear
  • packages/core/src/Layer/useLayer.tsx — clear
  • packages/core/src/Table/__tests__/TableCellMenus.a11y.browser.spec.ts — clear
  • packages/core/src/gestures/GestureArena.ts — clear
  • packages/core/src/gestures/GestureHost.ts — clear
  • packages/core/src/gestures/__tests__/GestureHost.test.ts — clear
  • packages/core/src/gestures/__tests__/arena.test.ts — clear
  • packages/core/src/gestures/__tests__/arenaTimersAndClaims.test.ts — clear
  • packages/core/src/gestures/__tests__/harness.ts — clear
  • packages/core/src/gestures/types.ts — clear
  • packages/core/src/hooks/__tests__/MenuPressShadowRoot.a11y.chromium.spec.ts — clear
  • packages/core/src/hooks/usePager.test.ts — clear
  • packages/core/src/motion/README.md — clear
  • packages/core/src/motion/uikit/contextMenu.ts — clear (named by owner-approved lines)
  • packages/core/src/privateAttributes/contextMenuTrigger.stylex.ts — finding: closestContextMenuTrigger never enters a slot
  • packages/lab/src/PageControl/__tests__/PageControl.interaction.browser.spec.ts — clear
  • packages/lab/src/PageControl/__tests__/holdBegin.test.ts — clear
  • packages/lab/src/PageControl/__tests__/holdBegin.ts — clear
  • scripts/shared-identity.baseline.json — clear

Automated review (maintainer link)

vjeux added 2 commits December 2, 2026 05:57
A web component can render a ContextMenu trigger in its shadow root,
around a <slot>, with its own children slotted into the trigger. A
finger held on that slotted content opens the menu, but the trigger
never grows: the trigger lookup climbs the slotted content's own
parents, outside the shadow root, and so never reaches the trigger.
A unit case lands on a control slotted into the trigger. The touch
stories gain a web component card whose label is slotted into the
trigger, and the long-press spec holds a finger on the label and reads
the trigger's growth. Both fail here.
The trigger lookup ran `closest` and then went on from each shadow
root's host, so it climbed the parents an element has in its own
tree. Content slotted into a trigger has its parents outside the
shadow root that holds the trigger, so a finger held on it opened the
menu, but the trigger never grew. The lookup now follows the flat
tree the browser dispatches through, with core's flat-tree parent:
slotted content goes to its slot, and a shadow root to its host. A
landing inside a shadow root in the trigger still finds it.
@cixzhang

cixzhang commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

/approve-spec b337bd9

@astracat-bot astracat-bot Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes requested: the description's line counts and Testing notes from the last review are fixed, and an engineering owner approved the record changes for this head; one thing still blocks.

Required

  • At the head that lands, state in the description the touch-presentation spec's real-device iOS run and its Android runs (Chrome with Gboard in the emulator or on a real Pixel, animations at normal scale and removed, plus a slow-device profile), because the description now says no device ran here and only plans an iOS check on the preview, and this round's change to contextMenuTrigger.stylex.ts keeps earlier runs from carrying over.

A new commit voids the record approval, so an engineering owner comments /approve-spec with the full SHA of the head that lands; the author may do so as an engineering owner.

Non-blocking

  • Layer/outsidePress.ts:281 adds a document mousedown listener in Layer that only ContextMenu uses; the toTriggerLocal name and the Android comment stand, as you said, for a follow-up.
Claims and files checked

Review mode: same-head; reason: none

Changed rules: none since the last review of this revision.

Claims:

  • Title (live): a held finger grows a block trigger on UIKit's lift spring — verified (growth unit cases, run here)
  • The growth starts at the first frame at or after the landing plus 150 ms, toward 1.0735 on the lift spring — verified (the press feedback's onset and spring; unit cases, run here)
  • It returns on the dismiss spring when the hold ends with no menu or the menu closes, and holds while the menu is up — verified (end, release and hold; unit cases, run here)
  • No growth inline, behind a sheet or under Reduce Motion — verified (isShown, the reduced-motion check at the onset)
  • A nested trigger grows alone — verified for light-DOM children, children in a shadow root and content slotted into a trigger (unit cases, run here)
  • An enabled touch-model trigger joins core's press machine — verified (pressableProps under the touch model)
  • The growth scales an inner box, a box once the touch layer has loaded for a block trigger whose menu opens at the finger — verified (growsVisual)
  • The menu's anchor stays on the untransformed trigger — verified (the cursor anchor sits outside the visual)
  • No API change of its own; the omitted presentation follows the touch model and popover keeps the released behavior — verified (one changed default, from the API report an earlier review built on both trees of this same code)
  • A block trigger grows about 7% and its docs ask for room; the motion engine loads with the touch layer — verified (the docs; the touch-loader boundary test, run here)
  • A late frame starts the grow-in from rest; the springs play on the compositor — verified (the animation starts at the frame's own time on the compositor animator)
  • First-load size figures over the touch-hold pull request — reported
  • Simulator results and earlier device runs; no device runs at this head, with an owner iOS check planned on the preview — reported; the device runs are missing (blocking)
  • Testing, this round: a web-component story whose shadow root renders the trigger around a slot, a unit case on a slotted control and a long-press case on the slotted label — verified (story, unit case and browser case present)
  • Testing, this round: the old lookup climbed the slotted label's own parents; the new one follows the flat tree through a slot and out of a shadow root — verified
  • Testing, this round: red-first failures, both engines passing, the preflight, prettier and WebKit counts — reported (the 19-file count is right; the unit cases pass, run here)
  • Testing: this round changes the trigger-mark module, so earlier device runs do not carry — verified
  • Testing, earlier rounds: the shadow-root lookup, and the touch layer reading a cut that a commit or a resize starts — verified
  • Internal API: the trigger-mark module finds the trigger a press belongs to along the flat tree, through a slot and out of a shadow root — verified (a closed shadow root hides its slots from the lookup and from gesture routing alike)
  • Internal API: the growth hook is used only by the touch layer, with the usage line shown — verified
  • Internal API: core's press machine marks late inside a scroll view and never past 10 px — reported
  • Line counts over the touch-hold pull request — verified (all 19 files, figure for figure)
  • Scope: public text and artifacts carry no internal context — verified
  • Touch-timeline release note: the measured timeline, growth from 150 ms, no growth under Reduce Motion, the 400/735 ms moments, the drift and second-finger rules, the deferred load and the failed-load long press whose popover menu focuses its first item; a menu the hold opens lights no row; the page stays free to scroll under a popover menu — verified
  • Arena release note: the late-deadline wait for a finger or a pen, none for a mouse — verified (gesture units, run here)
  • Outside-press release note: a popover menu closes through the layer's outside-press watch, a mouse or pen at its mousedown in the menu's own document — verified (Layer units, run here)

Files:

  • .changeset/contextmenu-outside-press-watch.md — clear
  • .changeset/contextmenu-touch-timeline.md — clear
  • .changeset/gesture-arena-late-input.md — clear
  • apps/storybook/stories/ContextMenu.stories.tsx — clear (slotted-child story)
  • docs/architecture/layer-runtime.md — clear (owner-approved for this head)
  • docs/specs/AST-094-touch-presentations/spec.md — clear (owner-approved for this head)
  • docs/specs/components/ContextMenu/ContextMenu.spec.md — clear (owner-approved for this head)
  • internal/eslint-plugin-astryx/no-comment-provenance.baseline.json — clear
  • packages/core/src/ContextMenu/ContextMenu.doc.mjs — clear
  • packages/core/src/ContextMenu/ContextMenu.test.tsx — clear (passes, run here)
  • packages/core/src/ContextMenu/ContextMenu.touchLoadFailure.test.tsx — clear (passes, run here)
  • packages/core/src/ContextMenu/ContextMenu.triggerProps.test.tsx — clear (passes, run here)
  • packages/core/src/ContextMenu/ContextMenu.tsx — clear (non-blocking comment notes)
  • packages/core/src/ContextMenu/ContextMenuTouchGrowth.test.tsx — clear (passes, run here)
  • packages/core/src/ContextMenu/ContextMenuTouchLayer.tsx — clear
  • packages/core/src/ContextMenu/ContextMenuTouchLayerProps.test.tsx — clear (passes, run here)
  • packages/core/src/ContextMenu/__tests__/ContextMenuLongPress.a11y.chromium.spec.ts — clear (not run here)
  • packages/core/src/ContextMenu/__tests__/ContextMenuLongPress.interaction.browser.spec.ts — clear (slotted case present; not run here)
  • packages/core/src/ContextMenu/__tests__/ContextMenuLongPressLink.a11y.chromium.spec.ts — clear (not run here)
  • packages/core/src/ContextMenu/contextMenuPress.test.ts — clear (passes, run here)
  • packages/core/src/ContextMenu/contextMenuPress.ts — clear
  • packages/core/src/ContextMenu/contextMenuPressFeedback.test.tsx — clear (slotted case passes, run here)
  • packages/core/src/ContextMenu/contextMenuPressFeedback.ts — clear
  • packages/core/src/ContextMenu/contextMenuTouchLoader.boundary.test.ts — clear (passes, run here)
  • packages/core/src/ContextMenu/contextMenuTouchLoader.ts — clear
  • packages/core/src/Indicator/boxHold.test.tsx — clear
  • packages/core/src/Layer/outsidePress.test.ts — clear (passes, run here)
  • packages/core/src/Layer/outsidePress.ts — clear (behavior tag-along note only)
  • packages/core/src/Layer/useLayer.test.tsx — clear (passes, run here)
  • packages/core/src/Layer/useLayer.tsx — clear
  • packages/core/src/Table/__tests__/TableCellMenus.a11y.browser.spec.ts — clear (not run here)
  • packages/core/src/gestures/GestureArena.ts — clear
  • packages/core/src/gestures/GestureHost.ts — clear
  • packages/core/src/gestures/__tests__/GestureHost.test.ts — clear (passes, run here)
  • packages/core/src/gestures/__tests__/arena.test.ts — clear (passes, run here)
  • packages/core/src/gestures/__tests__/arenaTimersAndClaims.test.ts — clear (passes, run here)
  • packages/core/src/gestures/__tests__/harness.ts — clear
  • packages/core/src/gestures/types.ts — clear
  • packages/core/src/hooks/__tests__/MenuPressShadowRoot.a11y.chromium.spec.ts — clear (not run here)
  • packages/core/src/hooks/usePager.test.ts — clear
  • packages/core/src/motion/README.md — clear
  • packages/core/src/motion/uikit/contextMenu.ts — clear (named by owner-approved lines)
  • packages/core/src/privateAttributes/contextMenuTrigger.stylex.ts — clear (the lookup walks the flat tree)
  • packages/core/src/utils/flatTree.ts — clear (header comment only)
  • packages/lab/src/PageControl/__tests__/PageControl.interaction.browser.spec.ts — clear
  • packages/lab/src/PageControl/__tests__/holdBegin.test.ts — clear
  • packages/lab/src/PageControl/__tests__/holdBegin.ts — clear
  • scripts/shared-identity.baseline.json — clear

Automated review (maintainer link)

This branch was successfully deployed

1 active deployment
Preview — b337bd9f Deployed Dec 3, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:run A maintainer lets this outside contributor's pull request run CI (AST-030 FR17) ci:run-a11y Run the accessibility suite on this PR; write access, next push (AST-030 FR12) CLA Signed This label is managed by the Meta Open Source bot. needs:design-review Affects visuals — Design should review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants