Skip to content

fix(Item): an open swipe row closes on a tap on its content or a scroll - #8132

Closed
vjeux wants to merge 1742 commits into
meta:mainfrom
vjeux:uikit/c12-swipe-dismiss
Closed

vjeux wants to merge 1742 commits into
meta:mainfrom
vjeux:uikit/c12-swipe-dismiss

Conversation

@vjeux

@vjeux vjeux commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Depends on #8097. Review only this PR's change: vjeux/astryx@7fb1ae9...536a023

Why

On an open swipe-action row (Item, ListItem), tapping the content fired the row's primary action, often navigating away, and scrolling left the row open with Delete exposed. UIKit closes the row in both cases.

What led to it

Part of a series bringing Astryx's touch interactions to parity with native iOS (UIKit). An open row only watched for pointers landing outside it.

Options and tradeoffs

  1. Count a tap on the content as outside: the row closes, but the tap still navigates, which UIKit never does.
  2. While the row is open, a tap recognizer on its content takes the tap and its click and closes the row; any scroll holding the row closes it too, except while focus is inside, since the browser may be scrolling a focused button into view (chosen).

Owner decision proposed: amend spec:AST-057 FR7 so a resting row also closes on a tap on its content (activating nothing) and on a scroll of anything holding it.

Not covered: a tap on another row closes this one but still reaches that row; UIKit swallows it.

Why this choice

It matches UIKit rows recorded on iOS 26.2 (the tap closes after the lift, unhighlighted; a scroll closes as it starts) and stops an accidental tap from navigating.

How to check it

On a phone, open the Item story "Swipe Actions":

  1. Open a row, then tap its text: it closes; nothing highlights or navigates.
  2. Open a row, then scroll the page: it closes as the scroll starts.
  3. Open a row, then tap one of its buttons: that action fires.
  4. Tap a closed row: it activates as before.
  5. Tap a row while it is still springing open: it closes.

We ran these with real touch in Chromium and on the iOS 26.2 simulator and the Android 15 emulator; each behaved as listed (recordings below). The unit tests and the Chromium and WebKit browser tests pass.

Evidence

iOS 26.2 Safari, main above: after a tap and during a scroll, main's row stays open; this change's closes.

Chromium, real touch: the tapped open row closes, unhighlighted.

Android 15: a tap on the open row's content closes it and clicks nothing; scrolling closes it.

Item's import grows from 42.0 to 42.9 KB gzip; the story keeps main's 237 elements. Known red until #8671 merges: its touch-bundle check, which a gesture-using Item fails by design.

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.

@vercel

vercel Bot commented Oct 24, 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 Oct 29, 2026 10:39pm UTC

Request Review

@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Oct 24, 2026
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 24, 2026
@astracat-bot

astracat-bot Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

AI review status for this pull request.

Review status Updated
❓ Needs maintainer input (for maintainers only) Oct 30, 2026, 5:26 AM UTC

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This needs an engineering owner's decision before it can be approved: the dismissal tap, the scroll close and counting a settling row as open extend spec:AST-057 FR7 through an amendment the PR body calls pending but that is not yet in the spec, and the tap conflicts with AR3, which keeps the row's primary activation unchanged. An engineering owner (the author can act as one) approves, amends or rejects those rules by writing them into AST-057, and the draft AST-094 and Item.spec.md requirements this compare also carries are approved by an engineering owner commenting /approve-spec followed by the full head SHA. Independently, please rebase onto main once #8097 and its predecessors land so this PR's diff is its own 313-line commit rather than 28,264 lines, and amend AST-057 FR2 and FR5 (or conform the release rule) in the predecessor that changes them.

  • AST-094 FR7 and its related-records list cite spec:AST-090, which does not exist in the repository.

[Automated review]

new TapGestureRecognizer({
allowedPointerTypes: ['touch'],
name: 'item-swipe-dismiss',
shouldReceiveTouch: (_tap, touch) =>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

While the row is open this recognizer takes every touch tap on the row's content and cancels its click, so the row's onClick or href cannot fire by touch until the row closes. spec:AST-057 AR3 says swipeActions MUST NOT change the primary element's activation, and FR7 does not list a tap on the row's own content among the closing events. The FR7 amendment the PR body mentions needs to land in AST-057, with an owner ruling on AR3, before this can be approved.

if (behavior === 'commit') {
return 'closed';
}
if (velocity >= swipeActions.releaseVelocity) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

spec:AST-057 FR5 requires a fling to fire the outermost entry, under both reveal and commit; this rule never fires on a flick short of the commit point. Either amend FR5 with owner approval or conform the release rule.

follows.
- **FR7 — Exits animate as UIKit's do.** A touch presentation MUST play the
exit its UIKit counterpart plays. **Proposed; pending owner review:** this
departs from the draft `spec:AST-090` FR1 (exits off by default) and FR10

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

There is no spec:AST-090 in the repository, at this head or on main, so this departure note points at nothing an owner can read. Cite the record by an id that resolves, or drop the note until that record lands.

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This needs an engineering owner's decision before it can be approved: closing an open swipe row on a tap on its own content (which then activates nothing), on a scroll of anything containing it, and while it is still settling open extends spec:AST-057 FR7 through an amendment the PR body calls pending, and the tap conflicts with AR3, which keeps the row's primary activation unchanged. An engineering owner approves, amends or rejects those three rules by writing the decision into AST-057 and commenting /approve-spec <full head SHA> on this pull request, which also covers the draft spec:AST-094 and the Item.spec.md requirements this compare carries; the author may do so as an engineering owner. Independently, please rebase onto main once #8097 and its predecessors land so this diff is its own 313-line commit rather than 28,292 lines, and amend AST-057 FR2 and FR5 (or conform the release rule) in the predecessor that changes them.

  • AST-094 FR7 and its related-records list cite spec:AST-090, which does not exist in the repository.

[Automated review]

@github-actions

github-actions Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

📚 Storybook Preview

View Storybook for this PR

🧪 Sandbox Preview

View Sandbox for this PR

Modified Components

Item (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Entry File (ESM) 284B 284B 0B
Lines of Code 1372 1526 -
Complexity Very High Very High (109) -

Component Size

Component Import before Import after Delta CSS before CSS after Delta
core/AlertDialog 56.9KB 57.2KB +294B 12.4KB 12.4KB 0B
core/AppShell 57.9KB 58.1KB +242B 11.6KB 11.6KB 0B
core/AvatarGroupOverflow 39.9KB 40.2KB +303B 6.4KB 6.4KB 0B
core/Banner 47.8KB 48.1KB +289B 9.9KB 9.9KB 0B
core/BaseTypeahead 54.3KB 54.6KB +251B 9.9KB 9.9KB 0B
core/BreadcrumbItem 66.4KB 97.6KB +31.2KB ⚠️ 11.0KB 11.0KB -46B
core/Button 43.3KB 43.5KB +273B 9.2KB 9.2KB 0B
core/Calendar 54.9KB 55.2KB +290B 10.0KB 10.0KB 0B
core/Carousel 50.2KB 50.5KB +316B 10.2KB 10.2KB 0B
core/ChatComposer 60.6KB 60.9KB +270B 10.8KB 10.8KB 0B
core/ChatComposerInput 55.7KB 56.0KB +264B 10.1KB 10.1KB 0B
core/ChatComposerTokenElement 55.7KB 56.0KB +264B 10.1KB 10.1KB 0B
core/ChatDictationButton 46.5KB 46.8KB +264B 9.5KB 9.5KB 0B
core/ChatLayout 48.8KB 49.1KB +273B 9.9KB 9.9KB 0B
core/ChatLayoutScrollButton 46.4KB 46.6KB +255B 9.6KB 9.6KB 0B
core/ChatSendButton 45.8KB 46.1KB +265B 9.2KB 9.2KB 0B
core/CheckboxInput 49.9KB 50.2KB +273B 9.3KB 9.3KB 0B
core/CheckboxListItem 54.0KB 85.0KB +31.0KB ⚠️ 10.5KB 10.4KB -115B
core/ClickableCard 12.8KB 13.1KB +289B 6.9KB 6.9KB 0B
core/CodeBlock 60.5KB 60.8KB +278B 10.7KB 10.7KB 0B
core/Collapsible 11.7KB 12.0KB +291B 4.2KB 4.2KB 0B
core/CommandPalette 50.9KB 51.2KB +289B 11.8KB 11.8KB 0B
core/CommandPaletteItem 8.4KB 8.7KB +280B 3.5KB 3.5KB 0B
core/ComplexSelector 55.8KB 56.1KB +318B 10.6KB 10.6KB 0B
core/ContextMenu 77.7KB 109.0KB +31.3KB ⚠️ 14.6KB 14.5KB -88B
core/ContextMenuItem 16.6KB 47.3KB +30.8KB ⚠️ 5.2KB 5.1KB -98B
core/DateInput 99.9KB 100.1KB +243B 14.8KB 14.8KB 0B
core/DateRangeInput 69.4KB 69.6KB +266B 11.2KB 11.2KB 0B
core/DateTimeInput 110.1KB 110.3KB +248B 15.2KB 15.2KB 0B
core/DialogHeader 48.8KB 49.1KB +280B 9.8KB 9.8KB 0B
core/DrawerHeader 48.9KB 49.2KB +249B 11.2KB 11.2KB 0B
core/DropdownMenu 72.7KB 103.3KB +30.6KB ⚠️ 14.7KB 14.7KB -83B
core/DropdownMenuCheckboxItem 16.1KB 46.8KB +30.7KB ⚠️ 5.6KB 5.5KB -93B
core/DropdownMenuItem 15.4KB 46.0KB +30.6KB ⚠️ 5.2KB 5.1KB -98B
core/DropdownMenuRadioItem 16.2KB 46.9KB +30.7KB ⚠️ 5.6KB 5.5KB -93B
core/DropdownMenuSubMenu 58.1KB 88.7KB +30.6KB ⚠️ 9.5KB 9.4KB -89B
core/FileInput 54.1KB 54.4KB +262B 10.3KB 10.3KB 0B
core/IconButton 43.3KB 43.6KB +273B 9.2KB 9.2KB 0B
core/Item 11.4KB 41.9KB +30.5KB ⚠️ 4.7KB 4.6KB -107B
core/LayerProvider 63.3KB 63.6KB +288B 10.1KB 10.1KB 0B
core/Lightbox 51.2KB 51.4KB +249B 9.8KB 9.8KB 0B
core/Link 43.5KB 43.8KB +288B 7.6KB 7.6KB 0B
core/List 6.7KB 6.7KB 0B 3.4KB 3.4KB 0B
core/ListItem 53.5KB 84.4KB +31.0KB ⚠️ 10.5KB 10.4KB -115B
core/Markdown 144.5KB 175.7KB +31.3KB ⚠️ 17.4KB 17.2KB -125B
core/MobileNav 51.0KB 51.3KB +264B 10.1KB 10.1KB 0B
core/MobileNavToggle 46.2KB 46.5KB +259B 9.4KB 9.4KB 0B
core/MoreMenu 72.9KB 103.5KB +30.6KB ⚠️ 14.7KB 14.7KB -83B
core/MultiSelector 76.2KB 76.4KB +270B 14.6KB 14.6KB 0B
core/NumberInput 55.7KB 56.0KB +278B 10.7KB 10.7KB 0B
core/Outline 28.6KB 28.9KB +290B 4.0KB 4.0KB 0B
core/Pagination 87.7KB 118.7KB +31.0KB ⚠️ 15.3KB 15.2KB -131B
core/Popover 49.8KB 50.1KB +238B 12.1KB 12.1KB 0B
core/PowerSearch 155.1KB 186.3KB +31.3KB ⚠️ 18.6KB 18.6KB -67B
core/RadioListItem 52.1KB 83.2KB +31.0KB ⚠️ 9.7KB 9.6KB -114B
core/SegmentedControlItem 8.6KB 8.9KB +285B 3.9KB 3.9KB 0B
core/SelectableCard 12.8KB 13.1KB +294B 7.1KB 7.1KB 0B
core/Selector 79.1KB 110.9KB +31.8KB ⚠️ 15.0KB 14.9KB -89B
core/SelectorOption 14.5KB 45.2KB +30.7KB ⚠️ 5.1KB 5.0KB -104B
core/SideNav 58.0KB 58.3KB +272B 10.6KB 10.6KB 0B
core/SideNavCollapseButton 46.6KB 46.9KB +242B 9.5KB 9.5KB 0B
core/SideNavHeading 54.7KB 55.0KB +248B 10.1KB 10.1KB 0B
core/SideNavItem 54.5KB 54.8KB +266B 10.1KB 10.1KB 0B
core/Step 32.4KB 32.7KB +279B 5.3KB 5.3KB 0B
core/Stepper 47.4KB 47.7KB +265B 9.6KB 9.6KB 0B
core/Switch 48.4KB 48.7KB +285B 9.3KB 9.3KB 0B
core/Tab 9.7KB 10.0KB +294B 4.1KB 4.1KB 0B
core/TabMenu 51.6KB 51.9KB +276B 10.0KB 10.0KB 0B
core/Table 84.0KB 115.3KB +31.3KB ⚠️ 15.1KB 15.0KB -110B
core/TableCell 78.8KB 110.1KB +31.3KB ⚠️ 14.8KB 14.7KB -146B
core/TableHeaderCell 78.6KB 109.8KB +31.3KB ⚠️ 14.8KB 14.7KB -133B
core/TableSelectionToolbar 52.4KB 52.6KB +278B 11.2KB 11.2KB 0B
core/TextInput 53.5KB 53.8KB +281B 10.5KB 10.5KB 0B
core/Thumbnail 50.7KB 50.9KB +274B 11.0KB 11.0KB 0B
core/TimeInput 86.8KB 87.1KB +266B 13.8KB 13.8KB 0B
core/Timestamp 27.5KB 27.5KB -1B 9.5KB 9.5KB 0B
core/Toast 59.8KB 60.1KB +258B 9.7KB 9.7KB 0B
core/ToggleButton 44.1KB 44.4KB +243B 9.3KB 9.3KB 0B
core/Token 29.6KB 29.9KB +289B 4.5KB 4.5KB 0B
core/Tokenizer 64.8KB 65.1KB +306B 11.7KB 11.7KB 0B
core/TopNav 51.9KB 52.1KB +277B 10.4KB 10.4KB 0B
core/TopNavHeading 54.2KB 54.4KB +231B 9.9KB 9.9KB 0B
core/TopNavItem 9.0KB 9.3KB +283B 3.8KB 3.8KB 0B
core/TopNavMegaMenu 54.2KB 54.4KB +268B 10.8KB 10.8KB 0B
core/TopNavMegaMenuItem 9.1KB 9.4KB +281B 4.1KB 4.1KB 0B
core/TopNavMenu 53.6KB 53.8KB +258B 10.1KB 10.1KB 0B
core/TreeList 32.5KB 32.8KB +274B 4.7KB 4.7KB 0B
core/Typeahead 61.5KB 61.7KB +268B 11.3KB 11.3KB 0B

Sizes are gzip. Import counts the JavaScript the import loads eagerly; CSS counts the package stylesheet rules referenced by the modules it can load from its own package, lazily loaded ones included.

⚠️ Touch-only size budget

These components grew past the touch-only budget (2 KB gzip JavaScript or 1 KB gzip CSS per component). If the growth runs only on a coarse pointer, load its JavaScript lazily so the import does not carry it, or justify the cost in the pull request description; CSS stays in the package stylesheet, so justify it.

Component JavaScript CSS
core/BreadcrumbItem +31.2KB ⚠️ -46B
core/CheckboxListItem +31.0KB ⚠️ -115B
core/ContextMenu +31.3KB ⚠️ -88B
core/ContextMenuItem +30.8KB ⚠️ -98B
core/DropdownMenu +30.6KB ⚠️ -83B
core/DropdownMenuCheckboxItem +30.7KB ⚠️ -93B
core/DropdownMenuItem +30.6KB ⚠️ -98B
core/DropdownMenuRadioItem +30.7KB ⚠️ -93B
core/DropdownMenuSubMenu +30.6KB ⚠️ -89B
core/Item +30.5KB ⚠️ -107B
core/ListItem +31.0KB ⚠️ -115B
core/Markdown +31.3KB ⚠️ -125B
core/MoreMenu +30.6KB ⚠️ -83B
core/Pagination +31.0KB ⚠️ -131B
core/PowerSearch +31.3KB ⚠️ -67B
core/RadioListItem +31.0KB ⚠️ -114B
core/Selector +31.8KB ⚠️ -89B
core/SelectorOption +30.7KB ⚠️ -104B
core/Table +31.3KB ⚠️ -110B
core/TableCell +31.3KB ⚠️ -146B
core/TableHeaderCell +31.3KB ⚠️ -133B

Bundle Size Summary

Gzip figures measure each package's entry file, not the code an import pulls in.

Package Entry (ESM) Entry gzip before Entry gzip after Delta
@astryxdesign/core 4.9KB 1.2KB 1.2KB 0B
Package stylesheet Gzip before Gzip after Delta
@astryxdesign/core 34.6KB 34.5KB -104B

Accessibility Audit

Status: No accessibility violations detected.

Visual Regression

55 of 504 shot(s) changed.

A change here is a question, not a failure: check whether the after is the
picture you intended. Record that review on the PR. Baseline maintenance is an
explicit dispatch of CI; this report never rewrites the baseline or adds a release gate.

component story theme mode pixels
Selector Indicator Space Bottom Sheet Narrow End RTL neutral light 753,933
Selector Indicator Space Bottom Sheet Wide Start neutral light 740,072
RichTextEditor Markdown parity: side by side probe dark 558,840
RichTextEditor Markdown parity: side by side probe light 540,756
Chat Full AI Chat probe light 230,823
Chat Full AI Chat probe dark 229,805
AppShell With Mobile Nav probe light 217,010
AppShell With Mobile Nav probe dark 216,960
Collapsible Dividers probe dark 66,445
Collapsible Dividers probe light 66,445
AppShell Playground neutral dark 65,198
AppShell Playground neutral light 63,788
Chat Default neutral dark 36,304
Chat Default neutral light 35,767
Chat Empty State probe light 23,531
Chat Empty State probe dark 22,622
ChatAutoScroll Scroll Behavior Comparison neutral dark 15,378
ChatAutoScroll Scroll Behavior Comparison neutral light 14,107
Chat With Attachments probe light 13,406
Chat With Attachments probe dark 11,232

and 35 more.


Generated by PR Enrichment workflow | Storybook | Sandbox | View full report

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Approval waits on an engineering owner's decision: the new swipe-row rules (a tap on an open row closes it without activating it, and any scroll closes it) change spec:AST-057 FR7 and AR3, and the proposed Item.spec.md claims and the draft spec:AST-094 this branch carries have no approval for this head. An engineering owner records the decision by commenting /approve-spec 6573ea83ee6ed43887b9a4d10ef076537253b05c on this pull request, and the author may do so as an engineering owner; AST-057 itself still needs the amended text. Whatever the decision, these need changes:

  • Rebase onto the landed predecessor pull requests so this one is the 402-line dismissal change alone; today it carries 28,381 authored lines.
  • Close the row only for scrolls a finger drove, because moving focus to an entry that is partly out of view now closes the row and drops that entry (AST-057 AR1).
  • Report the open state from the swipe handlers instead of the useEffect in ItemSwipeLayer.tsx (react-component-runtime INV2 and INV3).

[Automated review]

Comment on lines +472 to +481
const onScroll = (event: Event) => {
const root = rootRef.current;
const {target} = event;
if (
root != null &&
(target === document ||
(target instanceof Element && target.contains(root)))
) {
close();
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This closes the open row for every scroll of an ancestor, including the scroll the browser makes when focus moves to an entry that is partly out of view: the row closes, the panel turns inert and focus falls back to the row, so a keyboard or screen-reader user loses the entry (AST-057 AR1). Closing only for a scroll a finger drove, as utils/pressFeedback.ts already decides, or ignoring scrolls while focus is inside the row, keeps the entry reachable.

Comment on lines +230 to +238
useEffect(() => {
if (!isOpen) {
return undefined;
}
onOpenChange(true);
return () => {
onOpenChange(false);
};
}, [isOpen, onOpenChange]);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This Effect calls onOpenChange in reaction to the swipe state and names no external system, which architecture:react-component-runtime INV2 and INV3 rule out; Item then renders once more to drop data-astryx-pressable. Reporting open and closed from the useSwipeAction transitions that change the state, or letting Item read isSwipeOpen directly, avoids the relay.

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Approval waits on an engineering owner's decision: on iOS a tap on an open swipe row now closes it without activating it, any scroll closes it, and a row still springing open counts as open, which extends spec:AST-057 FR7 and conflicts with AR3, and the Item.spec.md requirements and the draft spec:AST-094 this branch carries have no approval for this head. An engineering owner records the decision by commenting /approve-spec followed by the full head SHA on this pull request (the author may do so as an engineering owner), and AST-057 itself still needs the amended text. Whatever the decision, these need changes:

  • Close the row only for scrolls a finger drove, or not while focus is inside it, because moving focus or the VoiceOver cursor to a partly hidden entry now scrolls, closes the row and drops that entry (AST-057 AR1).
  • Report the open state from the swipe transitions instead of the Effect in ItemSwipeLayer.tsx (react-component-runtime INV2 and INV3).
  • Rebase onto the landed predecessor pull requests so this one is the 464-line dismissal change alone; today it carries 34,764 authored lines.

[Automated review]

@vjeux
vjeux force-pushed the uikit/c12-swipe-dismiss branch from d021d98 to 899d805 Compare October 24, 2026 22:07
@vjeux

vjeux commented Oct 24, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the review. Where each point stands on the new head:

  • Focus and scroll (AST-057 AR1): fixed. A scroll no longer closes the row while focus is inside it, because the browser may be scrolling a focused entry into view (keyboard or VoiceOver). New test: open the row, focus an entry, scroll the list; the row stays open and the entry keeps focus. That test failed before the fix.
  • INV2: the open state now reaches Item from the transition that changes it (setSwipeState), not from an Effect. One Effect remains: it releases the report if the row leaves while open.
  • Waiting for an engineering owner: the FR7/AR3 amendment and the spec approvals.

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Approval waits on an engineering owner's decision: on iOS a tap on an open swipe row now closes it without activating it, a scroll closes it while focus is outside the row, and a row still springing open counts as open, which extends spec:AST-057 FR7 and conflicts with AR3, and the Item.spec.md requirements and the draft spec:AST-094 this branch carries have no approval for this head. An engineering owner records the decision by commenting /approve-spec followed by the full head SHA on this pull request (the author may do so as an engineering owner), and AST-057 itself still needs the amended text. The focus guard on the scroll close and the transition report settle the earlier AR1 and INV2 points; whatever the decision, these still need changes:

  • Let the entries work from the moment the row counts as open: the panel stays inert until the iOS settle ends, about 3.5 s after the release, so a tap on Archive or Delete in that window closes the row and fires nothing.
  • Remove the unmount cleanup Effect in useSwipeAction.ts that reports onOpenChange(false) and let Item clear its open flag during render (react-component-runtime INV3).
  • Rebase onto the landed predecessor pull requests so this one is the 517-line dismissal change alone; today it carries 35,007 authored lines, including an iOS reducedMotion: 'keep' that contradicts AST-057 FR5's reduced-motion rule on main.

[Automated review]

@@ -247,76 +283,87 @@ export default function ItemSwipeLayer({
const outer = entries[entries.length - 1];
const isCommit = behavior === 'commit';
const isLive = isSwipeResting && !isCommit;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

On iOS the row now counts as open from the release (isSwipeOpen in useSwipeAction.ts), but this keeps the panel inert until the phase is exactly resting. An inert panel is not hit-testable, so a tap on Archive or Delete during UIKit's overdamped settle (about 3.5 s for a row released 72 px short of open, over 2 s from 5 px) lands on the row or the list behind it, and the dismissal tap or the outside-pointer close shuts the row without firing the entry. Making the panel live, and activateEntry accept, from the same isSwipeOpen would keep spec:AST-057 FR5's "every entry tappable" true under the new open-from-release model; a test that taps an entry before settled() would cover it.

Comment on lines +387 to +392
// Releases the open report when the row leaves while open.
useEffect(
() => () => {
if (settleTimerRef.current != null) {
clearTimeout(settleTimerRef.current);
const {idiom: current, onOpenChange: report} = latestRef.current;
if (current === 'ios' && isSwipeOpen(stateRef.current)) {
report?.(false);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This cleanup calls onOpenChange(false) from an Effect, and its comment names no external system: architecture:react-component-runtime INV3 asks every new Effect to name the one it synchronizes, and what this keeps in step is Item's own isSwipeOpen state. Item can clear that flag during render when it stops rendering the swipe layer (when hasSwipe turns false), which removes the need for this Effect.

* animators on tracking and release, and the full swipe still performs,
* Oct 23 2026
*/
reducedMotion: 'keep',

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

spec:AST-057 FR5 on main now says: "Under reduced motion the slide out, the spring back, and the hold-out follow design:reduced-motion: the row reaches its resting place with no travel or spring and cross-fades (DR2), because the swipe's own touch pointer started it." keep springs the iOS settle, slide-out and spring back under Reduce Motion, so this needs an owner-approved FR5 amendment (the draft AST-094 FR8 argues for one) or the cross-fade.

vjeux added a commit to vjeux/astryx that referenced this pull request Oct 25, 2026
…e restacked heads — iOS 26.2 removal and Reduce Motion clips on evidence builds with meta#8106 at 4d54dbc, Chromium clips without emulation, Android 15 emulator takes (Chromium 158, recording lease)
@vjeux
vjeux force-pushed the uikit/c12-swipe-dismiss branch from 899d805 to 11a6649 Compare October 25, 2026 01:36
@github-actions github-actions Bot added the needs:design-review Affects visuals — Design should review label Oct 25, 2026
vjeux added 20 commits October 29, 2026 10:16
… the inline style it reads

- The motion registry, the host's engine gate and the README name the
  presented hit test as an engine workaround (spec:AST-013 FR6) with its
  review condition (re-measure on each iOS release; remove it once iOS
  WebKit hit-tests a compositor-moved element where it is drawn) and its
  regression fixture.
- While a curve runs the animator holds the value it starts from inline,
  so presentation.ts and the README no longer say the inline style holds
  the end.
…core/internal/touch

Core ships the internal entry @astryxdesign/core/internal/touch, which
re-exports the gesture primitives for Astryx's own packages, and the
Lab-import guard fails a Lab import of core outside core's exports
(architecture:react-component-runtime INV13). The README and the barrel's
header named internal workspace imports and said nothing here is
exported; they now name that entry.
…ill needs the element, and the listeners that cancel

The release note, the stream's header, the host's comment and the README
said the stream is one passive listener per event type and that a
document-capture stopPropagation no longer starves the recognizers. Such a
stop never hid a listener on the same node, and some subscriptions cancel.
They now say what changed: an app's window-capture stopPropagation, or a
document-capture stopImmediatePropagation registered before core, no
longer hides a touch; a recognizer that must claim still needs the touch to
reach its element; the gesture host's touchend, click and contextmenu
cancel while a claimer is attached and the page hold's touchmove while it
holds; and the stream stays ahead of an app's window-capture listener only
until a type's listener is re-added. The README's list of blocking
touchmove listeners gains the claimed touch's target and the document
while a claiming element moves.
…default it moves

The {stylexOptions} form of astryxStylex now passes StyleX
treeshakeCompensation: true unless the caller sets it. spec:AST-017 FR3
asks the release note to name the old and new default and the option
that restores the old one; it now does.
…er and for the two stops the input stream fixes

- A still finger with sub-pixel jitter over a scroll view keeps its tap
  and scrolls nothing (spec:AST-094 FR18–FR22).
- A tap is still recognized under an app's window-capture
  stopPropagation, and under a document-capture
  stopImmediatePropagation registered before core's: the recognizers hear
  touches on the window's capture phase.
Chromium and WebKit pass.
…s once

Where nothing that claims is attached, the host's touchend listener is
passive and cannot cancel the engine's own click after a retargeted tap
clicks what is drawn. The shared click guard swallows that late click
whatever is attached; this case pins it, as asked on meta#8293.
# Conflicts:
#	packages/core/src/motion/README.md
… first lift event, its pointerup or its touchend, whichever the gesture host releases on
Takes meta#8360's head, which removes a document's or shadow root's
touch-action rules with its last marked element and names the build
changeset's treeshakeCompensation default, in place of 1e1431f.
…esture host's subscriptions

The gesture host subscribes no click: the one cancelling click subscriber
is the click guard's, added at a window's first arm and kept. The release
note, the stream's header and the gestures README listed click with the
host's touchend and contextmenu; they now name the guard's own.
vjeux added a commit to vjeux/astryx that referenced this pull request Oct 29, 2026
# Conflicts:
#	packages/core/src/Item/useSwipeAction.ts
vjeux added a commit to vjeux/astryx that referenced this pull request Oct 29, 2026
# Conflicts:
#	packages/core/src/Item/__tests__/ItemSwipeActions.interaction.browser.spec.ts
vjeux added a commit to vjeux/astryx that referenced this pull request Oct 29, 2026
@vjeux
vjeux marked this pull request as draft October 29, 2026 22:31

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Approval waits on an engineering owner's decision: this pull request intentionally changes spec:AST-057 (a touch tap on an open swipe row's content closes it without activating the row, a scroll closes it while focus is outside the row, and a row still springing open counts as open), which extends FR7 and conflicts with AR3, so AST-057 needs updating to match what is decided. An engineering owner records that decision by commenting /approve-spec followed by the full head SHA on this pull request, and the author may do so as an engineering owner. Whatever the decision, these still need changes:

  • Limit the scroll close's focus check to the open panel: as written, a row whose own button holds focus, as it does in Chrome after one of its entries fires, stays open through a scroll with Delete exposed.
  • Rebase onto main once the stack under #8097 lands, so this pull request is the 516-line dismissal alone; today the compare carries 32,905 authored lines, including the AST-057 FR2 and FR5 departures and an unrelated astryxStylex default change.

[Automated review]

(target instanceof Element && target.contains(root))) &&
// Focus inside the row means the scroll may be the browser bringing
// the focused entry into view (keyboard or VoiceOver): the row stays.
!root.contains(document.activeElement)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This keeps the row open whenever focus is anywhere in it, not only on an entry. The row itself moves focus to its own button when an entry fires or it closes with focus inside (focusRowContent), and Chromium leaves a tapped button focused, so a reopened row then stays open through a scroll with Archive and Delete exposed. Checking that focus is inside the open panel (document.activeElement.closest('[data-swipe-panel]') != null) keeps the entry case this comment names.

@vjeux

vjeux commented Nov 1, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #8690, which contains this change; its description lists where each test and changeset line went.

@vjeux vjeux closed this Nov 1, 2026

This branch was successfully deployed

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

Labels

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