Skip to content

fix(menu press): cancel only the lifted finger's touchend - #11164

Merged
cixzhang merged 7 commits into
mainfrom
l0/click-guard-touch-identifier
Nov 12, 2026
Merged

cixzhang merged 7 commits into
mainfrom
l0/click-guard-touch-identifier

Conversation

@cixzhang

@cixzhang cixzhang commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

User impact

When a finger picks a row in a DropdownMenu, ContextMenu, or a menu-press surface (Selector, TabList, TopNav, SideNav, Breadcrumbs), the menu cancels that finger's touchend so the lift does not also click whatever lies under it. Today the click guard cancels the next touchend it sees, whichever finger it belongs to.

After this change, the click guard cancels only the picking finger's touchend once the menu has named the touch, so another finger's touchend passes. The picking finger's own lift is still cancelled. A touchend without changedTouches, or a lift whose touch the menu could not name (its touchstart lists several new touches and none carries the pointer's id, or it came before the pointerdown), keeps the old rule: the next touchend is cancelled.

Problem and solution fit

  • Why does it happen? armClickGuard's touch path cancels the first touchend it sees, without checking which touch ended.
  • Why does it harm the task? The guard's contract is one finger's lift. Cancelling another finger's touchend is outside it, whatever order a browser delivers.
  • Why does it matter? spec:AST-094 FR21 and module:DropdownMenu/useMenuPress FR5: the press model swallows the click of the gesture it tracked, and only that gesture's.

The menu press now reads the finger's Touch.identifier from the touchstart that follows its pointerdown, and passes it to armClickGuard. The guard cancels only a touchend that ends that touch, and stays armed for it when another finger's touchend arrives first. A touchend without changedTouches still counts as the picking finger's own, so engines that omit changedTouches keep today's behaviour.

Expected behavior and authority

  • spec:AST-094 FR21 and module:DropdownMenu/useMenuPress FR5. Specs & Decisions gives a consistency stamp; no record lines change.

Smallest restoration

  • clickGuard.ts: a touchIdentifier option and an endsTouch check.
  • useMenuPress.ts: read the touch identifier from the matching touchstart, and pass it when arming the guard.
  • A [fix] Changeset.

Evidence

  • Red first: with the test commit on main's source, three tests fail:
    • "leaves another finger's touchend alone and cancels the lifted touch's own";
    • "names the touch by its place in the touchstart when its identifier is not the pointer id";
    • "armed with the lifted touch's identifier, leaves another touch's touchend alone and stays armed for its own".
  • Green: clickGuard.test.ts and useMenuPress.test.tsx, 76 passed.

Scope

  • One defect is restored.
  • Separable contradictory or unsettled tagalongs were removed or split.
  • No new public API, visual representation, default, or interaction model is hidden under the bug-fix label.
  • Public text and artifacts contain no internal Meta context.

Testing

  • vitest run packages/core/src/utils/clickGuard.test.ts packages/core/src/hooks/useMenuPress.test.tsx: 76 passed.
  • eslint on the changed files.

Credit

The failing tests and the fix were written by vjeux; both commits keep his authorship.

(Posted by Cindy's agent on her behalf.)

@vercel

vercel Bot commented Nov 11, 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 Nov 12, 2026 5:41pm UTC

Request Review

@astracat-bot

astracat-bot Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 12, 2026, 5:49 PM UTC

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 11, 2026
@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 4ab61c5

Storybook · Sandbox · built from this PR's head

Modified components

Component Size LoC
TabMenu 77.6 kB (+287 B) · 11.5 kB CSS (0) —
TopNavHeading 80.8 kB (+250 B) · 11.6 kB CSS (0) —
BreadcrumbItem 90.4 kB (+211 B) · 12.5 kB CSS (0) —
63 more components
Component Size LoC
PowerSearch 301.3 kB (+204 B) · 24.7 kB CSS (0) —
Selector 105.8 kB (+203 B) · 17.9 kB CSS (0) —
TopNavMenu 80.2 kB (+201 B) · 11.6 kB CSS (0) —
SideNavHeading 81.2 kB (+198 B) · 11.7 kB CSS (0) —
DropdownMenuSubMenu 73.7 kB (+168 B) · 10.1 kB CSS (0) —
MoreMenu 103.1 kB (+165 B) · 17.9 kB CSS (0) —
Table 131.1 kB (+159 B) · 18.7 kB CSS (0) —
Pagination 116.0 kB (+158 B) · 18.2 kB CSS (0) —
TableCell 114.9 kB (+155 B) · 18.3 kB CSS (0) —
ContextMenu 113.7 kB (+151 B) · 17.8 kB CSS (0) —
NavHeadingMenu 18.3 kB (+151 B) · 3.5 kB CSS (0) —
TableHeaderCell 114.5 kB (+151 B) · 18.0 kB CSS (0) —
DropdownMenu 102.9 kB (+144 B) · 17.9 kB CSS (0) —
Markdown 194.1 kB (+143 B) · 21.1 kB CSS (0) —
SideNavItem 75.6 kB (+79 B) · 11.5 kB CSS (0) —
TimeInput 168.7 kB (+78 B) · 16.4 kB CSS (0) —
ComplexSelector 76.3 kB (+73 B) · 12.2 kB CSS (0) —
Switch 108.0 kB (+73 B) · 10.0 kB CSS (0) —
Typeahead 86.3 kB (+69 B) · 12.8 kB CSS (0) —
ChatComposerInput 80.9 kB (+68 B) · 11.7 kB CSS (0) —
ChatComposerTokenElement 80.9 kB (+68 B) · 11.7 kB CSS (0) —
DateTimeInput 217.2 kB (+67 B) · 19.1 kB CSS (0) —
RadioListItem 71.2 kB (+67 B) · 10.4 kB CSS (0) —
Slider 113.6 kB (+67 B) · 8.9 kB CSS (0) —
ChatComposer 83.3 kB (+65 B) · 12.4 kB CSS (0) —
BaseTypeahead 77.1 kB (+64 B) · 11.3 kB CSS (0) —
AlertDialog 109.9 kB (+63 B) · 15.0 kB CSS (0) —
CheckboxListItem 74.9 kB (+63 B) · 11.7 kB CSS (0) —
ListItem 74.1 kB (+63 B) · 11.7 kB CSS (0) —
ChatLayout 87.1 kB (+62 B) · 10.9 kB CSS (0) —
CheckboxInput 68.1 kB (+62 B) · 10.1 kB CSS (0) —
DateInput 194.7 kB (+62 B) · 17.4 kB CSS (0) —
TopNavMegaMenu 74.8 kB (+59 B) · 12.2 kB CSS (0) —
ToggleButtonGroup 41.2 kB (+57 B) · 3.7 kB CSS (0) —
DateRangeInput 97.9 kB (+56 B) · 12.9 kB CSS (0) —
Lightbox 127.9 kB (+56 B) · 10.9 kB CSS (0) —
Tokenizer 102.4 kB (+55 B) · 19.5 kB CSS (0) —
MultiSelector 100.0 kB (+53 B) · 17.2 kB CSS (0) —
SegmentedControl 101.3 kB (+53 B) · 6.9 kB CSS (0) —
ButtonGroup 43.9 kB (+50 B) · 3.7 kB CSS (0) —
ToggleButton 90.8 kB (+50 B) · 10.4 kB CSS (0) —
Toast 102.1 kB (+49 B) · 10.6 kB CSS (0) —
Popover 96.1 kB (+45 B) · 14.6 kB CSS (0) —
BottomSheet 69.9 kB (+28 B) · 7.7 kB CSS (0) —
lab/ChatEmojiPicker 111.4 kB (new) · 773 B CSS (new) —
lab/ChatReactionBar 112.6 kB (new) · 1.1 kB CSS (new) —
lab/ChatVirtualizer 56.7 kB (new) · 223 B CSS (new) —
lab/CommentComposer 157.2 kB (new) · 1.9 kB CSS (new) —
lab/Comments 361.0 kB (new) · 2.5 kB CSS (new) —
lab/CommentThread 354.2 kB (new) · 2.4 kB CSS (new) —
lab/NavigationScreen 84.4 kB (new) · 1.5 kB CSS (new) —
lab/NavigationStack 84.4 kB (new) · 1.5 kB CSS (new) —
lab/PageControl 77.6 kB (new) · 709 B CSS (new) —
lab/Schedule 110.7 kB (new) · 3.9 kB CSS (new) —
lab/TabBar 83.0 kB (new) · 1.8 kB CSS (new) —
lab/TabBarItem 3.9 kB (new) · 1.8 kB CSS (new) —
lab/TabBarMoreList 96.4 kB (new) · 1.8 kB CSS (new) —
lab/TourStep 102.4 kB (new) · 590 B CSS (new) —
lab/TransferList 106.2 kB (new) · 1.2 kB CSS (new) —
lab/TransferListSelector 114.9 kB (new) · 1.4 kB CSS (new) —
richtext/RichTextEditor 302.8 kB (new) · 2.6 kB CSS (new) —
richtext/RichTextEditorToolbar 285.2 kB (new) · 454 B CSS (new) —
richtext/RichTextView 280.5 kB (new) · 2.3 kB CSS (new) —

Package size: measured; main has no measurement of the merge base to compare yet.

API changes: unknown (base surface unavailable): richtext, theme-butter, theme-chocolate, theme-gothic, theme-matcha, theme-neutral, theme-stone, theme-y2k

Not run on this PR: add ci:run-visual or ci:run-rtl to run them.


Generated by PR Enrichment workflow | View full report

@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec bec2ad3

@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: one blocking finding.

  • packages/core/src/hooks/useMenuPress.ts:814 adds its own document touchstart listener, but Core routes document and window input listeners through subscribeInput in packages/core/src/utils/inputStream.ts (architecture:react-component-runtime INV16, and pnpm review:pre flags this line), so subscribe there and stop the subscription at the first touchstart and on detach, as clickGuard.ts already does for its touchend subscription.

The touch-identifier fix itself restores module:DropdownMenu/useMenuPress FR5: the new tests fail on main and pass on this branch. The inline notes on clickGuard.ts stay non-blocking: two comment wordings, and the "names no touches" wording in a comment and the Changeset, which the code applies only when changedTouches is missing. The description's authority line should cite FR5 and spec:AST-094 FR26 rather than FR10.

Automated review (maintainer link)

Comment thread packages/core/src/hooks/useMenuPress.ts Resolved
Comment thread packages/core/src/utils/clickGuard.ts Resolved
Comment thread packages/core/src/utils/clickGuard.ts Resolved
Comment thread packages/core/src/utils/clickGuard.ts Resolved
…tream

The touchstart that names the lifting finger is read through
subscribeInput, as Core's other document and window input is, and the
subscription stops at the first touchstart and on detach. The guard's
comment and the changeset say a touchend without a list of changed
touches counts as the finger's own.
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec c2be3b6

@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.

Approved pending CI: CI has not run on this head yet.

The touchstart read now goes through subscribeInput, which resolves the earlier blocking finding, and the touch-identifier fix restores module:DropdownMenu/useMenuPress FR5: the new tests fail on the base and pass on this branch.

Optional, non-blocking:

  • packages/core/src/utils/clickGuard.ts:33-34: keep the two original header sentences together so "otherwise" still refers to the cancelled touchend, and add the identifier sentence after them.
  • packages/core/src/utils/clickGuard.ts:163: "its click" holds only once the guard disarms; "Another finger lifted: leave its touchend." says what the code does.
  • The description's authority line could cite FR5 and spec:AST-094 FR21 and FR26 rather than FR10.

Automated review (maintainer link)

@cixzhang cixzhang added 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) labels Nov 11, 2026
@cixzhang
cixzhang marked this pull request as ready for review November 11, 2026 14:31

@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: one blocking finding. The guard change itself works as described: red-first tests back it, and CI is green at this head.

  • Miss: the changeset (.changeset/menu-press-touch-identifier.md) and the description say another finger's tap was lost and the picking finger then made a stray click, but only a synthetic jsdom event order shows this (in Chromium each finger's touchend directly follows its own pointerup, no click is raised while two fingers are down, and in the order described the guard would still swallow the other finger's click), so please state the guarantee instead, for example "when a finger picks a menu row, the menu cancels only that finger's touchend, so a touchend from another finger is never cancelled", and drop the lost-tap and stray-click sentence.

Non-blocking: the comment at clickGuard.ts:163 says the other finger's click is its own, but while the guard waits it still swallows that click. The description cites spec:AST-094 FR10, while FR21 and the useMenuPress module's FR5 govern this change.

Automated review (maintainer link)

… guard does

The changeset states the guarantee (the guard cancels only the picking
finger's touchend) instead of a lost tap and a stray click that only a
synthetic event order shows. Two clickGuard comments now say what the
guard does while it waits.
@cixzhang
cixzhang marked this pull request as draft November 11, 2026 18:08
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec bd97219

@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: one blocking finding, a wording fix in the description. The guard change itself works as described: the new tests fail on the base and pass on this head, and a real finger tap in Chromium still cancels the pick's own touchend.

  • Newly live check: the description says "A touchend that lists no touches still counts as the picking finger's own", but endsTouch (packages/core/src/utils/clickGuard.ts, lines 186-192) counts only a missing changedTouches as the pick's own and treats an empty list as another finger's, so please write "A touchend without changedTouches" as the Changeset and the JSDoc already do, and use the same words in the test title at clickGuard.test.ts:309, or make an empty list count as the touch's own in code.

Approval also waits for CI: CI has not run on this head because the pull request is a draft, and it runs once the pull request is marked ready for review.

Claims and files checked
  • Changeset, "the click guard cancels only that finger's touchend, so a touchend from another finger is never cancelled": verified (clickGuard.ts:162-173, useMenuPress.test.tsx:667, clickGuard.test.ts:300).
  • Changeset, the listed surfaces (DropdownMenu, ContextMenu, Selector, TabList, TopNav, SideNav, Breadcrumbs): verified, each uses the menu press hook.
  • Changeset, "reads the finger's identifier from the touchstart that follows its pointerdown": verified (useMenuPress.ts:732-747).
  • Changeset, "a touchend without changedTouches still counts as the picking finger's": verified (clickGuard.ts:188-190, clickGuard.test.ts:309).
  • Description, today the guard cancels the next touchend whichever finger it belongs to: verified (base clickGuard.ts:145-164).
  • Description, the picking finger's own lift is still cancelled: verified (useMenuPress.test.tsx:667; Chromium tap).
  • Description, spec:AST-094 FR21 and module:DropdownMenu/useMenuPress FR5 govern: verified.
  • Description, the identifier is passed to armClickGuard, which stays armed when another finger's touchend comes first: verified (useMenuPress.ts:620-637, clickGuard.test.ts:300-307).
  • Description, "a touchend that lists no touches still counts as the picking finger's own": false (clickGuard.ts:186-192).
  • Description, no record lines change: verified (no record in the diff).
  • Description, red first with three named failing tests, then 76 passing: verified.
  • Description, eslint on the changed files: verified.
  • Description, no new public API, visual representation, default or interaction model: verified (no API rows; identical frames).
  • Description, the failing tests and the fix keep vjeux's authorship: verified.
  • Files: .changeset/menu-press-touch-identifier.md clear; packages/core/src/utils/clickGuard.ts clear; packages/core/src/utils/clickGuard.test.ts test title wording (above); packages/core/src/hooks/useMenuPress.ts clear; packages/core/src/hooks/useMenuPress.test.tsx clear.

Automated review (maintainer link)

@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 8720b0d

@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.

Approval waits for CI: the required checks were skipped on this head because the pull request is a draft.

No blocking finding: the guard change does what the description and the Changeset say, and the new tests cover both another finger's touchend and the pick's own.

Next step: mark the pull request ready for review so CI runs on this head.

Claims and files checked
  • Claim, Changeset package and bump ('@astryxdesign/core': patch): verified; every changed source file is in packages/core.
  • Claim, DropdownMenu, ContextMenu, Selector, TabList, TopNav, SideNav and Breadcrumbs pick through the menu press model: verified (DropdownMenu.tsx:1477, ContextMenu.tsx:771, Selector.tsx:1753, TabMenu.tsx:318, TopNavMenu.tsx:468, SideNavHeading.tsx:445, BreadcrumbItem.tsx:590).
  • Claim, the guard cancels only the picking finger's touchend, another finger's is not cancelled, and the pick's own still is: verified (clickGuard.ts:161-173; useMenuPress.test.tsx:667-676).
  • Claim, the menu reads the identifier from the touchstart after its pointerdown and passes it to armClickGuard: verified (useMenuPress.ts:732-746, :620-637).
  • Claim, the guard stays armed for the pick's touch when another finger's touchend arrives first: verified (clickGuard.ts:162-165; clickGuard.test.ts:300-307).
  • Claim, a touchend without changedTouches still counts as the picking finger's own: verified (clickGuard.ts:186-190; clickGuard.test.ts:309-314).
  • Claim, today the guard cancels the next touchend it sees, whichever finger it belongs to: verified at the base (clickGuard.ts:145-164).
  • Claim, spec:AST-094 FR21 and module:DropdownMenu/useMenuPress FR5 govern the change and no record lines change: verified; no record file is in the diff.
  • Claim, smallest restoration (the option and endsTouch, the identifier read and passed, a [fix] Changeset): verified.
  • Claim, red first, the three named tests fail on the base source: verified from the base guard, which has no identifier check; the fourth new test passes there.
  • Claim, 76 tests pass and eslint is clean on the changed files: the two test files hold 76 cases; not yet shown at this head, since CI has not run.
  • Claim, scope (one defect, no tag-along, no new public API, default or interaction model, no internal context in public text): verified.
  • Claim, the test and fix commits keep their original author: verified from the commit history.
  • File, .changeset/menu-press-touch-identifier.md: clear.
  • File, packages/core/src/utils/clickGuard.ts: clear.
  • File, packages/core/src/hooks/useMenuPress.ts: clear.
  • File, packages/core/src/utils/clickGuard.test.ts: clear.
  • File, packages/core/src/hooks/useMenuPress.test.tsx: clear.

Automated review (maintainer link)

@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.

Approved pending CI: CI has not run on this head yet, because the pull request is still a draft.

The guard change does what the description and the Changeset say: only the picking finger's touchend is cancelled, another finger's passes, and the new tests cover both another finger's touchend and the pick's own. There is no blocking finding.

Next step: mark the pull request ready for review so CI runs on this head.

Claims and files checked
  • Claim, patch bump for @astryxdesign/core: verified; every changed source file is in packages/core.
  • Claim, DropdownMenu, ContextMenu, Selector, TabList, TopNav, SideNav and Breadcrumbs pick through the menu press model: verified (DropdownMenu.tsx:1477, ContextMenu.tsx:771, Selector.tsx:1753, TabMenu.tsx:318, TopNavMenu.tsx:468, SideNavHeading.tsx:445, BreadcrumbItem.tsx:590).
  • Claim, today the guard cancels the next touchend it sees, whichever finger it belongs to: verified at the base (clickGuard.ts:145-163 there).
  • Claim, the guard now cancels only the picking finger's touchend, another finger's is not cancelled, and the pick's own still is: verified (clickGuard.ts:161-174; useMenuPress.test.tsx:667-676).
  • Claim, the menu reads the identifier from the touchstart after its pointerdown and passes it when arming the guard: verified (useMenuPress.ts:732-746, :620-637).
  • Claim, the guard stays armed for the pick's touch when another finger's touchend arrives first: verified (clickGuard.ts:162-165; clickGuard.test.ts:300-307).
  • Claim, a touchend without changedTouches still counts as the picking finger's own: verified (clickGuard.ts:186-192; clickGuard.test.ts:309-314).
  • Claim, the touch-presentation and menu-press records' click rules govern the change, the spec check passes, and no record line changes: verified; no record file is in the diff.
  • Claim, smallest restoration (the option and its check, the identifier read and passed, a [fix] Changeset): verified.
  • Claim, red first, the three named tests fail on the base source: verified from the base guard, which has no identifier check; the fourth new test passes there.
  • Claim, 76 tests pass and eslint is clean on the changed files: the two test files hold 76 cases; the run itself is pending CI.
  • Claim, scope (one defect, no tag-along, no new public API, default or interaction model, no internal context in public text): verified.
  • Claim, the test and fix commits keep their original author: verified from the commit history.
  • File, .changeset/menu-press-touch-identifier.md: clear.
  • File, packages/core/src/utils/clickGuard.ts: clear.
  • File, packages/core/src/hooks/useMenuPress.ts: clear.
  • File, packages/core/src/utils/clickGuard.test.ts: clear.
  • File, packages/core/src/hooks/useMenuPress.test.tsx: clear.

Automated review (maintainer link)

@cixzhang
cixzhang marked this pull request as ready for review November 12, 2026 00:27

@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: one blocking finding, a wording fix in the Changeset and the description. The guard change itself works as described once the menu has named the picking touch, and the new tests pass in CI.

  • Miss: the Changeset and the description say another finger's touchend is never cancelled, but when the menu cannot name the picking touch (its touchstart lists several new touches and none carries the pointer's id, or it arrives before the pointerdown), touchOfPointer returns null and the guard still cancels the next touchend of any finger (useMenuPress.ts:212, clickGuard.ts:162), so the text should say the old rule applies then.

Suggested wording is in the inline comment on the Changeset; the two comment-wording notes are optional.

Claims and files checked
  • Claim, patch bump for @astryxdesign/core: verified; every changed source file is in packages/core.
  • Claim, DropdownMenu, ContextMenu, Selector, TabList, TopNav, SideNav and Breadcrumbs pick through the menu press model: verified (DropdownMenu.tsx:1477, ContextMenu.tsx:771, Selector.tsx:1753, TabMenu.tsx:318, TopNavMenu.tsx:468, SideNavHeading.tsx:445, BreadcrumbItem.tsx:590).
  • Claim, today the guard cancels the next touchend it sees, whichever finger it belongs to: verified at the base (clickGuard.ts:145-163 there).
  • Claim, the guard now cancels only the picking finger's touchend, so another finger's is never cancelled: false when the menu could not name the touch (useMenuPress.ts:212, clickGuard.ts:162).
  • Claim, the picking finger's own lift is still cancelled: verified (clickGuard.ts:166-173; useMenuPress.test.tsx:667-676).
  • Claim, the menu reads the identifier from the touchstart after its pointerdown and passes it when arming the guard: verified (useMenuPress.ts:732-746, :620-637).
  • Claim, the guard stays armed for the pick's touch when another finger's touchend arrives first: verified (clickGuard.ts:162-165; clickGuard.test.ts:300-307).
  • Claim, a touchend without changedTouches still counts as the picking finger's own: verified (clickGuard.ts:186-192; clickGuard.test.ts:309-314).
  • Claim, the touch-presentation and menu-press click rules govern the change and no record line changes: verified; no record file is in the diff.
  • Claim, smallest restoration (the option and its check, the identifier read and passed, a [fix] Changeset): verified.
  • Claim, red first, the three named tests fail on the base source: verified by reading the base guard, which has no identifier check; the fourth new test passes there.
  • Claim, 76 tests pass in the two test files and eslint is clean: the two files hold 76 cases at this head, and both files and lint pass in CI.
  • Claim, scope (one defect, no tag-along, no new public API, default or interaction model, no internal context in public text): verified.
  • Claim, both commits keep their original author: verified from the commit history.
  • File, .changeset/menu-press-touch-identifier.md: the blocking finding.
  • File, packages/core/src/utils/clickGuard.ts: clear; one optional comment-wording note.
  • File, packages/core/src/hooks/useMenuPress.ts: clear; one optional comment-wording note.
  • File, packages/core/src/utils/clickGuard.test.ts: clear.
  • File, packages/core/src/hooks/useMenuPress.test.tsx: clear.

Automated review (maintainer link)

Comment thread packages/core/src/utils/clickGuard.ts Resolved
Comment thread packages/core/src/hooks/useMenuPress.ts Resolved
… touchend passes

Once the menu names the picking touch, another finger's touchend passes. A
touchend without changedTouches, or a lift whose touch the menu could not
name, keeps the old rule. Two comments reworded.
@cixzhang
cixzhang marked this pull request as draft November 12, 2026 01:53
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec f598827

@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.

Approved pending CI: the required test check has not passed on this head, because one Node test shard timed out twice in the setup hook of a CLI test (text-json-parity, experimental theme editor new) that this pull request does not touch. The next step is a green re-run of that shard.

The guard change does what the Changeset and the description say: once the menu has named the picking touch, only that touch's touchend is cancelled, another finger's passes, and a touch it could not name keeps the next-touchend rule. One optional comment-wording suggestion on clickGuard.ts is still open inline.

Claims and files checked
  • Claim, a patch bump for @astryxdesign/core: verified; every changed source file is in packages/core.
  • Claim, DropdownMenu, ContextMenu, Selector, TabList, TopNav, SideNav and Breadcrumbs pick through the menu press: verified (DropdownMenu.tsx:1477, ContextMenu.tsx:771, Selector.tsx:1753, TabMenu.tsx:318, TopNavMenu.tsx:468, SideNavHeading.tsx:445, BreadcrumbItem.tsx:590).
  • Claim, today the guard cancels the next touchend it sees, whichever finger it belongs to: verified; the base guard's touchend subscriber has no touch check.
  • Claim, once the menu has named the touch, only that finger's touchend is cancelled and another finger's passes: verified (clickGuard.ts:163-166; useMenuPress.test.tsx:667-685; clickGuard.test.ts:300-307).
  • Claim, the picking finger's own lift is still cancelled: verified (clickGuard.ts:167-174).
  • Claim, the menu names the touch from the touchstart after its pointerdown and passes it when arming the guard: verified (useMenuPress.ts:732-746, :620-637).
  • Claim, the guard stays armed for the picking touch when another finger's touchend arrives first: verified (clickGuard.test.ts:300-307).
  • Claim, a touchend without changedTouches keeps the next-touchend rule: verified (clickGuard.ts:187-191; clickGuard.test.ts:309-314).
  • Claim, a lift whose touch the menu could not name keeps the next-touchend rule: verified (useMenuPress.ts:201-213 names none for several new touches without the pointer's id; a touchstart before the pointerdown is never read, since the read starts at :732; :623 and :636 then pass none).
  • Claim, the touch-presentation and menu-press click rules govern the change and no record line changes: verified; no record file is in the diff.
  • Claim, smallest restoration (the option and its check, the identifier read and passed, a fix Changeset): verified.
  • Claim, red first, the three named tests fail on the base source: verified from the base guard, which cancels and disarms on the first touchend, so the three cases' expected pass of another finger's touchend fails; the fourth new case passes on both.
  • Claim, the two test files pass with 76 cases: verified; the head files hold 76 cases (17 and 59), and CI ran both files on this head merged with main and they passed.
  • Claim, eslint is clean on the changed files: verified; Lint passed on this head.
  • Claim, scope (one defect, no tag-along, no new public API, default or interaction model, no internal context in public text): verified; the API change report for this head lists no rows.
  • Claim, both original commits keep their author: verified from the commit history.
  • File, .changeset/menu-press-touch-identifier.md: clear.
  • File, packages/core/src/utils/clickGuard.ts: clear; one optional comment-wording suggestion.
  • File, packages/core/src/hooks/useMenuPress.ts: clear.
  • File, packages/core/src/utils/clickGuard.test.ts: clear.
  • File, packages/core/src/hooks/useMenuPress.test.tsx: clear.

Automated review (maintainer link)

Comment on lines +34 to +36
// when a drill-in has put another row under the finger. When the menu names
// the touch by its identifier, another finger's `touchend` passes; a touch it
// could not name keeps the old rule, and the next `touchend` is cancelled.

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.

Non-blocking (comment wording): the new sentence runs to 29 words, carries two topics and ends in the passive. Suggest:

// when a drill-in has put another row under the finger. When the menu names
// the touch, the guard cancels only that touch's `touchend`. Without a name,
// it cancels the next `touchend`.

@cixzhang
cixzhang marked this pull request as ready for review November 12, 2026 05:58
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 4ab61c5

@cixzhang
cixzhang marked this pull request as draft November 12, 2026 17:33
@cixzhang
cixzhang marked this pull request as ready for review November 12, 2026 17:33

@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.

Approved pending CI: the required checks are still running on this head.

The click guard now cancels only the picking finger's touchend once the menu has named the touch, every unnamed case keeps the previous rule, and the new unit cases, the Changeset and the description agree with the code.

  • Non-blocking: the added header sentence in clickGuard.ts (lines 34-36) runs long and mixes two topics; the open inline comment there suggests a shorter wording.
Claims and files checked
  • Verified: a finger's pick in DropdownMenu, ContextMenu, Selector, TabList, TopNav, SideNav and Breadcrumbs menus cancels that finger's touchend (useMenuPress.ts:668-672; each surface renders the menu press).
  • Verified: before this change the guard cancelled the next touchend of any finger (base clickGuard.ts:145-164).
  • Verified: once the touch is named, only its touchend is cancelled and another finger's passes (clickGuard.ts:163-174, clickGuard.test.ts:300-307, useMenuPress.test.tsx:774-783).
  • Verified: the guard stays armed for the named touch when another finger's touchend comes first (clickGuard.ts:163-166, clickGuard.test.ts:303-304).
  • Verified: a touchend without changedTouches keeps the next-touchend rule (clickGuard.ts:187-191, clickGuard.test.ts:309-314).
  • Verified: a lift whose touch the menu could not name (several new touches without the pointer's id, or a touchstart before the pointerdown) keeps the next-touchend rule (useMenuPress.ts:297-304, :800).
  • Verified: the menu names the touch from the touchstart that follows its pointerdown (useMenuPress.ts:804-813).
  • Verified: the identifier is passed at both places the menu arms the guard (useMenuPress.ts:671, :703).
  • Verified: no spec record changes (no record in the diff).
  • Verified: the fix is a touchIdentifier option with an endsTouch check, the identifier read and pass in the menu press, and a fix Changeset (the five changed files).
  • Verified: with the new tests on the base source, three tests fail (the base subscriber has no touch check; the fourth new case passes on the base).
  • Verified for the menu press file: useMenuPress.test.tsx passes in CI at this head with 79 tests (the stated 76 predates the merge of main); the CI shard that runs clickGuard.test.ts was still running.
  • Verified: lint passes on the changed files (CI lint at this head).
  • Verified: one defect, no new public API (the option's module is not exported), and no internal context.
  • Verified: the failing tests and the fix keep vjeux's authorship (the first two commits).
  • Verified: the Changeset's component list and its named and unnamed rules match the code.
  • .changeset/menu-press-touch-identifier.md: clear.
  • packages/core/src/utils/clickGuard.ts: clear, one non-blocking wording suggestion at lines 34-36.
  • packages/core/src/utils/clickGuard.test.ts: clear.
  • packages/core/src/hooks/useMenuPress.ts: clear.
  • packages/core/src/hooks/useMenuPress.test.tsx: clear.

Automated review (maintainer link)

This branch was successfully deployed

1 active deployment
Preview — 4ab61c5b Deployed Nov 12, 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants