Repository navigation
fix(core): a finger press on a control inside a list row, TreeList row or Token shows no press on it - #9959
Conversation
…r paints no container press (red)
…on a control inside A finger press that starts on a control inside a list row with onClick or href, a TreeList row with an action or children, or a Token with onRemove does not run that row's or token's action, so it shows no press on it now, as ClickableCard and delegated rows already do. Item routes its own-action rows through useClickableContainer's onPointerDown; TokenLink spreads the onPointerDown it already gets; TreeListItem and the presentational Token use the hook's decision through cancelNestedTouchPress, a module-internal function. The row's own action, and a parent row's Chevron, still press it. Mouse and pen presses are unchanged. Item FR9, TreeList FR7 and Token FR6 state the rule.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
|
/approve-spec 1e9cff5 |
PR Analysis Report🔎 Preview ·
|
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| TreeList · Storybook | 39.1 kB (+93 B) · 5.0 kB CSS (0) | 1,175 (+21) | ✗ · ✓ · ✓ |
| PowerSearch | 241.6 kB (+326 B) · 21.9 kB CSS (0) | — | — · — · — |
| richtext/RichTextEditorToolbar | 225.6 kB (+146 B) · 454 B CSS (0) | — | — · — · — |
119 more components
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| lab/CommentThread | 256.4 kB (+140 B) · 2.4 kB CSS (0) | — | — · — · — |
| lab/DiffViewer | 71.4 kB (+130 B) · 2.1 kB CSS (0) | — | — · — · — |
| Selector | 78.7 kB (+129 B) · 15.8 kB CSS (0) | — | — · — · — |
| DropdownMenu | 73.6 kB (+127 B) · 15.6 kB CSS (0) | — | — · — · — |
| RadioListItem | 51.4 kB (+126 B) · 9.0 kB CSS (0) | — | — · — · — |
| Markdown | 145.7 kB (+122 B) · 18.5 kB CSS (0) | — | — · — · — |
| BreadcrumbItem | 68.8 kB (+120 B) · 10.9 kB CSS (0) | — | — · — · — |
| MoreMenu | 73.9 kB (+118 B) · 15.6 kB CSS (0) | — | — · — · — |
| Pagination | 87.5 kB (+118 B) · 16.1 kB CSS (0) | — | — · — · — |
| DropdownMenuSubMenu | 57.5 kB (+116 B) · 8.9 kB CSS (0) | — | — · — · — |
| Token · Storybook | 25.7 kB (+115 B) · 4.8 kB CSS (0) | 581 (+20) | ✓ · ✓ · — |
| DropdownMenuItem | 18.1 kB (+112 B) · 5.6 kB CSS (0) | — | — · — · — |
| Tokenizer | 70.0 kB (+110 B) · 17.1 kB CSS (0) | — | — · — · — |
| ContextMenuItem | 20.5 kB (+109 B) · 5.7 kB CSS (0) | — | — · — · — |
| lab/TransferList | 75.3 kB (+102 B) · 1.7 kB CSS (0) | — | — · — · — |
| lab/Comments | 261.7 kB (+100 B) · 2.5 kB CSS (0) | — | — · — · — |
| lab/TransferListSelector | 83.0 kB (+100 B) · 1.9 kB CSS (0) | — | — · — · — |
| Typeahead | 63.2 kB (+98 B) · 11.2 kB CSS (0) | — | — · — · — |
| Item · Storybook | 13.7 kB (+97 B) · 4.9 kB CSS (0) | 1,630 (+21) | ✓ · ✓ · — |
| SelectorOption | 17.1 kB (+96 B) · 5.4 kB CSS (0) | — | — · — · — |
| DropdownMenuCheckboxItem | 18.8 kB (+94 B) · 6.0 kB CSS (0) | — | — · — · — |
| ContextMenu | 75.0 kB (+92 B) · 15.5 kB CSS (0) | — | — · — · — |
| TableHeaderCell | 75.7 kB (+91 B) · 15.7 kB CSS (0) | — | — · — · — |
| TableCell | 76.1 kB (+90 B) · 16.0 kB CSS (0) | — | — · — · — |
| CheckboxListItem | 53.6 kB (+84 B) · 10.0 kB CSS (0) | — | — · — · — |
| charts/ChartTooltip | 134.0 kB (+82 B) · 423 B CSS (0) | — | — · — · — |
| DropdownMenuRadioItem | 18.9 kB (+81 B) · 6.0 kB CSS (0) | — | — · — · — |
| ListItem | 52.9 kB (+80 B) · 10.0 kB CSS (0) | — | — · — · — |
| Table | 84.3 kB (+77 B) · 16.2 kB CSS (0) | — | — · — · — |
| charts/Chart | 157.4 kB (+73 B) · 494 B CSS (0) | — | — · — · — |
| lab/EmojiPicker | 70.7 kB (+30 B) · 722 B CSS (0) | — | — · — · — |
| FieldLabel | 38.0 kB (+29 B) · 5.4 kB CSS (0) | — | — · — · — |
| lab/Schedule | 60.6 kB (+28 B) · 3.9 kB CSS (0) | — | — · — · — |
| RadioList | 43.5 kB (+26 B) · 6.9 kB CSS (0) | — | — · — · — |
| Field | 42.0 kB (+25 B) · 6.9 kB CSS (0) | — | — · — · — |
| MultiSelector | 73.1 kB (+25 B) · 15.3 kB CSS (0) | — | — · — · — |
| Switch | 87.4 kB (+25 B) · 9.5 kB CSS (0) | — | — · — · — |
| TextArea | 48.2 kB (+25 B) · 8.8 kB CSS (0) | — | — · — · — |
| CheckboxList | 44.6 kB (+24 B) · 7.5 kB CSS (0) | — | — · — · — |
| InputGroup | 43.1 kB (+24 B) · 7.3 kB CSS (0) | — | — · — · — |
| ClickableCard | 15.0 kB (+23 B) · 7.0 kB CSS (0) | — | — · — · — |
| Slider | 90.1 kB (+23 B) · 8.3 kB CSS (0) | — | — · — · — |
| TextInput | 53.0 kB (+23 B) · 9.9 kB CSS (0) | — | — · — · — |
| TimeInput | 137.2 kB (+23 B) · 14.5 kB CSS (0) | — | — · — · — |
| richtext/RichTextView | 258.8 kB (+23 B) · 2.3 kB CSS (0) | — | — · — · — |
| DateInput | 151.1 kB (+22 B) · 15.5 kB CSS (0) | — | — · — · — |
| DateTimeInput | 173.2 kB (+22 B) · 17.2 kB CSS (0) | — | — · — · — |
| SelectableCard | 15.1 kB (+22 B) · 7.2 kB CSS (0) | — | — · — · — |
| lab/CommentComposer | 104.9 kB (+22 B) · 1.9 kB CSS (0) | — | — · — · — |
| lab/SelectableCardGroup | 50.4 kB (+22 B) · 162 B CSS (0) | — | — · — · — |
| richtext/RichTextEditor | 278.3 kB (+22 B) · 2.6 kB CSS (0) | — | — · — · — |
| ComplexSelector | 55.7 kB (+21 B) · 10.4 kB CSS (0) | — | — · — · — |
| DateRangeInput | 71.3 kB (+21 B) · 11.2 kB CSS (0) | — | — · — · — |
| FileInput | 53.8 kB (+21 B) · 9.7 kB CSS (0) | — | — · — · — |
| NumberInput | 55.1 kB (+21 B) · 10.1 kB CSS (0) | — | — · — · — |
| lab/ListInput | 81.9 kB (+20 B) · 1.6 kB CSS (0) | — | — · — · — |
| CheckboxInput | 48.7 kB (+19 B) · 8.7 kB CSS (0) | — | — · — · — |
| lab/ChatEmojiPicker | 65.9 kB (+19 B) · 773 B CSS (0) | — | — · — · — |
| lab/ChatReactionBar | 66.4 kB (+19 B) · 1.1 kB CSS (0) | — | — · — · — |
| Overlay | 21.1 kB (+10 B) · 4.0 kB CSS (0) | — | — · — · — |
| lab/TourStep | 58.0 kB (+2 B) · 590 B CSS (0) | — | — · — · — |
| Popover | 52.0 kB (+1 B) · 12.8 kB CSS (0) | — | — · — · — |
| charts/ChartLegend | 34.4 kB (0) · 224 B CSS (0) | — | — · — · — |
| AlertDialog | 83.8 kB (0) · 13.1 kB CSS (0) | — | — · — · — |
| AppShell | 71.2 kB (0) · 12.2 kB CSS (0) | — | — · — · — |
| Avatar | 34.8 kB (0) · 5.4 kB CSS (0) | — | — · — · — |
| AvatarGroup | 37.5 kB (0) · 5.5 kB CSS (0) | — | — · — · — |
| AvatarGroupOverflow | 38.8 kB (0) · 5.5 kB CSS (0) | — | — · — · — |
| Banner | 47.2 kB (0) · 9.2 kB CSS (0) | — | — · — · — |
| BaseTypeahead | 55.3 kB (0) · 9.6 kB CSS (0) | — | — · — · — |
| Button | 45.3 kB (0) · 8.7 kB CSS (0) | — | — · — · — |
| Calendar | 54.4 kB (0) · 9.3 kB CSS (0) | — | — · — · — |
| Carousel | 49.6 kB (0) · 9.5 kB CSS (0) | — | — · — · — |
| ChatComposer | 61.5 kB (0) · 10.6 kB CSS (0) | — | — · — · — |
| ChatComposerInput | 59.4 kB (0) · 10.0 kB CSS (0) | — | — · — · — |
| ChatComposerTokenElement | 59.4 kB (0) · 10.0 kB CSS (0) | — | — · — · — |
| ChatDictationButton | 45.8 kB (0) · 8.8 kB CSS (0) | — | — · — · — |
| ChatLayout | 48.4 kB (0) · 9.3 kB CSS (0) | — | — · — · — |
| ChatLayoutScrollButton | 45.8 kB (0) · 8.9 kB CSS (0) | — | — · — · — |
| ChatMessageList | 22.8 kB (0) · 6.9 kB CSS (0) | — | — · — · — |
| ChatSendButton | 45.7 kB (0) · 8.7 kB CSS (0) | — | — · — · — |
| ChatToolCalls | 25.9 kB (0) · 8.2 kB CSS (0) | — | — · — · — |
| CodeBlock | 59.1 kB (0) · 10.0 kB CSS (0) | — | — · — · — |
| CommandPalette | 51.0 kB (0) · 12.3 kB CSS (0) | — | — · — · — |
| CommandPaletteInput | 26.9 kB (0) · 7.4 kB CSS (0) | — | — · — · — |
| DialogHeader | 48.1 kB (0) · 10.2 kB CSS (0) | — | — · — · — |
| DrawerHeader | 48.3 kB (0) · 11.6 kB CSS (0) | — | — · — · — |
| Heading | 7.9 kB (0) · 4.9 kB CSS (0) | — | — · — · — |
| HoverCard | 19.3 kB (0) · 3.9 kB CSS (0) | — | — · — · — |
| IconButton | 45.3 kB (0) · 8.7 kB CSS (0) | — | — · — · — |
| InfoTip | 37.2 kB (0) · 5.0 kB CSS (0) | — | — · — · — |
| LayerProvider | 63.3 kB (0) · 9.4 kB CSS (0) | — | — · — · — |
| Lightbox | 52.5 kB (0) · 9.1 kB CSS (0) | — | — · — · — |
| Link | 42.7 kB (0) · 6.9 kB CSS (0) | — | — · — · — |
| MobileNav | 52.2 kB (0) · 9.3 kB CSS (0) | — | — · — · — |
| MobileNavToggle | 45.6 kB (0) · 8.7 kB CSS (0) | — | — · — · — |
| ProgressBar | 10.8 kB (0) · 6.2 kB CSS (0) | — | — · — · — |
| SegmentedControl | 82.0 kB (0) · 6.7 kB CSS (0) | — | — · — · — |
| SideNav | 71.5 kB (0) · 10.1 kB CSS (0) | — | — · — · — |
| SideNavCollapseButton | 46.1 kB (0) · 8.8 kB CSS (0) | — | — · — · — |
| SideNavHeading | 59.8 kB (0) · 10.0 kB CSS (0) | — | — · — · — |
| SideNavItem | 54.8 kB (0) · 9.8 kB CSS (0) | — | — · — · — |
| Spinner | 18.5 kB (0) · 5.7 kB CSS (0) | — | — · — · — |
| StatusDot | 22.9 kB (0) · 5.2 kB CSS (0) | — | — · — · — |
| Stepper | 46.8 kB (0) · 8.9 kB CSS (0) | — | — · — · — |
| TableSelectionToolbar | 54.8 kB (0) · 11.8 kB CSS (0) | — | — · — · — |
| TabMenu | 56.5 kB (0) · 9.8 kB CSS (0) | — | — · — · — |
| Text | 7.4 kB (0) · 4.9 kB CSS (0) | — | — · — · — |
| Thumbnail | 49.6 kB (0) · 10.3 kB CSS (0) | — | — · — · — |
| Timer | 9.5 kB (0) · 5.9 kB CSS (0) | — | — · — · — |
| Timestamp | 21.3 kB (0) · 8.9 kB CSS (0) | — | — · — · — |
| Toast | 59.6 kB (0) · 9.0 kB CSS (0) | — | — · — · — |
| ToggleButton | 46.1 kB (0) · 8.8 kB CSS (0) | — | — · — · — |
| Tooltip | 20.6 kB (0) · 3.9 kB CSS (0) | — | — · — · — |
| TopNav | 53.7 kB (0) · 9.6 kB CSS (0) | — | — · — · — |
| TopNavHeading | 59.2 kB (0) · 9.8 kB CSS (0) | — | — · — · — |
| TopNavMegaMenu | 54.3 kB (0) · 10.6 kB CSS (0) | — | — · — · — |
| TopNavMenu | 59.1 kB (0) · 9.9 kB CSS (0) | — | — · — · — |
| lab/CommentPin | 47.1 kB (0) · 1.2 kB CSS (0) | — | — · — · — |
Visual changes: 2 snapshots in 1 component
A change is a question for the reviewer, not a failure.
| Component · story | Before | After | Diff |
|---|---|---|---|
| TreeList · Basic (neutral, dark) | ![]() |
![]() |
![]() |
| TreeList · Basic (neutral, light) | ![]() |
![]() |
![]() |
Package size: @astryxdesign/core 6.40 MB packed (+1.8 kB); no new dependencies.
API changes: none in this pull request
Committed API report behind this build: cli 8 rows, core 2 rows; run pnpm api:report.
Touched components checked; add ci:run-visual, ci:run-a11y or ci:run-rtl to run the full suites.
Generated by PR Enrichment workflow | View full report
There was a problem hiding this comment.
Requesting changes. The touch rule and the three widened records look right, and the new adopter tests fail on main and pass here, but two things need fixing first.
- Desktop behavior change needs an owner decision: the second
useClickableContainercall inItem.tsx(lines 665–672, with the ref change at line 869) puts the hook'sdata-pressable-containermarker on everyonClick/hrefrow. As a result, an enclosing ClickableCard or SelectableCard no longer activates on a mouse click on the row's start content, end content or padding, and on anhrefrow that click now does nothing at all. To keep the change touch-only, keepcontainerRefon delegated rows and callcancelNestedTouchPress(event, event.currentTarget, ownAction)from the row's pointer handler, as TreeListItem and Token do; otherwise, cite an owner decision for the mouse change. - Claims match scope: the changeset says "a TreeList row with an action or children, or a Token with
onRemove", but TreeList link rows already dropped this press on main and static Tokens paint no press at all. "A TreeList row withonClickor children, or a clickable or link Token withonRemove" matches what changed.
Two optional wording suggestions for comments are inline. CI has not run on this head yet because the pull request is a draft.
[Automated review]
| const {onPointerDown: pressOnRow} = useClickableContainer({ | ||
| containerRef, | ||
| interactiveRef: isDelegate | ||
| ? interactiveRef | ||
| : href != null | ||
| ? actionLinkRef | ||
| : actionButtonRef, | ||
| disabled: isDisabled || !hasOwnActionOnly, |
There was a problem hiding this comment.
This second hook call, with containerRef now attached to every own-action row (line 869), runs the hook's mount Effect. That Effect writes data-pressable-container on onClick/href row roots, so an enclosing ClickableCard or SelectableCard treats the whole row as a nested control. A mouse click on the row's start content, end content or padding no longer activates the card; on an href row, nothing happens at all.
To keep the touch fix without the marker, keep one hook call for delegated rows. For these rows, call cancelNestedTouchPress(event, event.currentTarget, href != null ? actionLinkRef.current : actionButtonRef.current) from the root's pointer handler, as TreeListItem and Token do.
| '@astryxdesign/core': patch | ||
| --- | ||
|
|
||
| [fix] With a finger, a press that starts on a control inside a list row with `onClick` or `href`, a TreeList row with an action or children, or a Token with `onRemove` no longer makes the row or token look pressed, since it does not run the row's or token's action. A press on the row or token itself still looks pressed. Mouse presses are unchanged. |
There was a problem hiding this comment.
TreeList link rows already dropped this press on main (the new "TreeList link row" case passes there), and a static Token with only onRemove paints no press at all. Suggested wording: "a TreeList row with onClick or children, or a clickable or link Token with onRemove".
| // A row that runs only its own action: a press on a nested control does not | ||
| // activate it, so the row shows no touch press for one. A row with a parent | ||
| // role or a link root activates on such a press, so it keeps its press. |
There was a problem hiding this comment.
Optional: the first sentence has 27 words and covers two topics. Suggested:
// A press on a nested control does not run this row's action, so the row
// shows no touch press. A row with a parent role or a link root runs it, so
// it keeps the press.| * The touch half of a container's press rule, for a container that cannot | ||
| * hold refs: a finger press that starts on a nested interactive element |
There was a problem hiding this comment.
Optional: "for a container that cannot hold refs" is not accurate. The hook calls this function too, and TreeListItem holds refs. Dropping that phrase keeps the doc true.
…ing a clickable container The row calls cancelNestedTouchPress from its pointer handler instead of a second useClickableContainer, so its root carries no container marker and an enclosing card keeps treating the row as its own surface. A test covers a mouse click on such a row's start content. The changeset names only what changed.
|
/approve-spec e04ae5e |
There was a problem hiding this comment.
Approved pending CI: CI is still running on this head, so the required checks have to pass before this lands.
Both earlier blocking findings are resolved: an onClick or href row no longer becomes a clickable container for an enclosing card (the new card test covers a mouse click on its start content), and the changeset now names only the rows and tokens that changed. The touch rule matches the widened Item, TreeList and Token records, and the new adopter tests fail on main and pass here.
- Optional: one comment in
Item.tsxcould name its subject more clearly; see the inline suggestion.
[Automated review]
| // A press on a nested control does not run this row's action, so the row | ||
| // shows no touch press. A row with a parent role or a link root runs it, so | ||
| // it keeps the press. Such a row is not a clickable container: an enclosing | ||
| // card still treats it as part of its own surface. |
There was a problem hiding this comment.
Optional (comment style): "Such a row" follows the sentence about parent-role and link-root rows, so it reads as describing them, and "its own surface" has no clear owner. Suggested:
// A press on a nested control does not run this row's action, so the row
// shows no touch press. A row with a parent role or a link root runs it, so
// it keeps the press. An own-action row is not a clickable container, so an
// enclosing card still treats the row as part of the card's surface.





With a finger, a press that starts on a control inside a list row, a TreeList row or a Token no longer makes the row or token look pressed, because that press doesn't run the row's or token's action. This finishes the rule #9801 added for clickable cards, across every container that paints a press.
Owner's words
#9801 fixed it in
useClickableContainer. This pull request is the "checked in other containers" half: every remaining container that paints a press now goes through the hook's same touch rule.Every container on main, checked
Touch test: a nested control inside each container, then the container itself.
interactiveRef); CheckboxListItem; RadioListItemonClickhrefonClickhref+onRemove)onClick+onRemove)A finger on the row's or token's own action (its invisible button or link, or the control it delegates to) still presses it. So does a finger on the row or token itself.
How
useClickableContainer: its touch decision moves intocancelNestedTouchPress(event, container, ownAction). It's a module-internal function, not exported from the package. The hook'sonPointerDowncalls it.onClickorhrefrow callscancelNestedTouchPressfrom its root's pointer handler, with its invisible button or link as the own action. It's chained after a swipe row's pointer handler. It doesn't become a clickable container (no container marker), so an enclosing ClickableCard or SelectableCard still treats the row as part of its own surface; a test covers this. A delegated row keeps the hook'sonPointerDown. A row with a parent-suppliedrole, or a link root, is unchanged, because a press on a nested control activates it.cancelNestedTouchPress. The own action is the row's link or invisible button. On a row whose surface toggles, a press on the Chevron also counts as the row's own action.onPointerDownit already got from the hook, composed with a caller's.cancelNestedTouchPressfrom its container's pointer handler, with its inner button as the own action, after a caller's handler.verified_bynames the new test.[fix].Evidence
onClickrow, TreeListonClickrow, Token with Remove.hooks/nestedTouchPress.adopters.test.tsx(18 tests), red first: 7 fail on main, covering the 6 containers above plus the Chevron on anonClickrow.Writing rubric results
The rubric in
docs/contributing/spec-writing.mdwas run over Item FR9, TreeList FR7 and Token FR6.:activepaint.verified_byand verification row names the test.