Repository navigation
fix(ClickableCard, SelectableCard): a mouse press on a control inside the card shows no card press (draft, for decision) - #9930
Conversation
… the card shows no card press The desktop half of the nested-press rule. A primary mouse or pen press that starts on a nested control marks the container (privateAttributes/ nestedPress.stylex.ts), and the cards' :active arm leaves out a marked card. The pressableCoverage guard counts only files that compose a styles module's stylex.create exports, since useClickableContainer imports only the marking function.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
There was a problem hiding this comment.
This needs an engineering owner's decision before it can be approved, and one code fix.
The pull request rewords ClickableCard FR5 and SelectableCard FR4 so that a mouse press starting on a control inside the card shows no card press, while the current records say the card paints its pressed overlay for mouse and touch presses. An engineering owner records the decision by commenting /approve-spec 96def65885f51205922794a1621d901f7f0d1080 on this pull request, and the author may do so as an engineering owner; what must be settled is whether the desktop mouse rule ships for both cards, and whether Item delegated rows and TreeList link rows follow.
Blocking:
- Desktop behavior change needs an owner decision: the mouse and pen mark in
useClickableContainer.ts(lines 352-356) with the cards' new:active:not([data-astryx-nested-press])arm changes what a mouse press paints for every desktop user, so either gate it to touch input or cite the decision in the description. - A pen press, or a mouse press on a touch-first device, that starts on a nested control still paints the whole card pressed because the hook cancels the press controller only for touch, so call
cancelPressfor every pointer type (marking only mouse and pen) with tests for both cases, or narrow the changeset, description and FR wording to a mouse under a fine pointer.
Non-blocking: the comment at useClickableContainer.ts lines 330-333 says the container's :active arm skips a marked container, which holds only for the two cards.
[Automated review]
| if (event.pointerType === 'touch') { | ||
| cancelPress(containerEl); | ||
| } else { | ||
| markNestedPress(containerEl); | ||
| } |
There was a problem hiding this comment.
A pen press, or a mouse press where the primary pointer is coarse, is painted by the press controller (pressFeedback.ts sends every non-mouse pointer to its finger slot, and paints a mouse press when the stylesheet drops :active). The mark only removes the :active arm, so the card still shows data-astryx-press="on" for those presses. Cancelling for every pointer type covers them:
cancelPress(containerEl);
if (event.pointerType !== 'touch') {
markNestedPress(containerEl);
}A pen case and a coarse-pointer mouse case in ClickableCard.nestedPress.test.tsx would pin it.
| // The press-state counterpart of onClick's rule: a press that would not | ||
| // activate the container shows no press on it. A finger press cancels the | ||
| // press controller's paint. A mouse or pen press marks the container, and | ||
| // the container's `:active` arm leaves out a marked container. |
There was a problem hiding this comment.
Non-blocking: only ClickableCard and SelectableCard read the mark; Item and TreeList rows still paint :active, and pen paint comes from the controller. A shorter comment that keeps the reason:
// A press that starts on a nested control does not activate the container,
// so the container shows no press. Cancel the controller's press. A card's
// `:active` arm skips a container marked for a mouse or pen press.|
(Posted by Cindy's agent.) Closing: already decided by the current ClickableCard record. FR5 keeps the card's |
|
(Posted by Cindy's agent.) Reopened: I closed this in error. It's the B option of an open owner question (keep main's press model, or adopt this behavior), so it stays open until that question is answered. |
Draft, stacked on #9801. Waiting for the owner's decision; don't merge.
What it decides
#9801 ships the touch half: a finger press that starts on a control inside a ClickableCard or SelectableCard shows no card press. This pull request adds the mouse half. A primary mouse or pen press that starts on a nested control (the "i", a button, a link) shows no card press either. The card stays at rest instead of showing its pressed overlay. A press on the card itself still looks pressed, and keyboard is unchanged.
How
useClickableContainer'sonPointerDown: for a primary mouse or pen press on a nested control, it marks the container (privateAttributes/nestedPress.stylex.ts, cleared at the press's end through Core's shared input stream). A finger press still cancels the press controller's paint.:activepress colour,nestedPressStyles.cardPressOverlayin that owner module, leaves out a marked card.stylex.createexports, sinceuseClickableContainerimports only the marking function. A case pins which imports count.[fix].Evidence
Real Chrome, 1024 px, mouse, main versus this branch:
Owner: fix-loop lane 4. Land path: Held for the owner's decision card; then the drain merges after the normal gates.