Skip to content

fix(CheckboxListItem): a row answers a finger the same wherever it lands - #8212

Merged
cixzhang merged 1 commit into
meta:mainfrom
vjeux:uikit/c06-press-surface
Nov 5, 2026
Merged

cixzhang merged 1 commit into
meta:mainfrom
vjeux:uikit/c06-press-surface

Conversation

@vjeux

@vjeux vjeux commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

User impact

On a phone, a CheckboxList row lights differently by where the finger lands: on the label the whole row paints and the box stays blank, on the 24 px box only the box paints. Now a finger anywhere on a toggleable row paints the row and its box together, as a native table cell highlights.

Evidence

iOS 26.2 Mobile Safari (ring = finger) and Android 15 Chrome (dot), 0.4 s holds, on this PR's earlier code; Testing's browser contract proves this head. Before is main:

Path Before After
On the box: only the box lit; now the row before after
On the label: the box stayed blank; now it paints before after
Android, on the label before after

A checkbox in a row's content keeps its own press (before, it painted with the row):

Before After
before after
Android before Android after

Problem and solution fit

The row and its CheckboxInput both carry the press marker; the touch press paints the innermost one.

Under a coarse primary pointer, a row that delegates its surface clicks to its checkbox is the only touch press surface; a fine pointer keeps main's:

  • A layer-scoped internal context (CheckboxRowPressContext) keeps the row's checkbox unmarked, so the shared controller finds the row (Item marks it). Rows read the pointer through useTouchPresentation (FR24).
  • Each such row declares its own press paint; the box reads its nearest row's, so row and box fade as one and nothing outside reaches it. The arms live in privateAttributes/press.stylex.ts; pressableCoverage.test.ts counts a ListItem given interactiveRef as marked.

Expected behavior and authority

  • design:user-states (current), DR1: a CheckboxInput's indicator paints during a hold. Kept: now wherever the finger lands.
  • component:CheckboxListItem (current), AR3 and FR9: the row surface is the checkbox's pointer target. AR3 records the owner's pass for a finger held on the box.
  • spec:AST-017 FR59 and architecture:component-style-authoring INV4: a fine pointer's behavior stays, and a box answers only its own row.
  • UIKit: a cell's highlight covers the whole cell.

Smallest restoration

  • Touch only; mouse press and hover unchanged; no public API. Size: 1,402 added lines, 1,100 of them tests.
  • A checkbox in the row's content keeps its own press.
  • A first-party indicator with its own press (an internal marker) takes the row's paint, as the box does.
  • useMediaQuery: the same answers for all 16 callers, one listener per query; Safari before 14 gets the older listener pair, not a throw.

#8219 is stacked on this PR.

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.

Testing

This head, c5286dd, is the change on main 2ea8f68. Under a finger, Item's row layer turns off the press strength's release on the row, so the box's paint stayed at full strength through the release. The row now brings that release back (interactionOverlayStyles.pressedAlpha, as press.stylex.ts prescribes), and the box fades with the row. Earlier moves with main:

  • Main's row press layer landed privateAttributes/press.stylex.ts first. rowPressPaintStyles now sits, unchanged, beside rowPressLayerStyles in that one owner module, whose header names both.
  • Main's stubMatchMedia answers pointer queries from a pointer option, so the CheckboxList coarse-pointer cases ask for pointer: 'coarse'.
  • Two comment sentences are split to 25 words or fewer.

On top: component:CheckboxListItem AR3 carries the owner's pass verbatim, with a verification row and a verified_by entry for CheckboxListPress.a11y.chromium.spec.ts. Three optional review trims remove two useMediaQuery comments, the row-paint comment's narration and an unused spec helper. Apart from these and this head's release fix (one row style and its two test cases), every changed line matches 3c1715d, and the merge into main is clean.

  • The release, red first: the new Chromium case holds the release with the harness's timer gate and reads the box half way. On the previous head's build the box kept alpha 0.102 while the row's layer stood at 0.60 (it fails); at this head the box's share equals the layer's. The new unit case fails on the previous head's row (an animation-name: none rule on its fading arm under a coarse pointer) and passes here.
  • At this head: test:ui 813 files, 20,223 tests; CheckboxListPress 7 of 7 (the release case included), Checkbox 37 of 37 and CheckboxList 1 of 1 in Chromium on a Storybook built and stamped here; main's TouchTargets interaction spec 7 of 7 in Chromium and in WebKit; core tsc 0; ESLint 0 problems and Prettier clean on the changed files; check:knowledge, the repo checks, sync-exports --check, the CLI API types and review:pre: clean.

The full gates ran at 5c817d8 (same product), on main a814877:

  • pnpm build (no generated drift), verify-exports, pnpm typecheck and pnpm review:pre: clean. The api-report check fails on main's own two stale useLongPress rows (fixed separately); this PR changes no public API.
  • pnpm lint on the changed files and CI's repo checks: sync-exports --check, check-use-client, copyright, the CLI API types, token docs, the production registry gate, check-knowledge, check:repo, check:i18n-runtime, check:motion-roles, check:changesets and changeset coverage: clean.
  • Units: useMediaQuery (one listener per query for all callers, a change moves every caller, the older listener pair), coarsePointer, touchPresentation, CheckboxList, CheckboxInput, pressableCoverage, customPropertyArmLayering, derivedVarRegistry, serverSafeComponents, gestures, the touch components and the folder of every useMediaQuery caller: 5,866 of 5,866. Red first: on main's useMediaQuery, one listener per query and the older pair fail; three CheckboxList cases fail on main's CheckboxInput and CheckboxListItem; without the coverage rule, "press.stylex.ts carries the marker" fails.
  • Browser specs in Chromium for useMediaQuery's touch callers: the Switch, Slider and SegmentedControl interaction specs, 127 of 127; the Item swipe and BottomSheet contracts, 47 of 47.
  • The full unit suite: 19,457 of 19,457. Repo-wide strict lint: 0 errors.

Writing rubric results

R1 narration: none; the AR3 sentence states what the row does, and the dated parenthetical is the owner's attribution, verbatim.
R2 research: none.
R3 evidence: the new verification row names test files and cases.
R4 rejected alternatives: none.
R5 change references: none.
R6 open questions: none changed.

@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 Nov 4, 2026 11:46pm UTC

Request Review

@astracat-bot

astracat-bot Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 5, 2026, 12:21 AM UTC

@github-actions github-actions Bot added the needs:design-review Affects visuals — Design should review 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
@github-actions

github-actions Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · c5286dd

Storybook · Sandbox · built from this PR's head

Modified components

Component Size LoC Visual · A11y · RTL
CheckboxListItem 58.6 kB (+494 B) · 10.6 kB CSS (+117 B) — — · — · —
Markdown 152.3 kB (+327 B) · 19.1 kB CSS (+146 B) — — · — · —
ListItem 57.6 kB (+235 B) · 10.6 kB CSS (+117 B) — — · — · —
112 more components
Component Size LoC Visual · A11y · RTL
ContextMenu 81.8 kB (+202 B) · 16.2 kB CSS (+144 B) — — · — · —
lab/CommentThread 264.6 kB (+337 B) · 2.4 kB CSS (0) — — · — · —
lab/Comments 269.8 kB (+332 B) · 2.5 kB CSS (0) — — · — · —
TableCell 83.0 kB (+186 B) · 16.6 kB CSS (+135 B) — — · — · —
TableHeaderCell 82.5 kB (+173 B) · 16.4 kB CSS (+135 B) — — · — · —
Table 91.1 kB (+150 B) · 16.8 kB CSS (+121 B) — — · — · —
DropdownMenuItem 20.1 kB (+185 B) · 6.0 kB CSS (+80 B) — — · — · —
DropdownMenu 77.2 kB (+112 B) · 16.3 kB CSS (+141 B) — — · — · —
BreadcrumbItem 71.0 kB (+169 B) · 11.3 kB CSS (+79 B) — — · — · —
MoreMenu 77.5 kB (+105 B) · 16.3 kB CSS (+141 B) — — · — · —
DropdownMenuCheckboxItem 20.8 kB (+166 B) · 6.4 kB CSS (+77 B) — — · — · —
SelectorOption 19.0 kB (+167 B) · 5.8 kB CSS (+76 B) — — · — · —
DropdownMenuRadioItem 20.9 kB (+161 B) · 6.4 kB CSS (+77 B) — — · — · —
Item 15.7 kB (+160 B) · 5.3 kB CSS (+77 B) — — · — · —
MultiSelector 79.4 kB (+174 B) · 15.5 kB CSS (+61 B) — — · — · —
PowerSearch 246.4 kB (+109 B) · 22.5 kB CSS (+123 B) — — · — · —
DropdownMenuSubMenu 59.3 kB (+142 B) · 9.3 kB CSS (+74 B) — — · — · —
RadioListItem 55.9 kB (+152 B) · 9.5 kB CSS (+61 B) — — · — · —
ContextMenuItem 23.9 kB (+126 B) · 6.0 kB CSS (+78 B) — — · — · —
charts/Chart 165.1 kB (+190 B) · 494 B CSS (0) — — · — · —
Selector 82.2 kB (+112 B) · 16.2 kB CSS (+66 B) — — · — · —
lab/Schedule 63.4 kB (+165 B) · 3.9 kB CSS (0) — — · — · —
Overlay 21.6 kB (+164 B) · 3.9 kB CSS (0) — — · — · —
Pagination 91.0 kB (+88 B) · 16.5 kB CSS (+73 B) — — · — · —
lab/ThreeDChart 5.0 kB (+161 B) · 20 B CSS (0) — — · — · —
lab/TransferList 79.2 kB (+148 B) · 1.7 kB CSS (0) — — · — · —
ProgressBar 11.0 kB (+144 B) · 6.2 kB CSS (0) — — · — · —
CheckboxInput · Storybook 53.0 kB (+83 B) · 8.9 kB CSS (+42 B) 444 (+20) — · ✓ · —
lab/TransferListSelector 86.3 kB (+124 B) · 1.9 kB CSS (0) — — · — · —
richtext/RichTextEditorToolbar 232.8 kB (+121 B) · 454 B CSS (0) — — · — · —
Toast 60.4 kB (+106 B) · 9.0 kB CSS (0) — — · — · —
LayerProvider 64.2 kB (+105 B) · 9.4 kB CSS (0) — — · — · —
TopNavHeading 60.8 kB (+104 B) · 9.8 kB CSS (0) — — · — · —
CommandPalette 58.3 kB (+103 B) · 12.3 kB CSS (0) — — · — · —
SideNavHeading 61.4 kB (+103 B) · 10.0 kB CSS (0) — — · — · —
Popover 55.0 kB (+100 B) · 12.7 kB CSS (0) — — · — · —
Carousel 52.5 kB (+99 B) · 9.5 kB CSS (0) — — · — · —
SideNavItem 56.5 kB (+97 B) · 9.8 kB CSS (0) — — · — · —
lab/ListInput 84.9 kB (+97 B) · 1.6 kB CSS (0) — — · — · —
lab/CommentComposer 108.5 kB (+96 B) · 1.9 kB CSS (0) — — · — · —
BottomSheet 55.8 kB (+95 B) · 7.5 kB CSS (0) — — · — · —
Drawer 40.9 kB (+94 B) · 8.2 kB CSS (0) — — · — · —
SegmentedControl 83.7 kB (+94 B) · 6.7 kB CSS (0) — — · — · —
richtext/RichTextView 263.1 kB (+90 B) · 2.3 kB CSS (0) — — · — · —
lab/TourStep 60.9 kB (+88 B) · 590 B CSS (0) — — · — · —
DateRangeInput 74.2 kB (+86 B) · 11.2 kB CSS (0) — — · — · —
DateTimeInput 175.0 kB (+86 B) · 17.2 kB CSS (0) — — · — · —
TreeList 40.8 kB (+8 B) · 5.4 kB CSS (+77 B) — — · — · —
lab/ChatEmojiPicker 68.7 kB (+85 B) · 773 B CSS (0) — — · — · —
Slider 92.2 kB (+84 B) · 8.3 kB CSS (0) — — · — · —
AlertDialog 89.7 kB (+83 B) · 13.1 kB CSS (0) — — · — · —
TopNavMegaMenu 55.9 kB (+83 B) · 10.6 kB CSS (0) — — · — · —
Tokenizer 73.6 kB (+80 B) · 17.1 kB CSS (0) — — · — · —
DateInput 153.0 kB (+78 B) · 15.5 kB CSS (0) — — · — · —
lab/ChatReactionBar 69.2 kB (+77 B) · 1.1 kB CSS (0) — — · — · —
TopNavMenu 60.7 kB (+75 B) · 9.9 kB CSS (0) — — · — · —
AppShell 75.0 kB (+74 B) · 12.2 kB CSS (0) — — · — · —
TimeInput 139.9 kB (+70 B) · 14.5 kB CSS (0) — — · — · —
ChatLayout 49.8 kB (+69 B) · 9.2 kB CSS (0) — — · — · —
Switch 89.8 kB (+64 B) · 9.5 kB CSS (0) — — · — · —
richtext/RichTextEditor 282.7 kB (+35 B) · 2.6 kB CSS (0) — — · — · —
SideNav 75.5 kB (+19 B) · 10.1 kB CSS (0) — — · — · —
BottomSheetSwitcher 17.4 kB (+18 B) · 3.4 kB CSS (0) — — · — · —
lab/CommentPin 48.3 kB (+18 B) · 1.2 kB CSS (0) — — · — · —
Dialog 22.0 kB (+17 B) · 6.7 kB CSS (0) — — · — · —
ClickableCard 16.5 kB (+16 B) · 6.9 kB CSS (0) — — · — · —
Lightbox 54.6 kB (+15 B) · 9.1 kB CSS (0) — — · — · —
Tab 13.1 kB (+15 B) · 4.2 kB CSS (0) — — · — · —
TopNav 58.1 kB (+15 B) · 9.6 kB CSS (0) — — · — · —
Step 29.6 kB (+14 B) · 5.6 kB CSS (0) — — · — · —
AvatarGroupOverflow 40.1 kB (+13 B) · 5.4 kB CSS (0) — — · — · —
Outline 23.5 kB (+13 B) · 4.1 kB CSS (0) — — · — · —
SelectableCard 16.6 kB (+13 B) · 7.2 kB CSS (0) — — · — · —
lab/SelectableCardGroup 51.7 kB (+12 B) · 162 B CSS (0) — — · — · —
SegmentedControlItem 12.1 kB (+11 B) · 4.0 kB CSS (0) — — · — · —
Thumbnail 50.9 kB (+11 B) · 10.2 kB CSS (0) — — · — · —
TopNavMegaMenuItem 12.5 kB (+11 B) · 4.2 kB CSS (0) — — · — · —
ChatComposer 63.1 kB (+10 B) · 10.5 kB CSS (0) — — · — · —
MobileNav 56.4 kB (+10 B) · 9.3 kB CSS (0) — — · — · —
Collapsible 24.6 kB (+9 B) · 4.5 kB CSS (0) — — · — · —
TableSelectionToolbar 56.1 kB (+9 B) · 11.8 kB CSS (0) — — · — · —
TopNavItem 12.4 kB (+9 B) · 4.0 kB CSS (0) — — · — · —
lab/DiffViewer 72.7 kB (+9 B) · 2.1 kB CSS (0) — — · — · —
CommandPaletteItem 11.7 kB (+7 B) · 3.6 kB CSS (0) — — · — · —
DialogHeader 49.4 kB (+7 B) · 10.2 kB CSS (0) — — · — · —
Link 44.1 kB (+7 B) · 6.8 kB CSS (0) — — · — · —
ChatLayoutScrollButton 47.1 kB (+6 B) · 8.9 kB CSS (0) — — · — · —
FileInput 55.1 kB (+6 B) · 9.6 kB CSS (0) — — · — · —
NumberInput 56.5 kB (+6 B) · 10.1 kB CSS (0) — — · — · —
TextInput 54.3 kB (+6 B) · 9.9 kB CSS (0) — — · — · —
Banner 48.5 kB (+5 B) · 9.2 kB CSS (0) — — · — · —
DrawerHeader 49.6 kB (+5 B) · 11.6 kB CSS (0) — — · — · —
TabMenu 58.0 kB (+5 B) · 9.8 kB CSS (0) — — · — · —
ToggleButton 47.5 kB (+5 B) · 8.8 kB CSS (0) — — · — · —
Token 27.2 kB (+5 B) · 4.7 kB CSS (0) — — · — · —
lab/EmojiPicker 72.1 kB (+5 B) · 722 B CSS (0) — — · — · —
BaseTypeahead 56.9 kB (+4 B) · 9.6 kB CSS (0) — — · — · —
Button 46.5 kB (+4 B) · 8.7 kB CSS (0) — — · — · —
IconButton 46.6 kB (+4 B) · 8.7 kB CSS (0) — — · — · —
SideNavCollapseButton 47.4 kB (+4 B) · 8.7 kB CSS (0) — — · — · —
Typeahead 64.8 kB (+4 B) · 11.2 kB CSS (0) — — · — · —
ComplexSelector 57.3 kB (+3 B) · 10.4 kB CSS (0) — — · — · —
Stepper 48.2 kB (+3 B) · 8.9 kB CSS (0) — — · — · —
ChatDictationButton 47.1 kB (+2 B) · 8.8 kB CSS (0) — — · — · —
MobileNavToggle 46.9 kB (+2 B) · 8.7 kB CSS (0) — — · — · —
Calendar 55.7 kB (+1 B) · 9.3 kB CSS (0) — — · — · —
ChatSendButton 47.0 kB (+1 B) · 8.7 kB CSS (0) — — · — · —
CodeBlock 60.5 kB (+1 B) · 10.0 kB CSS (0) — — · — · —
Timestamp 21.4 kB (+1 B) · 8.9 kB CSS (0) — — · — · —
CheckboxList 45.4 kB (0) · 7.5 kB CSS (0) — — · ✓ · —
ChatComposerInput 61.1 kB (−6 B) · 10.0 kB CSS (0) — — · — · —
ChatComposerTokenElement 61.1 kB (−6 B) · 10.0 kB CSS (0) — — · — · —

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

API changes: none in this pull request

Committed API report behind this build: cli 9 rows, core 4 rows; run pnpm api:report.

Wide change (shared styles: packages/core/src/theme/derivedVarRegistry.test.ts): add ci:run-visual or ci:run-rtl to run them.


Generated by PR Enrichment workflow | View full report

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

The label-hold half of this change restores the indicator paint that design:user-states DR1 asks for, but approval waits on one direction decision and one fix. No current spec says a finger on the checkbox box should also paint the whole CheckboxListItem row (component:CheckboxListItem AR3/FR9 are still draft), so an engineering owner needs to settle whether a click-delegating row is its checkbox's single touch press surface and record that by commenting /approve-spec <full head SHA> on this pull request; the author may do so if they are an engineering owner. Separately, the checkboxRowPressScope arms in CheckboxInput.tsx (lines 122-135) also paint any CheckboxInput placed in the row's end content while the row is held, which architecture:component-style-authoring INV4 rules out, so please apply them only to the row's own checkbox and add an assertion for that nested case.

[Automated review]

Comment on lines +122 to +135
[stylex.when.ancestor(
'[data-astryx-press="on"]',
checkboxRowPressScope,
)]: {
default: null,
'@media (pointer: coarse)': pressedOverlayImage,
},
[stylex.when.ancestor(
'[data-astryx-press="fading"]',
checkboxRowPressScope,
)]: {
default: null,
'@media (pointer: coarse)': pressedOverlayImage,
},

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.

These two arms ship in every CheckboxInput, and stylex.when.ancestor matches any ancestor that carries checkboxRowPressScope. A CheckboxInput a caller places in the row's endContent (or a rich label or description) inherits the row's press strength and paints whenever the row is held under touch, which architecture:component-style-authoring INV4 rules out. Composing these arms only when CheckboxRowPressContext is true (for example in a second overlay style that repeats the indicatorScope arms) keeps the paint on the row's own checkbox.

Comment on lines +1291 to +1294
const nested = screen.getByRole('checkbox', {name: 'Daily digest'});
const nestedSurface = nested.closest('[data-astryx-pressable]');
expect(nestedSurface).not.toBeNull();
expect(nestedSurface?.tagName).not.toBe('LI');

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 checks where the nested checkbox's marker sits, but not that a row press leaves its box unpainted, which is where it currently fails. jsdom cannot resolve the ancestor arm, so the Chromium spec may be the better place: hold the row's label and assert the end-content checkbox's overlay stays at rest.

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

The label-hold half of this change restores the indicator paint that design:user-states DR1 asks for, but approval still waits on one direction decision and one fix. No current spec says a finger on the checkbox box should also paint the whole CheckboxListItem row (component:CheckboxListItem AR3/FR9 are still draft), so an engineering owner needs to settle whether a click-delegating row is its checkbox's single touch press surface and record that by commenting /approve-spec <full head SHA> on this pull request; the author may do so if they are an engineering owner. Separately, the checkboxRowPressScope arms in CheckboxInput.tsx (lines 122-135) still paint any CheckboxInput placed in the row's content while the row is held, as the new "Checkbox in a row's content" story shows, which architecture:component-style-authoring INV4 rules out: please apply them only to the row's own checkbox and add a Chromium assertion that holding the row leaves the nested box at rest.

[Automated review]

@vjeux
vjeux force-pushed the uikit/c06-press-surface branch from 167d6cc to ee258f3 Compare October 24, 2026 22:51
@cixzhang

Copy link
Copy Markdown
Contributor

Posted by Cindy's agent on her behalf.

Parts of this PR re-implement behavior that already exists, or is being specified, as a shared part of core. Converging keeps one implementation per behavior:

This is about where the behavior lives, not about the PR's intent.

@vjeux

vjeux commented Oct 24, 2026

Copy link
Copy Markdown
Contributor Author

Agreed: one implementation.

  • Touch gating: the row-press arms and their own (pointer: coarse) checks are gone. The row's own box now paints the press paint it inherits from the row (--_press-paint-image, which the shared overlay style declares), so this PR adds no touch check of its own. Commit c409f28, in the next push.
  • Press feedback: the row is pressed only by the shared controller (utils/pressFeedback.ts; Item marks the row and declares its paint), the box paints that paint, and the new marker file and its arms are gone. What stays is the one boolean the row gives its own checkbox so that checkbox carries no press marker, which lets the controller's innermost-wins rule find the row. Same commit and push.

@vjeux

vjeux commented Oct 24, 2026

Copy link
Copy Markdown
Contributor Author

Pushed in c409f28: the box paints the row's shared press paint, and the row-press marker, its arms and their coarse-pointer checks are gone.

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

The label-hold half of this change restores the indicator paint that design:user-states DR1 asks for, and the earlier nested-checkbox leak is fixed, but approval still waits on one direction decision and one fix. No current spec says a finger on the checkbox box should also paint the whole CheckboxListItem row (component:CheckboxListItem AR3/FR9 are still draft), so approval needs an engineering owner to settle, as governing spec, whether a click-delegating row is its checkbox's single touch press surface; an engineering owner records that by commenting /approve-spec <full head SHA> on this pull request, and the author may do so if they are an engineering owner. Separately, indicatorRowPressOverlay in CheckboxInput.tsx paints the row's press under every pointer, so a pen held on the box of a fine-pointer page stacks it on the box's own :active overlay and the box reads darker than the row (#C3C3C3 against #D9D9D9 on main). Please stop that double paint, for example with the @media (pointer: coarse) condition the scope arms beside it already carry, and add a fine-pointer pen case to the Chromium spec.

[Automated review]

Comment on lines +133 to +137
indicatorRowPressOverlay: {
'::after': {
backgroundImage: pressedOverlayImage,
},
},

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 adds the row's press paint to the box under every pointer. The controller presses the row for a pen too (it skips only mice), while the box's :active overlay above still paints under a fine pointer, so a pen held on the box of a fine-pointer page paints the box twice: #C3C3C3, against #D9D9D9 on main and for a mouse, beside a #E5E5E5 row. Giving this the same @media (pointer: coarse) condition as the scope arms above (backgroundImage: {default: null, '@media (pointer: coarse)': pressedOverlayImage}) brings the pen back to #D9D9D9 and keeps both touch holds painting the row and the box #E5E5E5; if that condition is off the table, the :active overlay has to yield while the row is pressed instead.

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

Holding a finger on a CheckboxList row's label now paints its checkbox, as design:user-states DR1 asks, but approval waits on one direction decision and one fix. No current spec says a finger on the checkbox box should also paint the whole row (component:CheckboxListItem AR3/FR9 are still draft), so approval needs an engineering owner to settle, as governing spec, whether a click-delegating row is its checkbox's single touch press surface; an engineering owner records that by commenting /approve-spec <full head SHA> on this pull request, and the author may do so if they are an engineering owner. Separately, indicatorRowPressOverlay in CheckboxInput.tsx paints the row's press paint with no press arm of its own, so a pen held on the box of a fine-pointer page stacks it on the box's :active overlay (against spec:AST-017 FR59), and a CheckboxList inside a pressed ClickableCard darkens every toggleable box; please key that paint to the row's own press and add Chromium cases for both.

[Automated review]

// arms: this checkbox's own container is never pressed.
indicatorRowPressOverlay: {
'::after': {
backgroundImage: pressedOverlayImage,

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 paints the row's press paint with no press arm of its own, so it follows any press strength that reaches the row. A pen held on the box of a fine-pointer page stacks it on the :active overlay above (#C3C3C3, against #D9D9D9 on main and for a mouse; spec:AST-017 FR59), and a CheckboxList inside a pressed ClickableCard darkens every box (#CECECE against the card's #E5E5E5). Keying it to the row's own data-astryx-press, under the coarse pointer the box's existing touch arms already require, fixes both.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in d56edd7. The box's row-press paint is now keyed to the row's own data-astryx-press, through a row press scope the row applies, under a coarse pointer like the box's own touch arms. A pen on a fine-pointer page now paints the box as a mouse does, and a pressed ClickableCard leaves its list's boxes to the card's tint. Both are new Chromium cases that fail without the commit.

* Does the layer over the box paint the press paint it inherits from the
* row, on no press arm of its own (no `data-astryx-press`, no `:active`)?
*/
function paintsInheritedPress(wrapper: Element): boolean {

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 asserts the armless paint behind both defects on CheckboxInput.tsx:135. Once the paint is keyed to the row's own press, this check has to follow, and the Chromium spec is the place to hold a pen on a fine-pointer page and a finger on a ClickableCard that holds a CheckboxList.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Followed in d56edd7. The check now requires the paint to be keyed to the row's own press under a coarse pointer, and finds no paint without a press arm. The Chromium spec holds a pen on a fine-pointer page and a finger on a ClickableCard that holds a CheckboxList (a new story).

@cixzhang
cixzhang marked this pull request as ready for review November 4, 2026 12:13
@vjeux
vjeux force-pushed the uikit/c06-press-surface branch from 9efcb5f to 3c1715d Compare November 4, 2026 12:16
@cixzhang
cixzhang marked this pull request as draft November 4, 2026 12:18
@cixzhang

cixzhang commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

/approve-spec 3c1715d

@cixzhang
cixzhang marked this pull request as ready for review November 4, 2026 12:18

@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 CI workflow on this head stopped at its runner capacity ceiling ("CI is full") before the build and tests ran, so its jobs need a re-run; Lint and the CLI smoke test passed.

Holding a finger anywhere on a CheckboxList row now presses the row and paints its checkbox with it, mouse and trackpad presses are unchanged, and the box-hold behaviour carries an engineering owner's /approve-spec for this head. A later push needs that approval again unless the rule is added beside component:CheckboxListItem AR3.

Non-blocking:

  • Trim the comments at useMediaQuery.ts:23, :29 and press.stylex.ts:14-15 to the reason they carry, and delete the unused pressablesInList helper and the stray doc comment at line 58 of the Chromium press spec.
  • The commit message still names utils/touchPointerStore.ts, which this head does not have, and the description's Testing section calls the previous commit "this head"; reword both if they land as written.

[Automated review]

import {useCallback, useSyncExternalStore} from 'react';
import {watchMediaQuery} from '../utils/coarsePointer';

/** The callers of one query, and how to stop its one watch. */

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 comment restates the two SharedWatch fields; the names already say it, so it can go.

stop: () => void;
}

/** Every watched query: all callers of a query share one watch. */

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 repeats the file header ("Every caller of a query shares one watch.") and the hook's JSDoc; it can go.

}

/** How many pressable elements the list holds. */
async function pressablesInList(page: Page): Promise<number> {

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: pressablesInList is never called (ESLint warns); delete it, and the stray doc comment at line 58 left from a removed constant.

@cixzhang
cixzhang marked this pull request as draft November 4, 2026 12:50
@cixzhang
cixzhang marked this pull request as ready for review November 4, 2026 12:50
@cixzhang
cixzhang marked this pull request as draft November 4, 2026 14:29
@cixzhang
cixzhang marked this pull request as ready for review November 4, 2026 14:29
@vjeux
vjeux marked this pull request as draft November 4, 2026 19:32
@vjeux
vjeux force-pushed the uikit/c06-press-surface branch from 3c1715d to c047fea Compare November 4, 2026 19:52

@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 waits on one engineering-owner decision at this head; no code change is required.

  • Under a coarse primary pointer, a finger held on a click-delegating CheckboxListItem row's checkbox box now presses and paints the whole row (on main only the box paints), which no current spec covers (component:CheckboxListItem AR3 makes the row the checkbox's touch target, not a touch on the box a press of the row), and the earlier /approve-spec for it named the head before this rebase.

An engineering owner, the author included, records that decision by commenting /approve-spec <full head SHA> on this pull request, or by adding the rule to component:CheckboxListItem beside AR3 so later pushes keep it. The label-hold half already follows design:user-states DR1, and mouse and trackpad presses are unchanged. The inline notes are optional clean-ups.

[Automated review]

import {useCallback, useSyncExternalStore} from 'react';
import {watchMediaQuery} from '../utils/coarsePointer';

/** The callers of one query, and how to stop its one watch. */

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.

Optional: this comment restates the two SharedWatch fields, and the one on line 29 repeats the file header. Both can go.

Comment on lines +245 to +247
// None at rest. Under a coarse pointer it is the press paint while the row
// itself is pressed or its press fades out. A box reads its nearest row's
// value, so a list in a row's content keeps its own rows' paint.

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.

Optional: the first two sentences narrate the arms below. Keep only "A box reads its nearest row's value, so a list in a row's content keeps its own rows' paint."

}

/** How many pressable elements the list holds. */
async function pressablesInList(page: Page): Promise<number> {

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.

Optional: nothing calls pressablesInList (ESLint warns). The doc comment on line 58 is also left over from a removed constant.

@vjeux
vjeux force-pushed the uikit/c06-press-surface branch from c047fea to f8d9b28 Compare November 4, 2026 20:42
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Nov 4, 2026
@cixzhang

cixzhang commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

/approve-spec f8d9b28

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

Approved pending CI: CI has not run on this head yet, and it starts once the pull request leaves draft.

Holding a finger anywhere on a toggleable CheckboxList row now presses the row and paints its checkbox with it, mouse and trackpad presses look exactly as before, and the box-hold rule added to component:CheckboxListItem AR3 carries an engineering owner's /approve-spec for this head. Nothing blocks.

Optional wording fixes:

  • The new AR3 verification row lists "a mouse press that paints the row" as a failure, but the Chromium spec it cites expects the row to darken under a mouse press; "a mouse press that runs the touch press" says what the test checks.
  • The "(owner pass, 2026-11-04)" parenthetical in AR3 describes how the sentence came about rather than what the row does, which the spec-writing rubric (R1) keeps out of records.

[Automated review]

| Contract | Verification | Representative states | Mutation or failure expectation | Audit section |
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------- |
| FR1, FR9, AR2, AR3 | `CheckboxList.test.tsx` single-tab-stop, row-click, link-in-label, and interactive end-content cases | Collection option; row-surface click; link in a rich label; interactive end content | A second tab stop, lost delegation, or a toggle from an interactive descendant fails. | `audit:CheckboxListItem/interaction` |
| AR3 (finger) | `CheckboxList.test.tsx` press-surface cases; `CheckboxListPress.a11y.chromium.spec.ts` | Coarse and fine pointer; label, description and box; nested checkbox | A finger on the box that paints only the box, a mouse press that paints the row, or a nested checkbox pressing the row fails. | `audit:CheckboxListItem/interaction` |

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.

Optional: "a mouse press that paints the row" reads as a failure the cited spec contradicts: CheckboxListPress.a11y.chromium.spec.ts expects the row to darken under a mouse press on the label and on the box (lines 304 and 307). Suggest "a mouse press that runs the touch press".

MUST follow the same availability and change rules as pointer activation.
- **AR3 — Enlarged target.** The row surface MUST act as the checkbox's pointer
and touch target without becoming a second control.
Under a coarse pointer, a finger held on the box of a click-delegating row presses and paints the whole row, as a press on the row does (owner pass, 2026-11-04).

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.

Optional: "(owner pass, 2026-11-04)" records how the sentence came about (rubric R1); the approval already lives on this pull request. "Under a coarse primary pointer" would also match the condition the code tests.

* SSR-safe media query hook that subscribes to window.matchMedia changes
* via useSyncExternalStore — the canonical React pattern for external
* browser state.
* browser state. Every caller of a query shares one watch.

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.

Optional: this repeats the hook's JSDoc ("All callers of the same query share one listener."); one of the two is enough.

'@astryxdesign/core': patch
---

[fix] `useMediaQuery` now shares one listener per query among all its callers, so a long list of components that ask the same query adds one listener, not one per component. Every caller still reads the same answer. It also listens on Safari before 14, which has only the older listener pair, where it threw 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.

Optional: Safari before 14 is below the supported browsers, so naming it promises nothing a consumer can rely on. "It also listens where a media query list has only addListener, where it threw before" keeps the note accurate.

@cixzhang

cixzhang commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

/approve-spec baf5eaa

@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: a finger anywhere on a CheckboxList row now presses the row and its box together, but the box's press no longer fades when the finger lifts.

  • Miss: under a coarse pointer the box keeps its full pressed overlay through the whole release and then drops it while the row fades, because Item's row press layer (rowPressLayerStyles.cell) turns off the strength release that --_checkbox-row-press-paint reads; compose interactionOverlayStyles.pressedAlpha on the row while it owns the press (as press.stylex.ts describes for a row whose descendant fades at the row's strength) and add a Chromium case that reads the box during the release.

The direction is settled: the box-hold sentence in component:CheckboxListItem AR3 is approved at this head. CI has not run on this head yet.

[Automated review]

xstyle={
[
// The row's own press paint, which the layer over its box reads.
rowOwnsPress && rowPressPaintStyles.checkboxRow,

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.

Under a coarse pointer this row also composes Item's rowPressLayerStyles.cell, which sets the row's animationName to none while fading (press.stylex.ts:119) and fades its ::before layer instead. So --astryx-press-alpha stays at 1 for the whole release, and the var(--_press-paint-image) this paint hands the box stays at full strength: measured in Chromium, the box keeps alpha 0.102 on every release frame and then drops, while the row layer fades 1 → 0.07 (on main a box hold faded 0.102 → 0.007). Composing interactionOverlayStyles.pressedAlpha here as well while rowOwnsPress (it lands after Item's cell) gives the strength its release back, as press.stylex.ts:112-115 describes; restoring that release in the page made the box fade in step with the row layer. A Chromium case that reads the box during the release would hold it.

Under a finger, pressing a CheckboxList row's label painted the whole
row, while pressing its box painted only the box: the row and the
CheckboxInput it hosts were two press surfaces, and the touch press
paints the innermost one. A row that delegates its surface clicks to
its checkbox is now the one touch press surface
(CheckboxRowPressContext), so the label, the description and the box
press the same element. The box paints from the row's press at the
row's strength, as a radio row's circle does, and only from its own
row's press. The row owns its checkbox's press only under a coarse
primary pointer: a mouse's press and hover stay the checkbox's own, and
a checkbox in a row's content stays at rest while the row is held.
Every row reads useTouchPresentation().isTouch, and useMediaQuery now
shares one listener per query among all its callers (watchMediaQuery
in utils/coarsePointer.ts).

component:CheckboxListItem AR3 records the owner's pass: a finger held
on the box of a click-delegating row presses and paints the whole row.
@cixzhang

cixzhang commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

/approve-spec c5286dd

@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: CI is still running on this head, and the merge waits for its required checks.

A finger anywhere on a toggleable CheckboxList row now presses the row and paints its checkbox with it, and the box now fades with the row when the finger lifts. Mouse and fine-pointer presses are unchanged, and the box-hold rule added to component:CheckboxListItem AR3 carries an engineering owner's approval.

Optional, non-blocking: the new AR3 (finger) verification row lists "a mouse press that paints the row" as a failure, though the mouse case expects the row to darken; "a mouse press that runs the touch press" says what fails (a record edit needs a fresh /approve-spec).

[Automated review]

| Contract | Verification | Representative states | Mutation or failure expectation | Audit section |
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------- |
| FR1, FR9, AR2, AR3 | `CheckboxList.test.tsx` single-tab-stop, row-click, link-in-label, and interactive end-content cases | Collection option; row-surface click; link in a rich label; interactive end content | A second tab stop, lost delegation, or a toggle from an interactive descendant fails. | `audit:CheckboxListItem/interaction` |
| AR3 (finger) | `CheckboxList.test.tsx` press-surface cases; `CheckboxListPress.a11y.chromium.spec.ts` | Coarse and fine pointer; label, description and box; nested checkbox | A finger on the box that paints only the box, a mouse press that paints the row, or a nested checkbox pressing the row fails. | `audit:CheckboxListItem/interaction` |

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: "a mouse press that paints the row" reads as a failure, but the mouse case in CheckboxListPress.a11y.chromium.spec.ts expects the row to darken (hover and :active). "A mouse press that runs the touch press" says what fails. Editing the record needs a fresh /approve-spec.

* SSR-safe media query hook that subscribes to window.matchMedia changes
* via useSyncExternalStore — the canonical React pattern for external
* browser state.
* browser state. Every caller of a query shares one watch.

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 header sentence repeats the JSDoc at line 60 ("All callers of the same query share one listener"); one of them is enough.

This branch was successfully deployed

1 active deployment
Preview — c5286dd5 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

ci:run A maintainer lets this outside contributor's pull request run CI (AST-030 FR17) ci:run-a11y Run the accessibility suite on this PR; write access, next push (AST-030 FR12) 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.

3 participants