Repository navigation
fix(menu press): cancel only the lifted finger's touchend - #11164
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report🔎 Preview ·
|
| 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
|
/approve-spec bec2ad3 |
There was a problem hiding this comment.
Changes requested: one blocking finding.
packages/core/src/hooks/useMenuPress.ts:814adds its own documenttouchstartlistener, but Core routes document and window input listeners throughsubscribeInputinpackages/core/src/utils/inputStream.ts(architecture:react-component-runtimeINV16, andpnpm review:preflags this line), so subscribe there and stop the subscription at the firsttouchstartand on detach, asclickGuard.tsalready does for itstouchendsubscription.
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.
…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.
|
/approve-spec c2be3b6 |
There was a problem hiding this comment.
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 cancelledtouchend, 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-094FR21 and FR26 rather than FR10.
There was a problem hiding this comment.
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'stouchenddirectly follows its ownpointerup, 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'stouchend, so atouchendfrom 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.
… 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.
|
/approve-spec bd97219 |
There was a problem hiding this comment.
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
touchendthat lists no touches still counts as the picking finger's own", butendsTouch(packages/core/src/utils/clickGuard.ts, lines 186-192) counts only a missingchangedTouchesas the pick's own and treats an empty list as another finger's, so please write "AtouchendwithoutchangedTouches" as the Changeset and the JSDoc already do, and use the same words in the test title atclickGuard.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 atouchendfrom 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
touchstartthat follows itspointerdown": verified (useMenuPress.ts:732-747). - Changeset, "a
touchendwithoutchangedTouchesstill counts as the picking finger's": verified (clickGuard.ts:188-190,clickGuard.test.ts:309). - Description, today the guard cancels the next
touchendwhichever finger it belongs to: verified (baseclickGuard.ts:145-164). - Description, the picking finger's own lift is still cancelled: verified (
useMenuPress.test.tsx:667; Chromium tap). - Description,
spec:AST-094FR21 andmodule:DropdownMenu/useMenuPressFR5 govern: verified. - Description, the identifier is passed to
armClickGuard, which stays armed when another finger'stouchendcomes first: verified (useMenuPress.ts:620-637,clickGuard.test.ts:300-307). - Description, "a
touchendthat 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.mdclear;packages/core/src/utils/clickGuard.tsclear;packages/core/src/utils/clickGuard.test.tstest title wording (above);packages/core/src/hooks/useMenuPress.tsclear;packages/core/src/hooks/useMenuPress.test.tsxclear.
…he code and the changeset do
|
/approve-spec 8720b0d |
There was a problem hiding this comment.
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 inpackages/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
touchstartafter itspointerdownand passes it toarmClickGuard: verified (useMenuPress.ts:732-746,:620-637). - Claim, the guard stays armed for the pick's touch when another finger's
touchendarrives first: verified (clickGuard.ts:162-165;clickGuard.test.ts:300-307). - Claim, a
touchendwithoutchangedTouchesstill counts as the picking finger's own: verified (clickGuard.ts:186-190;clickGuard.test.ts:309-314). - Claim, today the guard cancels the next
touchendit sees, whichever finger it belongs to: verified at the base (clickGuard.ts:145-164). - Claim,
spec:AST-094FR21 andmodule:DropdownMenu/useMenuPressFR5 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.
There was a problem hiding this comment.
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 inpackages/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
touchendit sees, whichever finger it belongs to: verified at the base (clickGuard.ts:145-163there). - 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
touchstartafter itspointerdownand 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
touchendarrives first: verified (clickGuard.ts:162-165;clickGuard.test.ts:300-307). - Claim, a
touchendwithoutchangedTouchesstill 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.
There was a problem hiding this comment.
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
touchendis never cancelled, but when the menu cannot name the picking touch (itstouchstartlists several new touches and none carries the pointer's id, or it arrives before thepointerdown),touchOfPointerreturnsnulland the guard still cancels the nexttouchendof 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 inpackages/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
touchendit sees, whichever finger it belongs to: verified at the base (clickGuard.ts:145-163there). - 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
touchstartafter itspointerdownand 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
touchendarrives first: verified (clickGuard.ts:162-165;clickGuard.test.ts:300-307). - Claim, a
touchendwithoutchangedTouchesstill 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.
… 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.
|
/approve-spec f598827 |
There was a problem hiding this comment.
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 inpackages/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
touchendit sees, whichever finger it belongs to: verified; the base guard'stouchendsubscriber has no touch check. - Claim, once the menu has named the touch, only that finger's
touchendis 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
touchstartafter itspointerdownand 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
touchendarrives first: verified (clickGuard.test.ts:300-307). - Claim, a
touchendwithoutchangedToucheskeeps the next-touchendrule: verified (clickGuard.ts:187-191;clickGuard.test.ts:309-314). - Claim, a lift whose touch the menu could not name keeps the next-
touchendrule: verified (useMenuPress.ts:201-213names none for several new touches without the pointer's id; atouchstartbefore thepointerdownis never read, since the read starts at:732;:623and:636then 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'stouchendfails; 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
mainand 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.
| // 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. |
There was a problem hiding this comment.
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`.|
/approve-spec 4ab61c5 |
There was a problem hiding this comment.
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
touchendof any finger (baseclickGuard.ts:145-164). - Verified: once the touch is named, only its
touchendis 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
touchendcomes first (clickGuard.ts:163-166,clickGuard.test.ts:303-304). - Verified: a
touchendwithoutchangedToucheskeeps the next-touchendrule (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
touchstartbefore thepointerdown) keeps the next-touchendrule (useMenuPress.ts:297-304,:800). - Verified: the menu names the touch from the
touchstartthat follows itspointerdown(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
touchIdentifieroption with anendsTouchcheck, 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.tsxpasses in CI at this head with 79 tests (the stated 76 predates the merge ofmain); the CI shard that runsclickGuard.test.tswas 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.
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
touchendso the lift does not also click whatever lies under it. Today the click guard cancels the nexttouchendit sees, whichever finger it belongs to.After this change, the click guard cancels only the picking finger's
touchendonce the menu has named the touch, so another finger'stouchendpasses. The picking finger's own lift is still cancelled. AtouchendwithoutchangedTouches, or a lift whose touch the menu could not name (itstouchstartlists several new touches and none carries the pointer's id, or it came before thepointerdown), keeps the old rule: the nexttouchendis cancelled.Problem and solution fit
armClickGuard's touch path cancels the firsttouchendit sees, without checking which touch ended.touchendis outside it, whatever order a browser delivers.spec:AST-094FR21 andmodule:DropdownMenu/useMenuPressFR5: 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.identifierfrom thetouchstartthat follows itspointerdown, and passes it toarmClickGuard. The guard cancels only atouchendthat ends that touch, and stays armed for it when another finger'stouchendarrives first. AtouchendwithoutchangedTouchesstill counts as the picking finger's own, so engines that omitchangedToucheskeep today's behaviour.Expected behavior and authority
spec:AST-094FR21 andmodule:DropdownMenu/useMenuPressFR5. Specs & Decisions gives a consistency stamp; no record lines change.Smallest restoration
clickGuard.ts: atouchIdentifieroption and anendsTouchcheck.useMenuPress.ts: read the touch identifier from the matchingtouchstart, and pass it when arming the guard.[fix]Changeset.Evidence
main's source, three tests fail:clickGuard.test.tsanduseMenuPress.test.tsx, 76 passed.Scope
Testing
vitest run packages/core/src/utils/clickGuard.test.ts packages/core/src/hooks/useMenuPress.test.tsx: 76 passed.Credit
The failing tests and the fix were written by vjeux; both commits keep his authorship.
(Posted by Cindy's agent on her behalf.)