Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report
Generated by PR Enrichment workflow | View current CI run |
There was a problem hiding this comment.
Thanks — the read-only gate does what the description says: a held finger on a read-only checkbox now leaves the box at its resting pixels, a held mouse leaves only the hover tint, and enabled and disabled presses are unchanged. Approval waits on one spec decision, because design:user-states DR1 still requires every non-disabled checkbox to paint the press and the DR2 amendment for read-only proposed in the description has not been approved; any engineering owner (you are one) or design owner can record it by commenting /approve-spec <full head SHA> here or by amending the record on main. Separately, the stacked #8212 commit makes a CheckboxInput placed in a CheckboxList row's content paint whenever the row is pressed under a finger, because the new checkboxRowPressScope arms in CheckboxInput.tsx apply to every checkbox; scoping them to the row's own checkbox in #8212 and rebasing this branch fixes it.
[Automated review]
| [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, | ||
| }, |
There was a problem hiding this comment.
Under a finger, these two checkboxRowPressScope arms paint every CheckboxInput inside a row that owns the press, not only the row's own checkbox: indicatorPressOverlay is applied whenever paintsPress holds, and CheckboxRowPressContext is never consulted for it. A CheckboxInput in a row's endContent therefore paints whenever the row is pressed (255 to 229 with the finger on the row's label). Moving these two arms into their own style, applied only when paintsPress && isRowPressSurface, keeps a nested checkbox independent, as CheckboxRowPressContext.ts intends.
There was a problem hiding this comment.
Thanks — the read-only gate does what the description says: a held finger now leaves a read-only checkbox at its resting pixels, a held mouse leaves only the hover tint, and enabled and disabled presses are unchanged. Approval waits on one spec decision, because design:user-states DR1 still requires every non-disabled checkbox in its matrix to paint the press and the DR2 amendment for read-only proposed in the description has not been approved; any engineering owner (you are one) or design owner can record it by commenting /approve-spec <full head SHA> on this pull request or by amending the record on main. Separately, the stacked #8212 commit makes a CheckboxInput placed in a CheckboxList row's content paint whenever the row is pressed under a finger, because the checkboxRowPressScope arms in CheckboxInput.tsx apply to every checkbox; scoping them to the row's own checkbox in #8212 and rebasing this branch fixes it. Rebasing onto main also clears the red pr-a11y check, which fails only on a lab spec step that landed on main after this branch's base, while the new row press contract passes.
[Automated review]
54f803c to
fd42ae1
Compare
fd42ae1 to
c1186ca
Compare
There was a problem hiding this comment.
Thanks — on this head the read-only gate does what the description says: a held finger or mouse leaves a read-only checkbox at its resting pixels, enabled and disabled presses are unchanged, and the press that reached a checkbox placed in a row's content is fixed. Approval waits on one spec decision: design:user-states DR1 still requires every non-disabled checkbox in its matrix to paint the press, and the DR2 amendment for read-only proposed in the description has not been approved. Any engineering owner (you are one) or design owner can record that decision by commenting /approve-spec <full head SHA> on this pull request or by amending the record on main; the row-paint direction carried from #8212 is settled in that pull request.
[Automated review]
c1186ca to
63d6a22
Compare
There was a problem hiding this comment.
Thanks — on this head the read-only gate does what the description says: a held finger or mouse leaves a read-only checkbox at its resting pixels, a read-only row with its own onClick presses only as a row, and enabled and disabled presses are unchanged. Approval waits on one spec decision: design:user-states DR1 still requires every non-disabled checkbox in its matrix to paint the press, and the proposed DR2 amendment that would cover read-only controls has not been approved. Any engineering owner (you are one) or design owner can record that decision by commenting /approve-spec <full head SHA> on this pull request or by amending the record on main; the row-paint direction carried from #8212 is settled in that pull request.
[Automated review]
63d6a22 to
77b51a9
Compare
There was a problem hiding this comment.
Thanks — on this revision the read-only gate does what the description says: a held finger or mouse leaves a read-only checkbox at its resting pixels, a read-only row with its own onClick presses only as a row, and an enabled CheckboxInput, a disabled checkbox and mouse presses on editable rows behave as before. Approval waits on one spec decision, because this intentionally changes design:user-states: DR1 still requires every non-disabled checkbox in its matrix to paint the press, and the proposed DR2 amendment that would cover read-only controls has not been approved. An engineering owner records that decision by commenting /approve-spec <full head SHA> on this pull request (you may do so as an engineering owner), a design owner can do the same, or the record can be amended on main; the row-paint direction carried from #8212 is settled in that pull request.
[Automated review]
77b51a9 to
c83fcae
Compare
There was a problem hiding this comment.
Thanks — on this revision the read-only gate does what the description says: a held finger leaves a read-only checkbox at its resting pixels and a held mouse leaves only its hover tint, a read-only row with its own onClick presses only as a row, and enabled and disabled presses behave as before. Approval waits on one spec decision, because this intentionally changes design:user-states: DR1 still requires every non-disabled checkbox in its matrix to paint the press, and the proposed DR2 amendment that would cover read-only controls has not been approved. An engineering owner records that decision by commenting /approve-spec <full head SHA> on this pull request (you may do so as an engineering owner), a design owner can do the same, or the record can be amended on main; the row-paint direction carried from #8212 is settled in that pull request.
[Automated review]
There was a problem hiding this comment.
Thanks — on this revision the read-only gate does what the description says: a held finger leaves a read-only checkbox at its resting pixels, a held mouse leaves only its hover tint, a read-only row with its own onClick presses only as a row, and enabled and disabled presses behave as before. Approval waits on one spec decision, because this intentionally changes design:user-states: DR1 still requires every non-disabled checkbox in its matrix to paint the press, and the proposed DR2 amendment that would cover read-only controls has not been approved. An engineering owner records that decision by commenting /approve-spec <full head SHA> on this pull request (you may do so as an engineering owner), a design owner can do the same, or the record can be amended on main; the row-paint direction carried from #8212 is settled in that pull request, which lands first.
[Automated review]
There was a problem hiding this comment.
Thanks — on this revision the read-only gate does what the description says: a held finger or mouse leaves a read-only checkbox without the pressed overlay, a read-only row with its own onClick presses only as a row, and enabled and disabled presses behave as before. Approval waits on one spec decision, because this intentionally changes design:user-states: DR1 still requires every non-disabled checkbox in its matrix to paint the press, and the proposed DR2 amendment covering read-only controls has not been approved; an engineering owner records that decision by commenting /approve-spec <full head SHA> on this pull request (you may do so as an engineering owner), a design owner can do the same, or the record can be amended on main. Separately, the stacked #8212 change now gives every CheckboxListItem row its own (pointer: coarse) media-query listener through useMediaQuery (40 rows hold 40 listeners, on desktops too), which spec:AST-094 FR24 and architecture:react-component-runtime INV7 rule out for repeated rows; reading the touch query from one shared owner in #8212, with a test that counts listeners across many rows, fixes it.
[Automated review]
| // behavior (spec:AST-017 FR59): the box stays its own press owner, so a pen | ||
| // on a fine-pointer page presses the box, never the row. The server and | ||
| // hydrating renders take the fine-pointer answer (spec:AST-094 FR13). | ||
| const isTouch = useMediaQuery(TOUCH_QUERY, false); |
There was a problem hiding this comment.
Every row calls useMediaQuery here, and each call subscribes its own matchMedia('(pointer: coarse)') change listener, so a list of 40 rows holds 40 listeners on any device, where main holds none. spec:AST-094 FR24 says a repeated row or cell adds no touch observer of its own, and architecture:react-component-runtime INV7 rules out this fan-out when one shared owner can provide the same fact. Reading the touch query from one shared store (a single listener while any row is mounted, read through useSyncExternalStore) keeps the behaviour, and a test that mounts many rows on a fine and a coarse pointer and counts the listeners would hold it.
There was a problem hiding this comment.
Fixed at the origin, in #8212 (5be38cc), and carried here (79f78df). Every row now reads one shared subscription (utils/touchPointerStore.ts, useIsTouchPointer()): one change listener on the touch query while any row is mounted and none after the last one unmounts, read through useSyncExternalStore, with the fine-pointer answer on the server and while hydrating. A CheckboxList test mounts 40 rows on a fine and on a coarse pointer and counts the live touch-query listeners: 1 while mounted, 0 after unmounting. The previous head held 40.
There was a problem hiding this comment.
Thanks — on this revision the read-only gate does what the description says: a held finger or mouse leaves a read-only checkbox without the pressed overlay, a read-only row with its own onClick presses only as a row, enabled and disabled presses behave as before, and the per-row touch-query listener carried from #8212 is now one shared subscription. Approval waits on one spec decision, because this intentionally changes design:user-states: DR1 still requires every non-disabled checkbox in its matrix to paint the press, and the proposed DR2 amendment covering read-only controls has not been approved. An engineering owner records that decision by commenting /approve-spec <full head SHA> on this pull request (you may do so as an engineering owner), a design owner can do the same, or the record can be amended on main; the row-paint direction carried from #8212 is settled in that pull request, which lands first.
[Automated review]
|
Why this matters: approval of this pull request and of #8212 now turns on two decisions only an engineering owner can make. The automated review accepts the code on both. 1. This pull request: does a read-only control paint a press? Our reading is yes: "DR2 also covers a read-only control: it shows its value, remains inoperable, and MUST NOT gain a pressed visual treatment."
2. #8212: is the row its checkbox's touch press surface? Our reading is yes, under a coarse pointer only.
|
79f78df to
e30a7c3
Compare
There was a problem hiding this comment.
Thanks — the read-only gate does what its changeset says: a held mouse or finger now leaves a read-only checkbox without the pressed overlay, and enabled and disabled presses behave as before. Approval waits on two spec decisions, which an engineering owner records by commenting /approve-spec <full head SHA> on this pull request (you may do so as an engineering owner) or by amending the records on main: whether design:user-states DR2 should also cover read-only controls, since DR1 still requires the press on a checkbox that is not disabled, and whether, under a finger, a CheckboxList row should take the press of a finger on its own checkbox, which component:CheckboxListItem AR3 and component:List FR11 leave open. These need changes whatever the decisions:
utils/touchPointerStore.tsadds a second touch-pointer resolver besideuseTouchPresentationinutils/touchPresentation.ts, againstarchitecture:react-component-runtimeINV16, so move the shared subscription into that owner (or intouseMediaQuery) and have CheckboxListItem call it.CheckboxListItem.tsx:297callsusePressFeedback()and spreads its marker on a row that Item already marks throughinteractiveRef, a second press Effect per row against INV16, so drop both and relax the source-text rule inpressableCoverage.test.tsinstead.- The description's "Now a checkbox paints a press only when it can change" overstates the change because a busy checkbox still paints, so say "a read-only checkbox paints no press" and fix the matching comment at
CheckboxInput.tsx:377–378.
[Automated review]
| * Whether the primary pointer is coarse (a finger), from the one shared | ||
| * subscription: false on the server and while hydrating. | ||
| */ | ||
| export function useIsTouchPointer(): boolean { |
There was a problem hiding this comment.
This is a second resolver for the touch-pointer answer useTouchPresentation() already owns in utils/touchPresentation.ts. architecture:react-component-runtime INV16 asks for a shared concern to be extended in its owner: put this one shared subscription behind useTouchPresentation's isTouch (or inside useMediaQuery, one listener per query), have CheckboxListItem call that, and delete this module.
| // The row names itself pressable, so the touch press controller finds it | ||
| // and writes its press attribute. The row's press paint keys on that | ||
| // attribute (privateAttributes/press.stylex.ts). | ||
| const pressable = usePressFeedback(); |
There was a problem hiding this comment.
Item already marks this row: interactiveRef (line 350) makes it interactive, and Item calls usePressFeedback() and spreads the same marker. This second call only adds another controller-install Effect per row (INV16). Removing it and the spread at line 338 keeps every CheckboxList test green; only the source-text rule in pressableCoverage.test.ts then needs to accept an importer whose styles land on an Item it renders with interactiveRef.
| // A checkbox that cannot change paints no press: disabled, or read-only, | ||
| // whose value is shown but refuses every change. |
There was a problem hiding this comment.
A busy checkbox also cannot change, yet still paints, because paintsPress ignores isBusy. Suggested: // Disabled and read-only checkboxes paint no press. The description's "a checkbox paints a press only when it can change" needs the same narrowing.
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 one shared touch-pointer subscription (utils/touchPointerStore.ts).
A read-only CheckboxInput shows its value but refuses every change, yet a press on it painted the pressed overlay, with a mouse or a finger, telling the user the box would respond. A checkbox now paints a press only when it can change: not disabled and not read-only. In a read-only CheckboxList the boxes paint nothing; a read-only row that carries its own click handler still presses as a row, since that handler runs. A story shows a read-only CheckboxList whose rows carry a row action.
e30a7c3 to
73e042a
Compare
There was a problem hiding this comment.
Thanks — on this revision the read-only gate does what its changeset says: a held mouse or finger leaves a read-only checkbox without the pressed overlay, a read-only row with its own onClick presses only as a row, and enabled and disabled presses behave as before.
Approval waits on two spec decisions, which an engineering owner records by commenting /approve-spec <full head SHA> on this pull request (you may do so as an engineering owner) or by amending the records on main:
- An owner needs to update
design:user-statesif DR2 is to cover read-only controls, since DR1 still requires the press on a checkbox that is not disabled. - The carried #8212 change needs an owner to provide or identify the governing spec for a CheckboxList row taking the press of a finger on its own checkbox, which
component:CheckboxListItemAR3 andcomponent:ListFR11 leave open.
These need changes whatever the decisions:
utils/touchPointerStore.tsadds a second touch-pointer resolver besideuseTouchPresentationinutils/touchPresentation.ts, againstarchitecture:react-component-runtimeINV16, so move the one shared subscription into that owner (or intouseMediaQuery), call it from CheckboxListItem and delete the store.CheckboxListItem.tsx:306callsusePressFeedback()and spreads its marker on a row that Item already marks throughinteractiveRef, a second press Effect per row against INV16, so drop both and relax the source-text rule inpressableCoverage.test.tsinstead.- The description's "Now a checkbox paints a press only when it can change" overstates the change because a busy checkbox still paints, so say "a read-only checkbox paints no press" and fix the matching comment at
CheckboxInput.tsx:408–409.
[Automated review]
|
Superseded: the records keep the press paint on a read-only checkbox, and #8696 implements it. |
Stacked on #8212. Review only this PR's change: vjeux/astryx@d024a87...73e042a
User impact
A read-only CheckboxInput, or a checkbox in a read-only CheckboxList, shows its value but refuses every change. Yet pressing it painted the pressed overlay, with a mouse or a finger, which tells the user the box is about to respond. Now a checkbox paints a press only when it can change.
Evidence
iOS 26.2 Mobile Safari, a finger (the ring) held 0.4 s, recorded on this PR's earlier code; the engine runs in Testing prove this head:
Before, the box lights up; after, nothing does. A read-only row with its own
onClickstill presses as a row, and its box stays blank (after):Problem and solution fit
The fix gates the overlay, the box's own press marker, and the press image handed to an indicator that paints its own press, on "neither disabled nor read-only". In a read-only CheckboxList no box paints. A read-only row with its own click handler still presses as a row (that handler runs), but its box stays unpainted.
Expected behavior and authority
design:user-states(current), DR1: "each enabled surface in the matrix MUST paint" on hold, and DR2: a disabled control "MUST NOT gain a pressed visual treatment". A read-only control cannot change, so a press would promise a change that never comes.spec:AST-011(current), IR2: a read-only Selector "MAY remove hover, pressed, and pointer affordances that would falsely imply editability".component:CheckboxListItem(draft), FR8: a read-only group refuses every toggle.tableView(_:shouldHighlightRowAt:)returnsfalse).Smallest restoration
isReadOnlynow say "shows no pressed feedback".Scope
Testing
Local gates at 73e042a, on #8212's d024a87 (main a814877):
pnpm build(no generated drift),verify-exports,pnpm typecheckandpnpm review:pre: clean.pnpm api:report --checkflags only main's own stale Tokenizer rows; this change adds no row.pnpm linton the changed files and CI's repo checks:sync-exports --check, copyright, the CLI API types, token docs, the production registry gate,check-knowledge,check:repo,check:i18n-runtime,check:motion-roles,check:changesetsand changeset coverage: clean.Public and internal API delta
isReadOnlydescription on CheckboxInput and CheckboxList adds "shows no pressed feedback". Its type and default stay.<CheckboxInput label="Terms" isChecked isReadOnly />No export, prop, type or default changes, and no new hook or module.
Size: +153/−15 lines (d024a87..73e042a).