Skip to content

fix(ClickableCard, SelectableCard): no touch pressed look for a finger press that starts on a control inside the card - #9801

Merged
cixzhang merged 13 commits into
mainfrom
lane4/clickable-nested-press
Nov 4, 2026
Merged

cixzhang merged 13 commits into
mainfrom
lane4/clickable-nested-press

Conversation

@cixzhang

@cixzhang cixzhang commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

With a finger, ClickableCard and SelectableCard now show their pressed look only for a press that would open them. A finger press that starts on a control inside the card shows the control's own press, not the card's. Mouse and pen presses are unchanged.

User impact

  • People using an app on a touch screen: tapping an "i" (InfoTip), a button or a link inside a ClickableCard or SelectableCard no longer makes the whole card look pressed, since that tap doesn't open the card. Tapping the card itself still looks pressed.
  • Mouse and pen users: nothing changes.
  • App builders: useClickableContainer returns onPointerDown beside onClick and onMouseUp. On your own container that paints its press with usePressFeedback, spreading it drops a finger press that starts on a nested control. If you don't spread it, everything works as before.

Owner's words, mapped to the code

Owner's words Where it is
"card container applies pressure appearance when tapping the info card within it" Reproduced on main in real Chrome at 390 px touch: under a finger on the "i", the card gets data-astryx-press="on".
"UseClickableContainer might need to interact with pressed states in the same way" / "Yeah we can update useClickableContainer" useClickableContainer returns onPointerDown. It decides with the same hasInteractiveAncestor(target, container) test that onClick uses for activation.
"dont show pressed state on card if tapping some interactive element inside it wont actually activate the card" For a finger press (pointerType === 'touch') that starts on a nested control, onPointerDown calls cancelPress(container), so the press controller drops the card's paint before it shows.

Scope: touch only

The owner's words are about tapping, so this pull request ships the touch half only. With a mouse or pen, the cards paint exactly as on main: a press on a nested control still shows the card's :active look. The mouse half (the cards' :active paint excluding a press on a nested control) is a separate draft pull request, waiting for the owner's decision.

Will it cause issues?

  • An app that doesn't spread onPointerDown: nothing changes for it. The return value only gains a field, and existing destructuring ({onClick, onMouseUp}) is unaffected.
  • Inside Astryx: only the finger pressed look of ClickableCard, SelectableCard, Item's delegated rows and TreeList's link rows changes, and only for presses that start on a nested control. Click, navigation, focus, hover, keyboard, mouse and pen paths are untouched.
  • The delegated control still presses the row: a finger on the control a container delegates to (interactiveRef, for example a CheckboxListItem's checkbox) is the container's own action, so the row still paints. A test covers this.
  • Composition: ClickableCard and SelectableCard chain their handler with a caller's onPointerDown (chainEventHandlers): both run, and a test covers it. Item chains it with the caller's handler on delegated rows.

Consumers of useClickableContainer

  • Spread onPointerDown (they paint a press): ClickableCard, SelectableCard, Item (delegated rows), TreeListItem (link rows).
  • Not spread (no pressed state to suppress):
    • TokenLink, useOverlay and FileInput.
    • useInputContainer: it returns the hook's result, so its type gains the field.

What changes

  • hooks/useClickableContainer.ts: onPointerDown, a callback for finger presses only, with no effect and no new hook.
  • utils/pressFeedback.ts: cancelPress(element), internal, ends the controller's press on that element.
  • ClickableCard, SelectableCard, Item and TreeListItem: spread onPointerDown. The cards' styles are unchanged.
  • Records:
    • ClickableCard FR5 and SelectableCard FR4 state the touch rule, and that a mouse press keeps the :active paint;
    • Item FR9 states it for delegated rows, and TreeList FR7 for link rows;
    • ClickableCard's Public contract names the hook's onPointerDown;
    • useClickableContainer.doc.mjs documents it.
  • Changeset: patch [feat]. api-report: only the added onPointerDown field on ClickableContainerResult.

Evidence

  • Real Chrome, 390 px touch: a finger on the "i" inside the card goes from pressed look (main) to at rest. A finger on the card surface shows the pressed look before and after.
  • Desktop: the card's paint is checked to be identical to main for a mouse press on the "i" and on the surface.
  • Tests:
    • ClickableCard.nestedPress.test.tsx: finger on an InfoTip, button and link inside the card, the card's own surface, and a caller's onPointerDown;
    • useClickableContainer.test.tsx: finger on nested control cancels the press; mouse and pen presses don't; neither does a surface press or a disabled container;
    • Item.nestedPress.test.tsx: delegated control versus another control.
  • No added effects or hooks: both greps in git diff main -- packages/core/src return 0.

Main merges

This branch merged current main twice with no change to its own product diff. The last merge resolved one header line in utils/pressFeedback.ts against main's AlertDialog change. The touch path is unchanged since the owner's phone check.

Writing rubric results

The rubric in docs/contributing/spec-writing.md was run over ClickableCard FR5 and Public contract, SelectableCard FR4, Item FR9 and TreeList FR7.

  • R1, state the system: each states, in the present tense, that a finger press starting on a nested interactive element shows no pressed paint, and that a mouse press keeps the :active paint.
  • R2, research: none added.
  • R3, evidence cites facts: verification rows cite the test files.
  • R4, rejected alternatives: none.
  • R5, no pull request or issue references: none.
  • R6, open questions: none.

…hat starts on a control inside it

A press on a button, link or InfoTip inside a ClickableCard or SelectableCard
does not open the card, yet the card looked pressed: a mouse's :active
reaches every ancestor of the pressed element, and the touch press
controller painted the nearest pressable surface, the card.

useClickableContainer returns onPointerDown beside onClick and onMouseUp. It
applies the test onClick uses (hasInteractiveAncestor): for a press that
starts on a nested interactive element, it marks the container for the press
(privateAttributes/nestedPress.stylex.ts) and cancels the press controller's
paint on it (cancelPress). The cards' mouse press arm, now in
nestedPressStyles.cardPressOverlay, stays at rest while the mark is on.
ClickableCard and SelectableCard spread it, composed with a caller's
onPointerDown; Item's delegated rows and TreeList's link rows spread it too.
A container that does not spread it works as before.
@vercel

vercel Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
astryx Ready Ready Preview Nov 4, 2026 11:40am UTC

Request Review

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

astracat-bot Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

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

@github-actions github-actions Bot added the needs:design-review Affects visuals — Design should review label Nov 3, 2026
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Nov 3, 2026
@cixzhang

cixzhang commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

/approve-spec 076f4e9

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

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 05c71e9

Storybook · Sandbox · built from this PR's head

Modified components

Component Size LoC Visual · A11y · RTL
TreeList · Storybook 39.0 kB (+99 B) · 5.0 kB CSS (0) 1,154 (+2) ✗ · ✓ · ✓
RadioList 🔴 43.0 kB (+2.3 kB) · 6.9 kB CSS (+590 B) — — · — · —
Field 🔴 41.6 kB (+2.3 kB) · 6.9 kB CSS (+590 B) — — · — · —
127 more components
Component Size LoC Visual · A11y · RTL
FieldLabel 🔴 37.6 kB (+2.2 kB) · 5.4 kB CSS (+595 B) — — · — · —
Overlay 21.1 kB (+1.3 kB) · 4.0 kB CSS (0) — — · — · —
InputGroup 42.6 kB (+1.1 kB) · 7.3 kB CSS (0) — — · — · —
CheckboxList 44.2 kB (+1.1 kB) · 7.5 kB CSS (0) — — · — · —
TextArea 47.8 kB (+1.1 kB) · 8.8 kB CSS (0) — — · — · —
Slider 89.6 kB (+1022 B) · 8.3 kB CSS (0) — — · — · —
lab/Comments 259.2 kB (+574 B) · 2.5 kB CSS (0) — — · — · —
lab/ListInput 82.4 kB (+446 B) · 1.6 kB CSS (0) — — · — · —
lab/CommentThread 253.9 kB (+429 B) · 2.4 kB CSS (0) — — · — · —
charts/Chart 140.4 kB (+356 B) · 494 B CSS (0) — — · — · —
BreadcrumbItem 67.7 kB (+187 B) · 10.8 kB CSS (0) — — · — · —
Markdown 145.2 kB (+159 B) · 18.4 kB CSS (0) — — · — · —
Toast 59.2 kB (+157 B) · 9.0 kB CSS (0) — — · — · —
lab/CommentComposer 104.6 kB (+121 B) · 1.9 kB CSS (0) — — · — · —
ClickableCard · Storybook 15.0 kB (+116 B) · 7.0 kB CSS (0) 269 (+7) ✓ · ✓ · —
lab/TransferListSelector 82.8 kB (+114 B) · 1.9 kB CSS (0) — — · — · —
DateTimeInput 168.0 kB (+108 B) · 17.2 kB CSS (0) — — · — · —
DateInput 147.3 kB (+107 B) · 15.5 kB CSS (0) — — · — · —
ContextMenuItem 20.2 kB (+106 B) · 5.6 kB CSS (0) — — · — · —
SelectorOption 17.0 kB (+106 B) · 5.4 kB CSS (0) — — · — · —
SelectableCard · Storybook 15.1 kB (+97 B) · 7.2 kB CSS (0) 393 (+7) ✓ · ✓ · —
DropdownMenuRadioItem 18.7 kB (+94 B) · 5.9 kB CSS (0) — — · — · —
Pagination 86.7 kB (+93 B) · 16.1 kB CSS (0) — — · — · —
DropdownMenuCheckboxItem 18.7 kB (+91 B) · 5.9 kB CSS (0) — — · — · —
charts/ChartTooltip 117.0 kB (+89 B) · 423 B CSS (0) — — · — · —
DropdownMenuSubMenu 56.8 kB (+87 B) · 8.9 kB CSS (0) — — · — · —
Token 25.6 kB (+86 B) · 4.8 kB CSS (0) — — · — · —
DropdownMenuItem 17.9 kB (+85 B) · 5.5 kB CSS (0) — — · — · —
Item · Storybook 13.6 kB (+82 B) · 4.9 kB CSS (0) 1,609 (+10) ✓ · ✓ · —
lab/ChatReactionBar 66.4 kB (+81 B) · 1.1 kB CSS (0) — — · — · —
AlertDialog 83.3 kB (+79 B) · 13.1 kB CSS (0) — — · — · —
Selector 77.9 kB (+68 B) · 15.7 kB CSS (0) — — · — · —
MoreMenu 73.0 kB (+59 B) · 15.6 kB CSS (0) — — · — · —
TopNavMenu 58.2 kB (+59 B) · 9.9 kB CSS (0) — — · — · —
lab/ChatEmojiPicker 65.8 kB (+57 B) · 773 B CSS (0) — — · — · —
lab/TourStep 57.9 kB (+57 B) · 590 B CSS (0) — — · — · —
DropdownMenu 72.8 kB (+47 B) · 15.6 kB CSS (0) — — · — · —
lab/TransferList 75.2 kB (+45 B) · 1.7 kB CSS (0) — — · — · —
PowerSearch 236.2 kB (+37 B) · 21.8 kB CSS (0) — — · — · —
LayerProvider 62.9 kB (+26 B) · 9.4 kB CSS (0) — — · — · —
MobileNav 51.8 kB (+21 B) · 9.3 kB CSS (0) — — · — · —
Popover 51.8 kB (+15 B) · 12.8 kB CSS (0) — — · — · —
TabMenu 55.6 kB (+9 B) · 9.8 kB CSS (0) — — · — · —
lab/Schedule 60.2 kB (+6 B) · 3.9 kB CSS (0) — — · — · —
charts/ChartLegend 34.4 kB (+2 B) · 224 B CSS (0) — — · — · —
CommandPaletteInput 26.9 kB (+1 B) · 7.4 kB CSS (0) — — · — · —
Avatar 34.4 kB (0) · 5.4 kB CSS (0) — — · — · —
AvatarGroup 37.1 kB (0) · 5.5 kB CSS (0) — — · — · —
ChatMessageList 22.8 kB (0) · 6.9 kB CSS (0) — — · — · —
ChatToolCalls 25.9 kB (0) · 8.2 kB CSS (0) — — · — · —
Collapsible 23.3 kB (0) · 4.5 kB CSS (0) — — · — · —
CommandPaletteItem 10.3 kB (0) · 3.6 kB CSS (0) — — · — · —
Heading 7.9 kB (0) · 4.9 kB CSS (0) — — · — · —
InfoTip 36.8 kB (0) · 5.0 kB CSS (0) — — · — · —
Outline 22.2 kB (0) · 4.2 kB CSS (0) — — · — · —
SegmentedControlItem 10.6 kB (0) · 4.0 kB CSS (0) — — · — · —
Spinner 18.5 kB (0) · 5.7 kB CSS (0) — — · — · —
Step 28.2 kB (0) · 5.6 kB CSS (0) — — · — · —
Tab 11.6 kB (0) · 4.2 kB CSS (0) — — · — · —
Text 7.4 kB (0) · 4.9 kB CSS (0) — — · — · —
Timer 9.5 kB (0) · 5.9 kB CSS (0) — — · — · —
TopNavItem 10.9 kB (0) · 4.0 kB CSS (0) — — · — · —
TopNavMegaMenuItem 11.0 kB (0) · 4.2 kB CSS (0) — — · — · —
ContextMenu 74.1 kB (−1 B) · 15.5 kB CSS (0) — — · — · —
ProgressBar 10.8 kB (−2 B) · 6.2 kB CSS (0) — — · — · —
Timestamp 21.3 kB (−2 B) · 8.9 kB CSS (0) — — · — · —
TopNavHeading 58.4 kB (−3 B) · 9.7 kB CSS (0) — — · — · —
HoverCard 19.2 kB (−4 B) · 3.9 kB CSS (0) — — · — · —
AppShell 70.5 kB (−7 B) · 12.2 kB CSS (0) — — · — · —
Tooltip 20.2 kB (−11 B) · 3.9 kB CSS (0) — — · — · —
Carousel 49.4 kB (−12 B) · 9.5 kB CSS (0) — — · — · —
TableCell 75.3 kB (−14 B) · 15.9 kB CSS (0) — — · — · —
CheckboxListItem 53.2 kB (−15 B) · 10.0 kB CSS (0) — — · — · —
ListItem 52.5 kB (−15 B) · 10.0 kB CSS (0) — — · — · —
DateRangeInput 71.2 kB (−22 B) · 11.2 kB CSS (0) — — · — · —
TableHeaderCell 74.9 kB (−25 B) · 15.6 kB CSS (0) — — · — · —
Tokenizer 69.4 kB (−31 B) · 17.1 kB CSS (0) — — · — · —
SideNavHeading 58.9 kB (−48 B) · 9.9 kB CSS (0) — — · — · —
Lightbox 52.1 kB (−49 B) · 9.1 kB CSS (0) — — · — · —
TopNav 53.3 kB (−49 B) · 9.6 kB CSS (0) — — · — · —
SideNav 70.8 kB (−50 B) · 10.1 kB CSS (0) — — · — · —
StatusDot 22.4 kB (−51 B) · 5.2 kB CSS (0) — — · — · —
Switch 86.9 kB (−59 B) · 9.5 kB CSS (0) — — · — · —
CommandPalette 51.1 kB (−63 B) · 12.3 kB CSS (0) — — · — · —
richtext/RichTextEditorToolbar 224.9 kB (−79 B) · 454 B CSS (0) — — · — · —
MultiSelector 73.0 kB (−80 B) · 15.3 kB CSS (0) — — · — · —
richtext/RichTextView 258.3 kB (−93 B) · 2.3 kB CSS (0) — — · — · —
RadioListItem 50.9 kB (−94 B) · 9.0 kB CSS (0) — — · — · —
Table 83.6 kB (−94 B) · 16.1 kB CSS (0) — — · — · —
TopNavMegaMenu 53.9 kB (−99 B) · 10.6 kB CSS (0) — — · — · —
SegmentedControl 81.5 kB (−106 B) · 6.7 kB CSS (0) — — · — · —
ChatComposer 61.1 kB (−124 B) · 10.6 kB CSS (0) — — · — · —
lab/EmojiPicker 70.3 kB (−125 B) · 722 B CSS (0) — — · — · —
Typeahead 62.7 kB (−130 B) · 11.2 kB CSS (0) — — · — · —
CodeBlock 58.8 kB (−133 B) · 10.0 kB CSS (0) — — · — · —
ChatComposerTokenElement 59.0 kB (−134 B) · 10.0 kB CSS (0) — — · — · —
ChatComposerInput 59.0 kB (−135 B) · 10.0 kB CSS (0) — — · — · —
BaseTypeahead 54.9 kB (−139 B) · 9.6 kB CSS (0) — — · — · —
DrawerHeader 47.9 kB (−146 B) · 11.6 kB CSS (0) — — · — · —
TableSelectionToolbar 54.4 kB (−167 B) · 11.8 kB CSS (0) — — · — · —
Banner 46.8 kB (−169 B) · 9.2 kB CSS (0) — — · — · —
lab/DiffViewer 70.8 kB (−170 B) · 2.1 kB CSS (0) — — · — · —
DialogHeader 47.7 kB (−174 B) · 10.2 kB CSS (0) — — · — · —
TimeInput 131.4 kB (−185 B) · 14.5 kB CSS (0) — — · — · —
MobileNavToggle 45.2 kB (−186 B) · 8.7 kB CSS (0) — — · — · —
IconButton 44.9 kB (−190 B) · 8.7 kB CSS (0) — — · — · —
CheckboxInput 48.2 kB (−192 B) · 8.7 kB CSS (0) — — · — · —
ChatDictationButton 45.4 kB (−195 B) · 8.8 kB CSS (0) — — · — · —
ChatSendButton 45.3 kB (−198 B) · 8.7 kB CSS (0) — — · — · —
Button 44.8 kB (−199 B) · 8.7 kB CSS (0) — — · — · —
AvatarGroupOverflow 38.4 kB (−201 B) · 5.5 kB CSS (0) — — · — · —
lab/CommentPin 46.7 kB (−203 B) · 1.2 kB CSS (0) — — · — · —
Thumbnail 49.1 kB (−208 B) · 10.3 kB CSS (0) — — · — · —
ToggleButton 45.8 kB (−209 B) · 8.8 kB CSS (0) — — · — · —
SideNavItem 54.4 kB (−210 B) · 9.8 kB CSS (0) — — · — · —
SideNavCollapseButton 45.7 kB (−240 B) · 8.8 kB CSS (0) — — · — · —
ChatLayoutScrollButton 45.4 kB (−247 B) · 8.9 kB CSS (0) — — · — · —
Calendar 54.0 kB (−250 B) · 9.3 kB CSS (0) — — · — · —
ChatLayout 48.0 kB (−253 B) · 9.3 kB CSS (0) — — · — · —
Stepper 46.4 kB (−258 B) · 8.9 kB CSS (0) — — · — · —
Link 42.3 kB (−271 B) · 6.9 kB CSS (0) — — · — · —
TextInput 52.5 kB (−271 B) · 9.9 kB CSS (0) — — · — · —
lab/SelectableCardGroup 50.0 kB (−272 B) · 162 B CSS (0) — — · — · —
FileInput 53.3 kB (−310 B) · 9.7 kB CSS (0) — — · — · —
ComplexSelector 55.3 kB (−362 B) · 10.4 kB CSS (0) — — · — · —
NumberInput 54.6 kB (−363 B) · 10.1 kB CSS (0) — — · — · —
richtext/RichTextEditor 277.9 kB (−384 B) · 2.6 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) before frame after frame diff frame
TreeList · Basic (neutral, light) before frame after frame diff frame

Package size: @astryxdesign/core 6.32 MB packed (+1.7 kB); no new dependencies.

API changes: core +1 · ~0 · −0

Committed API report behind this build: cli 8 rows, theme-butter 1 row, theme-chocolate 1 row, theme-gothic 1 row, theme-matcha 1 row, theme-neutral 1 row, theme-stone 1 row, theme-y2k 1 row; run pnpm api:report.

1 API change (advisory)
Package Where Signature Usage
+ core . · Types · interface ClickableContainerResult onPointerDown: (event: PointerEvent<HTMLElement>) => void import type {ClickableContainerResult} from '@astryxdesign/core'; const x: ClickableContainerResult = {onPointerDown: …}

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

…m records the rule and its mouse gap

A press on a delegated row's own control, such as a CheckboxListItem's
checkbox, is the row's action, so the row still paints for it. Item FR9
states the rule for delegated rows and records the mouse gap: the shared
overlay's :active still paints a row under a nested control.
@cixzhang

cixzhang commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

/approve-spec b3ae1a8

@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 is waiting on an engineering owner's spec decision, and one wording fix is needed.

The ClickableCard, SelectableCard and Item record changes are approved at this head, but two additions have no governing spec yet:

  • TreeList link rows stop painting a touch press when the finger lands on a control in Start or End content. The TreeList record covers those controls' activation, not their press paint.
  • useClickableContainer returns onPointerDown, a new public API member that no record decides.

A maintainer needs to provide or identify the governing spec for both. The alternative is to keep onPointerDown internal and leave TreeList as it is. An engineering owner then records the decision by commenting /approve-spec <full head SHA>; the author may do so if they are an engineering owner.

Blocking:

  • The changeset and the hook's docs say that spreading onPointerDown gives an app's own container the same behavior, but the mouse half relies on a private style, so an app container keeps its mouse pressed look; please describe what ships (cards for mouse and touch, other containers touch-only through usePressFeedback) and narrow the title to clickable cards.

[Automated review]

'@astryxdesign/core': patch
---

[feat] A clickable card no longer shows its pressed look when a press starts on a control inside it, such as an info button, a button, or a link, since that press does not open the card. `useClickableContainer` returns `onPointerDown` beside `onClick` and `onMouseUp`; spread it on the container to get the same behavior in your own clickable container. A container that does not spread it works as before.

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.

This promises app containers the same behavior, but it does not hold for a mouse. Spreading onPointerDown only drops a touch press on a usePressFeedback surface. The mouse half needs the private nestedPressStyles, so an app container keeps its :active pressed look. Suggested wording: "ClickableCard and SelectableCard no longer show their pressed look when a press starts on a control inside them, such as an info button, a button, or a link. useClickableContainer returns onPointerDown; on a container that paints its press with usePressFeedback, spreading it drops a touch press that starts on a nested control. A mouse :active press paint is unchanged."

Comment thread docs/specs/components/Item/Item.spec.md Outdated
| FR6 | `first-line` MUST hold in every density, in `stacked` and `inline` layouts, with `labelLines` truncation, and in plain, button, link, link-root, delegated, and parent-role rows. In right-to-left text it MUST produce the same block-axis placement with the slots mirrored by logical order and no DOM reordering. | `architecture:internationalization` | settled |
| FR7 | The `item` theme target MUST reflect the resolved alignment as its existing `align` selector axis, including `first-line`, and Item's public theming metadata MUST list that value. No new target, state, or theme-level default is added. | `architecture:component-theming-surface/INV6`; `component:Item/DEC-2` | settled |
| FR8 | ListItem, RadioListItem, and CheckboxListItem MUST expose `align` with Item's values and default and forward it unchanged to the Item row they render. A composing row MUST NOT drop, remap, or narrow the value. | Owner direction | settled |
| FR9 | A delegated row (`interactiveRef`) shows its pressed paint only for a press that would activate it: a press on the row's surface or on the control it delegates to paints the row, and a press that starts on another interactive element inside the row paints none. Implementation gap: a mouse press on a nested control inside a delegated row still paints the row's pressed overlay; the touch path is fixed. | Owner direction, 2026-11-03: no pressed state on a container for a press that does not activate it |

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: this row has three cells in a four-column table, so FR9's "Draft review state" is blank. The other rows say settled.

…em FR9 name the link and delegated rows' press

Cards drop the press look for mouse and touch. Another container that
spreads onPointerDown drops only a usePressFeedback touch press: the mouse
half uses the cards' private style.
@cixzhang cixzhang changed the title fix(core): a clickable container shows no pressed state for a press that starts on a control inside it fix(ClickableCard, SelectableCard): no pressed look for a press that starts on a control inside the card Nov 3, 2026
@cixzhang

cixzhang commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

/approve-spec 581b4de

@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 fix is needed before approval.

The ClickableCard, SelectableCard, Item and TreeList record changes, including the new onPointerDown on useClickableContainer's result, are approved at this head, and the tests back each claim.

Blocking:

  • markNestedPress adds its own window pointerup and pointercancel listeners (packages/core/src/privateAttributes/nestedPress.stylex.ts:36-37), but Core routes window input listeners through subscribeInput in utils/inputStream.ts (react-component-runtime INV16), so please subscribe there and unsubscribe when the mark clears.

The branch also conflicts with main at the ../utils import in SelectableCard.tsx and needs a rebase. The other notes in the review are optional.

[Automated review]

Comment on lines +36 to +37
view.addEventListener('pointerup', unmark, true);
view.addEventListener('pointercancel', unmark, true);

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.

Blocking: these are new window listeners outside Core's shared input stream. subscribeInput in utils/inputStream.ts is the one entry for window input listeners in Core (react-component-runtime INV16), and the press controller already hears pointerup and pointercancel through it. Subscribe there and unsubscribe when the mark clears:

const stops = [
  subscribeInput(view, 'pointerup', unmark),
  subscribeInput(view, 'pointercancel', unmark),
];
function unmark() {
  container.removeAttribute(NESTED_PRESS);
  stops.forEach(stop => stop());
}

Comment thread packages/core/src/Item/Item.tsx Outdated
{...(isDelegate
? {
onPointerDown: chainEventHandlers(
swipeHandlers?.onPointerDown ?? restProps.onPointerDown,

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: swipeHandlers is always undefined here, because hasSwipe requires !isDelegate, so this can be restProps.onPointerDown alone.

…tream

markNestedPress subscribes to the press's end through subscribeInput, as
every Core window input listener does. Item's delegated root reads the
caller's onPointerDown alone: a delegated row has no swipe.
# Conflicts:
#	packages/core/src/SelectableCard/SelectableCard.tsx
@cixzhang

cixzhang commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

/approve-spec 01ac710

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

Recommending approval. The record changes are owner-approved at this head, the earlier window-listener issue now goes through subscribeInput, and the new tests show that the cards no longer look pressed for a press on a nested control while a press on the card itself still does.

Optional follow-ups:

  • onPointerDown in useClickableContainer marks the container for any pointer button. Returning early unless event.button === 0 would stop a right-click whose pointerup a context menu swallows from leaving the card's next mouse press unpainted.
  • The new press clauses in SelectableCard FR4 and TreeList FR7 have no committed test yet; one case each would keep them from regressing.

[Automated review]

return {onClick, onMouseUp};
// The press-state counterpart of onClick's rule: a press that would not
// activate the container shows no press on it.
const onPointerDown = useCallback(

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: this callback runs for every pointer button, while :active and the press controller follow only the primary button (pressFeedback.ts checks event.button === 0). A secondary-button press on a nested control marks the container. If a context menu swallows the pointerup, as macOS browsers do, the mark stays until the next pointerup, and the next mouse press on the card's surface shows the hover tint. Returning early unless event.button === 0 avoids that; touch and pen presses report 0.

@cixzhang
cixzhang marked this pull request as ready for review November 3, 2026 21:41
@cixzhang

cixzhang commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

/approve-spec 2e26090

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

This pull request needs one engineering-owner decision before it can be approved; no blocking code defect was found.

  • Newly live check: desktop behavior change needs an owner decision. Under a desktop mouse, a press that starts on a control inside a ClickableCard or SelectableCard now leaves the card at its hover tint instead of the pressed overlay (packages/core/src/privateAttributes/nestedPress.stylex.ts lines 56 and 64), with no touch gate; either an engineering owner records the decision for this desktop change, or the cards' mouse arm is gated to touch input so only the touch half ships.

The record changes are owner-approved at this head, and the new tests fail on the base and pass here. Optional: onPointerDown in useClickableContainer could return early unless event.button === 0, so a right-click whose pointerup a context menu swallows cannot leave the card's next press unpainted, and one SelectableCard and one TreeList test would cover their new press clauses.

[Automated review]

default: 'transparent',
':where(:not(:disabled,[aria-disabled="true"]))': {
default: null,
':active:not([data-astryx-nested-press])': {

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.

This arm and the one at line 64 change what a desktop mouse press paints: a press that starts on a nested control now leaves the card at its hover tint (Chromium: overlay 0.1 to 0.05). The mouse half needs an engineering owner's recorded decision; otherwise gate it to touch input and ship the touch half only.

github-actions Bot added a commit that referenced this pull request Nov 4, 2026
…that compose its styles

useClickableContainer imports only markNestedPress from the nested-press
owner module and paints nothing from it, so the guard now asks only the
files that import one of a module's stylex.create exports to be marked.
@cixzhang

cixzhang commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

/approve-spec be7a1ca

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

This pull request needs one engineering-owner decision before it can be approved; no blocking code defect was found.

  • Newly live check: desktop behavior change needs an owner decision. Under a desktop mouse, a press that starts on a control inside a ClickableCard or SelectableCard now leaves the card at its hover tint instead of the pressed overlay (packages/core/src/privateAttributes/nestedPress.stylex.ts lines 56 and 64, with no touch gate); either an engineering owner records the decision for this desktop change in words, since an /approve-spec of the record text does not by itself settle it, or the cards' mouse arm is gated to touch input so only the touch half ships.

The record changes are owner-approved at this head, the narrowed touch-coverage guard is sound and passes, and the new tests fail on the base and pass here. Optional: onPointerDown in useClickableContainer could return early unless event.button === 0, one SelectableCard and one TreeList test would cover their new press clauses, and one doc comment in pressableCoverage.test.ts moved away from its function.

[Automated review]

.map(([file]) => file);
}

/** Files that import the module at `file` (by its relative specifier). */

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: this JSDoc belongs to importers below (line 122). The new helpers landed between them, so styleExports now carries two doc comments and importers none. Move this line back above importers.

A secondary press paints nothing, and a context menu can swallow its
pointerup, which would leave the mark on. The pressableCoverage helper
doc comments sit above their functions again.
@cixzhang

cixzhang commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

/approve-spec 9dbdb49

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

This pull request needs one engineering-owner decision before it can be approved; no code defect was found.

  • Newly live check: desktop behavior change needs an owner decision. With a mouse, a press that starts on a control inside a ClickableCard or SelectableCard now leaves the card at its hover tint instead of its pressed tint (packages/core/src/privateAttributes/nestedPress.stylex.ts lines 56 and 64, applied in ClickableCard.tsx and SelectableCard.tsx), and nothing gates it to touch input; either cite the owner decision that covers this desktop half, or gate those two arms to touch input so only the touch half ships.

The record changes (ClickableCard FR5, SelectableCard FR4, Item FR9 and TreeList FR7) are approved at this head, and the touch fix for the cards, Item's delegated rows and TreeList's link rows is covered by tests that fail before the change. Optional: one SelectableCard test and one TreeList test for the new press clauses would keep them from regressing.

[Automated review]

# Conflicts:
#	packages/core/src/utils/pressFeedback.ts
…keeps main's paint

The owner's words are about tapping, so useClickableContainer's onPointerDown
acts only on a finger press. The cards keep their own :active press colour,
the nested-press owner module goes, and the pressableCoverage guard returns
to main's. ClickableCard FR5, SelectableCard FR4, Item FR9 and TreeList FR7
state the touch rule and that a mouse press keeps the :active paint.
# Conflicts:
#	docs/specs/components/TreeList/TreeList.spec.md
@github-actions github-actions Bot added needs:spec-owner-review Current knowledge records await owner approval and removed needs:design-review Affects visuals — Design should review labels Nov 4, 2026
@cixzhang

cixzhang commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

/approve-spec 05c71e9

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

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Changes requested: one wording fix before approval.

  • The title says a press that starts on a control inside the card shows no pressed look, but this head changes only a finger press (a mouse or pen press there still paints the card, as the body and changeset say), so please retitle it, for example "fix(ClickableCard, SelectableCard): no touch pressed look for a finger press that starts on a control inside the card".

The record changes (ClickableCard FR5 and its contract row, SelectableCard FR4, Item FR9 and TreeList FR7) are approved at this head, and the touch fix is covered by tests that fail before the change. Optional: one SelectableCard test and one TreeList test for the new press clauses would keep them from regressing.

[Automated review]

@cixzhang cixzhang changed the title fix(ClickableCard, SelectableCard): no pressed look for a press that starts on a control inside the card fix(ClickableCard, SelectableCard): no touch pressed look for a finger press that starts on a control inside the card Nov 4, 2026

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved pending CI: the heavy test and build suites have not run on this head yet; they run before merge.

The title now matches the change, a finger press only, which was the one fix requested last time. The record changes (ClickableCard FR5 and its contract row, SelectableCard FR4, Item FR9 and TreeList FR7) are approved at this head, and the new tests fail before the change and pass after it.

  • Optional: one SelectableCard test and one TreeList test for the new press clauses would keep them from regressing; Item FR9's verification row also cites the ClickableCard test, which renders no Item.

[Automated review]

github-actions Bot added a commit that referenced this pull request Nov 4, 2026
@cixzhang
cixzhang merged commit f59ffe1 into main Nov 4, 2026
101 of 104 checks passed
@github-actions
github-actions Bot deleted the lane4/clickable-nested-press branch November 5, 2026 06:03

This branch was successfully deployed

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant