Repository navigation
feat(ToggleButtonGroup): a finger's slide toggles the one it lifts on - #8660
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
|
Posted by Cindy's agent on her behalf. Thanks for the action-group work. Two review points:
The same points apply to the ToggleButtonGroup PR (#8660). If this stays idle, we'll make the change after about 30 minutes, keeping your authorship. |
There was a problem hiding this comment.
This needs an engineering owner's decision on its governing spec before it can be approved, and it also needs changes. The ToggleButtonGroup tracking is governed only by records this branch proposes rather than ones already on main (family:action-groups FR1–FR5, architecture:interaction-modality INV13, and spec:AST-094 DEC-17 with its FR11, FR19 and FR24 amendments); any engineering owner, the author included if they are one, can record that decision by commenting /approve-spec <full head SHA> on this pull request, or the records can land through #8622 first. Whatever that decision, these still need changes:
- Against main this branch carries #8657's whole stack (32,863 authored changed lines, 449 of them this change), so please land the stack first and update the branch until the diff is the five ToggleButtonGroup files.
- Under a mouse, the toggle a press starts on keeps Button's
:active0.98 scale while the tracker lights another toggle, because a ToggleButton keepsstyles.pressableand the tracked look overrides onlybackground-image; the browser test checks only the overlay. ToggleButtonGroup.spec.mdstill says each member owns its press paint, and thespec:AST-094record conflicts with main.
[Automated review]
There was a problem hiding this comment.
This needs an engineering owner's decision on its governing spec before it can be approved, and it also needs changes. The ToggleButtonGroup tracking rests only on records this branch proposes rather than ones on main (family:action-groups FR1–FR5, architecture:interaction-modality INV13, and spec:AST-094 DEC-17 with its FR11, FR19 and FR24 amendments); any engineering owner, the author included if they are one, can record that decision by commenting /approve-spec <full head SHA> on this pull request, or the records can land on main through #8622 first. Whatever that decision, these still need changes:
- Land #8657's stack first and update the branch, since the diff against main is 31,815 authored lines of which this change is 566.
- Amend
ToggleButtonGroup.spec.md, whose PR1 says the group adds no listener, observer or measurement and whose ownership boundary leaves member paint to Button, and the fine-pointer sentence ofarchitecture:react-component-runtimeINV13. - Keep Button's
:activepress scale off the toggle a mouse press started on while another toggle is lit, and asserttransformin the browser test's mouse case. - Resolve the
spec:AST-094conflict with main.
[Automated review]
There was a problem hiding this comment.
This needs an engineering owner's decision on its governing spec before it can be approved, and it also needs changes. The ToggleButtonGroup tracking rests on records this branch proposes rather than ones on main (family:action-groups FR1–FR5, architecture:interaction-modality INV13, and spec:AST-094 DEC-17 with its FR11, FR19 and FR24 amendments); any engineering owner, the author included if they are one, can record that decision by commenting /approve-spec <full head SHA> on this pull request, or the records can land on main through #8622 first. Whatever that decision, these still need changes:
- Land #8657's stack and update the branch, since the diff against main is 31,978 authored lines of which this change is 566.
- Keep Button's
:activepress scale off the toggle a mouse press started on while another toggle is lit, and asserttransformin the browser test's mouse case. - Make
ToggleButtonGroup.spec.mdPR1, its ownership boundary andverified_bymatch the hit-area watch and the group-painted press, and amend the fine-pointer sentence ofarchitecture:react-component-runtimeINV13. - Resolve a touch on the edge of a disabled toggle to no toggle instead of its enabled neighbour.
[Automated review]
PR Analysis Report🔎 Preview ·
|
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| Button · Storybook | 59.1 kB (+35 B) · 9.9 kB CSS (0) | 689 (+2) | ✓ · ✓ · ✗ |
| ToggleButtonGroup | 🔴 39.1 kB (+32.3 kB) · 3.7 kB CSS (+288 B) | — | ✓ · ✓ · ✓ |
| ToggleButton | 🔴 85.6 kB (+25.6 kB) · 10.0 kB CSS (0) | — | ✓ · ✓ · — |
73 more components
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| richtext/RichTextEditorToolbar | 🔴 276.0 kB (+25.2 kB) · 454 B CSS (0) | — | — · — · — |
| lab/Comments | 337.9 kB (+797 B) · 2.5 kB CSS (0) | — | — · — · — |
| lab/CommentThread | 330.9 kB (+793 B) · 2.4 kB CSS (0) | — | — · — · — |
| SideNav | 110.9 kB (+57 B) · 11.3 kB CSS (0) | — | — · — · — |
| lab/ChatReactionBar | 103.6 kB (+54 B) · 1.1 kB CSS (0) | — | — · — · — |
| AlertDialog | 104.1 kB (+50 B) · 14.3 kB CSS (0) | — | — · — · — |
| CodeBlock | 73.8 kB (+48 B) · 11.2 kB CSS (0) | — | — · — · — |
| lab/Schedule | 104.5 kB (+47 B) · 3.9 kB CSS (0) | — | — · — · — |
| lab/ChatEmojiPicker | 102.4 kB (+42 B) · 773 B CSS (0) | — | — · — · — |
| Lightbox | 117.9 kB (+41 B) · 10.4 kB CSS (0) | — | — · — · — |
| SideNavItem | 69.3 kB (+41 B) · 11.0 kB CSS (0) | — | — · — · — |
| TopNavHeading | 73.8 kB (+41 B) · 11.0 kB CSS (0) | — | — · — · — |
| TableSelectionToolbar | 69.3 kB (+40 B) · 13.1 kB CSS (0) | — | — · — · — |
| Toast | 97.0 kB (+40 B) · 10.2 kB CSS (0) | — | — · — · — |
| TableCell | 107.5 kB (+39 B) · 17.5 kB CSS (0) | — | — · — · — |
| ChatComposerInput | 74.4 kB (+38 B) · 11.2 kB CSS (0) | — | — · — · — |
| ChatDictationButton | 59.7 kB (+38 B) · 10.0 kB CSS (0) | — | — · — · — |
| ChatLayout | 79.3 kB (+37 B) · 10.5 kB CSS (0) | — | — · — · — |
| DateInput | 182.8 kB (+37 B) · 16.8 kB CSS (0) | — | — · — · — |
| DrawerHeader | 62.1 kB (+37 B) · 12.8 kB CSS (0) | — | — · — · — |
| Table | 116.4 kB (+37 B) · 17.7 kB CSS (0) | — | — · — · — |
| SideNavCollapseButton | 60.0 kB (+36 B) · 10.0 kB CSS (0) | — | — · — · — |
| TopNavMenu | 73.4 kB (+36 B) · 11.1 kB CSS (0) | — | — · — · — |
| Pagination | 108.4 kB (+35 B) · 17.5 kB CSS (0) | — | — · — · — |
| lab/TransferListSelector | 113.2 kB (+35 B) · 1.9 kB CSS (0) | — | — · — · — |
| AppShell | 89.6 kB (+34 B) · 13.4 kB CSS (0) | — | — · — · — |
| ChatComposerTokenElement | 74.4 kB (+34 B) · 11.2 kB CSS (0) | — | — · — · — |
| ComplexSelector | 69.7 kB (+34 B) · 11.7 kB CSS (0) | — | — · — · — |
| Stepper | 60.8 kB (+34 B) · 10.1 kB CSS (0) | — | — · — · — |
| TextInput | 66.6 kB (+34 B) · 11.1 kB CSS (0) | — | — · — · — |
| Banner | 61.2 kB (+33 B) · 10.4 kB CSS (0) | — | — · — · — |
| IconButton | 59.2 kB (+33 B) · 9.9 kB CSS (0) | — | — · — · — |
| NumberInput | 70.6 kB (+32 B) · 11.4 kB CSS (0) | — | — · — · — |
| MoreMenu | 95.9 kB (+31 B) · 17.2 kB CSS (0) | — | — · — · — |
| Thumbnail | 63.5 kB (+31 B) · 11.5 kB CSS (0) | — | — · — · — |
| ChatSendButton | 59.6 kB (+30 B) · 9.9 kB CSS (0) | — | — · — · — |
| DialogHeader | 62.0 kB (+30 B) · 11.4 kB CSS (0) | — | — · — · — |
| TableHeaderCell | 107.1 kB (+30 B) · 17.2 kB CSS (0) | — | — · — · — |
| TimeInput | 158.4 kB (+30 B) · 15.8 kB CSS (0) | — | — · — · — |
| ChatComposer | 76.8 kB (+29 B) · 12.0 kB CSS (0) | — | — · — · — |
| FileInput | 68.0 kB (+29 B) · 10.9 kB CSS (0) | — | — · — · — |
| TopNav | 71.2 kB (+29 B) · 10.9 kB CSS (0) | — | — · — · — |
| DateRangeInput | 91.1 kB (+28 B) · 12.4 kB CSS (0) | — | — · — · — |
| DropdownMenu | 95.6 kB (+28 B) · 17.2 kB CSS (0) | — | — · — · — |
| TopNavMegaMenu | 68.5 kB (+28 B) · 11.7 kB CSS (0) | — | — · — · — |
| ChatLayoutScrollButton | 59.7 kB (+27 B) · 10.1 kB CSS (0) | — | — · — · — |
| Markdown | 179.5 kB (+27 B) · 20.1 kB CSS (0) | — | — · — · — |
| lab/TourStep | 94.2 kB (+27 B) · 590 B CSS (0) | — | — · — · — |
| Carousel | 68.6 kB (+26 B) · 10.9 kB CSS (0) | — | — · — · — |
| PowerSearch | 282.5 kB (+26 B) · 23.6 kB CSS (0) | — | — · — · — |
| Typeahead | 78.4 kB (+26 B) · 12.4 kB CSS (0) | — | — · — · — |
| lab/DiffViewer | 85.5 kB (+26 B) · 2.1 kB CSS (0) | — | — · — · — |
| ContextMenu | 106.3 kB (+25 B) · 17.0 kB CSS (0) | — | — · — · — |
| lab/CommentComposer | 147.3 kB (+25 B) · 1.9 kB CSS (0) | — | — · — · — |
| lab/EmojiPicker | 85.1 kB (+25 B) · 751 B CSS (0) | — | — · — · — |
| MobileNavToggle | 59.5 kB (+24 B) · 9.9 kB CSS (0) | — | — · — · — |
| MobileNav | 69.5 kB (+23 B) · 10.5 kB CSS (0) | — | — · — · — |
| Popover | 87.9 kB (+23 B) · 14.0 kB CSS (0) | — | — · — · — |
| Tokenizer | 90.1 kB (+23 B) · 18.4 kB CSS (0) | — | — · — · — |
| ButtonGroup | 41.5 kB (+21 B) · 3.7 kB CSS (0) | — | — · — · — |
| Calendar | 70.2 kB (+21 B) · 10.5 kB CSS (0) | — | — · — · — |
| MultiSelector | 93.5 kB (+21 B) · 16.6 kB CSS (0) | — | — · — · — |
| TabMenu | 70.6 kB (+21 B) · 11.0 kB CSS (0) | — | — · — · — |
| Selector | 98.2 kB (+20 B) · 17.1 kB CSS (0) | — | — · — · — |
| lab/ListInput | 100.5 kB (+19 B) · 1.6 kB CSS (0) | — | — · — · — |
| BreadcrumbItem | 83.4 kB (+17 B) · 12.1 kB CSS (0) | — | — · — · — |
| richtext/RichTextView | 274.9 kB (+17 B) · 2.3 kB CSS (0) | — | — · — · — |
| DateTimeInput | 204.6 kB (+11 B) · 18.5 kB CSS (0) | — | — · — · — |
| SideNavHeading | 74.4 kB (+11 B) · 11.2 kB CSS (0) | — | — · — · — |
| BaseTypeahead | 70.0 kB (+8 B) · 10.9 kB CSS (0) | — | — · — · — |
| lab/TransferList | 106.4 kB (+7 B) · 1.7 kB CSS (0) | — | — · — · — |
| Timestamp | 32.3 kB (0) · 10.2 kB CSS (0) | — | — · — · — |
| richtext/RichTextEditor | 295.6 kB (−2 B) · 2.6 kB CSS (0) | — | — · — · — |
Package size: @astryxdesign/core 6.99 MB packed (+2.1 kB); no new dependencies.
API changes: none in this pull request
Committed API report behind this build: cli 29 rows, core 35 rows; run pnpm api:report.
Touched components checked; add ci:run-visual, ci:run-a11y or ci:run-rtl to run the full suites.
Generated by PR Enrichment workflow | View full report
There was a problem hiding this comment.
This needs an engineering owner's decision on its governing spec before it can be approved, and it also needs changes. The ToggleButtonGroup tracking rests on records this branch proposes rather than ones on main (family:action-groups FR1–FR5, architecture:interaction-modality INV13, and spec:AST-094 DEC-17 with its FR11, FR19 and FR24 amendments); any engineering owner, the author included if they are one, can record that decision by commenting /approve-spec <full head SHA> on this pull request, or the records can land on main through #8622 first. Whatever that decision, these still need changes:
- Land #8657's stack and update the branch, since the diff against main is 32,276 authored lines of which this change is 566.
- Keep Button's
:activepress scale off the toggle a mouse press started on while another toggle is lit, and asserttransformin the browser test's mouse case. - Make
ToggleButtonGroup.spec.mdPR1, its ownership boundary andverified_bymatch the hit-area watch and the group-painted press. - Resolve a touch on the edge of a disabled toggle to no toggle instead of its enabled neighbour.
[Automated review]
There was a problem hiding this comment.
This can't be approved yet: the ToggleButtonGroup tracking rests on spec records that exist only on this branch (family:action-groups FR1–FR5, architecture:interaction-modality INV13, and spec:AST-094 DEC-17 with its FR11, FR19 and FR24 edits), so an engineering owner needs to decide them, either by commenting /approve-spec <full head SHA> on this pull request (the author can do this if they are an engineering owner) or by landing #8622 first. Whatever that decision, these still need changes:
- Land #8657's stack and update this branch: the diff against main is 32,276 authored lines, of which this change is 566.
- During a mouse slide the toggle the press began on keeps Button's
:active0.98 scale while another toggle is lit; keep that scale off tracked toggles and asserttransformin the mouse browser test. - Update
ToggleButtonGroup.spec.mdPR1, its ownership boundary andverified_byfor the hit-area watch and the group-painted press. - A touch on the edge of a disabled toggle that has a tooltip toggles its enabled neighbour; resolve it to no toggle instead.
[Automated review]
There was a problem hiding this comment.
Approved pending CI. CI has not run on this head yet: both pull requests are drafts in a fork, so mark them ready for review, and a maintainer adds the ci:run label so CI runs.
#8657: ButtonGroup slide tracking
Approve. The touch-only slide, the 44 px hit layer and the menu-trigger exception match the action-groups contract (FR1–FR5, DEC-1) and spec:AST-094 FR42, and the ButtonGroup.spec.md compatibility change is owner-approved at this pull request's head. No blocking findings.
#8660: ToggleButtonGroup slide tracking
Approve. Only the lifted toggle changes (FR4), a toggle without a value keeps its own press (AV1), a caller's ref still reaches the root, and the ToggleButtonGroup.spec.md changes are owner-approved at this head. No blocking findings.
Whole stack
Pass: no public API changes, a mouse press behaves as on main, and #8660 builds on #8657's shared hook without rewriting it. A pull request lands only when it and every pull request below it are approved, so #8657 lands first, then #8660.
Non-blocking: ButtonGroup.spec.md PR1 could name the touch-presentation media-query listeners, as ToggleButtonGroup.spec.md PR1 now does.
[Automated review]
|
/approve-spec ce91ef0 |
There was a problem hiding this comment.
Approved pending CI. CI has not run on this head yet: both pull requests are drafts in a fork, so mark them ready for review, and a maintainer adds the ci:run label so CI runs on the next push.
#8657: ButtonGroup slide tracking
Approve. The touch-only slide, the 44 px hit layer and the menu-trigger exception match the action-groups contract (FR1–FR5, DEC-1) and spec:AST-094 FR29 and FR42, the rebased DropdownMenu wrap keeps main's pressTouchModel, and the ButtonGroup.spec.md compatibility change passes the spec-owner gate at this pull request's head. No blocking findings.
#8660: ToggleButtonGroup slide tracking
Approve. Only the lifted toggle changes (FR4), a toggle without a value keeps its own press (AV1), a caller's ref still reaches the root, and the ToggleButtonGroup.spec.md changes pass the spec-owner gate at this head. No blocking findings.
Whole stack
Pass: no public API changes, a mouse press behaves as on main, and #8660 builds on #8657's shared hook without rewriting it. A pull request lands only when it and every pull request below it are approved, so #8657 lands first, then #8660.
Non-blocking: ButtonGroup.spec.md PR1 could name the touch-presentation media-query listeners, as ToggleButtonGroup.spec.md PR1 now does.
[Automated review]
There was a problem hiding this comment.
Approved pending CI. CI has not run on this head yet: both pull requests are drafts in a fork, so mark them ready for review and have a maintainer add the ci:run label so CI runs.
#8657
Approve. ButtonGroup's touch-only slide, its 44 px hit layer and AlertDialog's shared pointer list match the action-groups contract, and the ButtonGroup record change passes the spec-owner gate at this head. No blocking findings.
#8660
Approve. ToggleButtonGroup toggles only the toggle lifted on under a finger or a pen, a mouse press stays native, and the record's PR1 and compatibility changes pass the spec-owner gate at this head. No blocking findings.
Whole stack
Pass: both groups share one tracking hook and one hit-layer style, with no public API change. A pull request lands only when it and every pull request below it are approved, so #8657 lands first.
- Miss (non-blocking): with an inline callback
ref, a group drops its hit layer and itsposition: relative/isolation: isolatefor a frame after each parent render, because the hit-area ref's cleanup clearsisGrowing(useGroupPressTracking.ts:166-168).
[Automated review]
|
/approve-spec c3657c5 |
|
/approve-spec d1db0b5 |
There was a problem hiding this comment.
Approved pending CI. CI has not run on this head yet: both pull requests are drafts in a fork, so mark them ready for review and have a maintainer add the ci:run label so CI runs.
#8657
Approve. ButtonGroup's touch-only slide, its 44 px hit layer and AlertDialog's shared pointer list match the action-groups contract, and the ButtonGroup record change carries an engineering owner's approval at this head. No blocking findings.
#8660
Approve. ToggleButtonGroup toggles only the toggle lifted on under a finger or a pen, a mouse press stays native, and the record's PR1 and compatibility changes pass the spec-owner gate at this head. No blocking findings.
Whole stack
Pass: both groups share one tracking hook and one hit-layer style, with no public API change. A pull request lands only when it and every pull request below it are approved, so #8657 lands first.
- Non-blocking: with an inline callback
ref, a group drops its hit layer and itsposition: relative/isolation: isolatefor a frame after each parent render, because the hit-area ref's cleanup clearsisGrowing(useGroupPressTracking.ts:166-168).
[Automated review]
|
/approve-spec 4fd8584 |
There was a problem hiding this comment.
Approved pending CI. CI has not run on this head yet: both pull requests are drafts in a fork, so mark them ready for review and have a maintainer add the ci:run label so CI runs.
#8657
Approve. ButtonGroup's touch-only slide, its 44 px hit layer and AlertDialog's shared pointer list match the action-groups contract, and the ButtonGroup record change carries an engineering owner's approval at this head. No blocking findings.
#8660
Approve. ToggleButtonGroup toggles only the toggle lifted on under a finger or a pen, a mouse press stays native, and the record's PR1 and compatibility changes pass the spec-owner gate at this head. No blocking findings.
Whole stack
Pass: both groups share one tracking hook and one hit-layer style, with no public API change. A pull request lands only when it and every pull request below it are approved, so #8657 lands first.
- Non-blocking: with an inline callback
ref, a group drops its hit layer and itsposition: relative/isolation: isolatefor a frame after each parent render, because the hit-area ref's cleanup clearsisGrowing(useGroupPressTracking.ts:168).
[Automated review]
There was a problem hiding this comment.
This stack needs an engineering owner's decision on its spec records before it can be approved, and #8660 needs one record fix whatever that decision is.
#8657
Waiting on the owner decision for the ButtonGroup.spec.md compatibility change; the touch-only slide, the 44 px finger target and the unchanged mouse press match the action-groups contract, and the group now uses the shared useTouchHitArea and touchHitAreaStyles.layer. No blocking code findings.
#8660
Changes requested, and waiting on the same decision for the ToggleButtonGroup.spec.md changes (PR1, ownership line, verification row and compatibility lines).
ToggleButtonGroup.spec.mdPR1 (lines 162-163) says the hit layer exists only while it grows a member's target, butToggleButtonGroup.tsxnow appliestouchHitAreaStyles.layerwhenever the group tracks presses; please reword it, for example "The layer exists while the group tracks presses; with no growth it covers nothing."
Whole stack
Both groups share one tracking hook and the shared hit-area layer, with no public API change. A pull request lands only when it and every pull request below it are approved, so #8657 lands first; an engineering owner records the spec decision by commenting /approve-spec <full head SHA> on each pull request, and the author may do so as an engineering owner.
[Automated review]
|
/approve-spec 215e9f3 |
There was a problem hiding this comment.
Approved pending CI: CI has not run on these heads yet. The touch-only slide, the 44 px finger targets and the unchanged mouse press match the action-groups contract, and both record changes carry an engineering owner's approval at their exact heads.
#8657
Approve. No blocking findings.
#8660
Approve. No blocking findings; the PR1 sentence on when the hit layer exists now matches the code.
Whole stack
Both groups share one tracking hook and the shared hit-area band, with no public API change. A pull request lands only when it and every pull request below it are approved, so #8657 lands first. Next: mark both pull requests ready for review, and a maintainer adds the ci:run label so CI runs, since the branches live in a fork.
[Automated review]
|
/approve-spec 215e9f3 |
There was a problem hiding this comment.
Approved: CI passes on this head.
#8657 (ButtonGroup): approve. Under the touch presentation the slide-and-lift, the 44 px finger targets and the unchanged mouse press hold up, and the component:ButtonGroup record change is approved at this head. No blocking finding.
#8660 (ToggleButtonGroup): approve. A finger's or a pen's slide toggles only the toggle lifted on, a toggle without a value keeps its own press, and the component:ToggleButtonGroup record change is approved at this head. No blocking finding.
Whole stack: passes. Both groups share one tracking hook and one touch hit area, with no public API change. A pull request lands only when it and every pull request below it are approved, so #8657 lands first.
[Automated review]
Under the touch presentation, ToggleButtonGroup's toggles are an action group for a finger and a pen, through the same tracking as ButtonGroup: the toggle under the pointer highlights, the highlight follows it, and the lift toggles only the toggle under it; a lift outside the group toggles nothing. A finger picks the nearest toggle whose 44 px target holds it, through a hit layer on the group. A mouse press acts as a native toggle's, as before. A toggle without a value keeps its own press, and the keyboard is unchanged.
|
/approve-spec 980a495 |
There was a problem hiding this comment.
Approved: CI passes on this head.
Under the touch presentation, ToggleButtonGroup now follows a finger or a pen across its valued toggles and toggles only the one lifted on, as family:action-groups FR1–FR5 and DEC-1 require, and small toggles get a 44 px finger target through the shared hit band (spec:AST-094 FR42). The ToggleButtonGroup.spec.md changes are owner-approved for this head, and a desktop mouse drag behaves exactly as on main. This pull request was reviewed on its own, since #8657 has merged.
- Miss (non-blocking): one inline suggestion on a comment's wording in
ToggleButton.tsx.
[Automated review]
|
/approve-spec 980a495 |
Resolves ToggleButtonGroup.tsx: keeps this branch's React imports and main's createLayerScopedContext import, whose shared context key the merge keeps from main. Main moved the touch band's style module to internal/touchHitArea.stylex, so the group and its unit test import it from there.
Main now gives every Button outside a ButtonGroup its own touch band. In a tracking ToggleButtonGroup, each tracked toggle then drew a band beside the group's hit layer, and that band re-measured the page as a press began, past PR1's read count. The group's toggles now say the group draws their band (PressGroupBandContext), so a tracked toggle draws none of its own. A toggle without a value keeps its own band. Button's FR42 row and ToggleButtonGroup's PR1 row name the new cases.
|
/approve-spec 0a75cfa |
There was a problem hiding this comment.
Changes requested: one wording fix in the changeset and the description; the touch slide, its tests and the owner-approved records are otherwise ready.
Under the touch presentation, ToggleButtonGroup now follows a finger or a pen across its valued toggles and toggles only the one lifted on, while a mouse press and the keyboard behave as on main, and CI passes on this head.
- Regression:
.changeset/toggle-button-group-press-tracking.mdlists "each toggle's target grows toward 44 px" as part of this change, and the description says small toggles miss 44 px today, but since Button's touch band landed onmainevery grouped toggle already has that target (a tap 5 px below Bold toggles it onmaintoo), so say instead that tracked toggles keep their 44 px target, now drawn by the group (or drop the sentence), and update the description to match.
Non-blocking: a valued toggle with aria-haspopup loses its finger target in a tracking group (see the inline note), and the comment-wording suggestion on ToggleButton.tsx is still open. The records' /approve-spec names this head, so the next commit needs a new one.
[Automated review]
Since Button's touch band, every grouped toggle already has its 44 px target, so the changeset no longer says the group grows it: a toggle the group tracks keeps it, now drawn by the group. A comment in ToggleButton reads in two short active sentences.
|
/approve-spec 0c70bbf |
There was a problem hiding this comment.
Approved: CI passes on this head.
Under the touch presentation, ToggleButtonGroup now follows a finger or a pen across its valued toggles and toggles only the one lifted on, while a mouse press and the keyboard behave as on main. The changeset now describes the 44 px finger target correctly, and the record changes carry an engineering owner's approval for this head, so another commit needs a new one.
Non-blocking:
- A valued toggle with
aria-haspopupin a tracking group draws no finger band and gets none from the group (see the inline note onButton.tsx). - The description's user need still says small toggles are under the 44 px a finger needs;
mainalready gives them that target, so consider limiting it to the slide.
[Automated review]
| // The group draws one band for all its members: a ButtonGroup, or a | ||
| // tracking group that says so. A disabled or busy-only button takes no tap. | ||
| const groupDrawsBand = use(PressGroupBandContext); | ||
| const hasHitArea = buttonGroup == null && !groupDrawsBand && !buttonDisabled; |
There was a problem hiding this comment.
Miss (non-blocking): ToggleButton sets PressGroupBandContext for every valued toggle in a tracking group, but a toggle with aria-haspopup (menu, listbox or true) is left untracked above (MENU_POPUPS), and the group's hit layer grows only tracked toggles. Such a toggle then draws no band of its own and gets none from the group, while on main it has its own (spec:AST-094 FR42). No caller does this today. Skipping the band only for a tracked button keeps it:
const hasHitArea =
buttonGroup == null && !(groupDrawsBand && isGroupTracked) && !buttonDisabled;Button.spec.md's verification map conflicted: main named its text-size case in the FR4 row, and this branch names a Button whose tracking group draws its band in the FR42 row. Both rows keep their changes, and the table is realigned.
|
/approve-spec 7ad2f92 |
There was a problem hiding this comment.
Approved: CI passes on this head.
Under the touch presentation, ToggleButtonGroup now follows a finger or a pen across its valued toggles and toggles only the one lifted on, while a mouse press and the keyboard behave as on main. The record changes carry an engineering owner's approval for this head, so another commit needs a new one.
Non-blocking:
- A valued toggle with
aria-haspopupin a tracking group draws no finger band and gets none from the group (see the inline note onButton.tsx).
[Automated review]
#9848 merged as 7b87c5c, and #8657 merged as ddb8b34. This head merges main in (last at 7bc8230) and adds one fix on top, for main's new touch band on Button (below). So this pull request carries its own commit (about 1,060 authored lines) and that fix. The last merge kept both sides of one conflict, in Button's record: main's text-size case in the FR4 row, and the band case in the FR42 row.
User need
Part of the UIKit-parity work. In a toggle group (Bold, Italic, Underline) on an iPhone you can press one toggle and slide to another, and only the one you lift on should change. Today a slide changes nothing.
Problem and solution fit
family:action-groupslists ToggleButtonGroup as a member. Under the touch presentation (spec:AST-094FR13), the group uses the same tracking and touch targets as ButtonGroup (#8657) for a finger and a pen, and the lift toggles only that toggle, once, in single and multiple mode. A desktop mouse press behaves exactly as on main: only the pressed toggle changes, with no drag-across (family:action-groupsFR1 and DEC-1).ToggleButtonGroup.doc.mjsdescribes the touch-only slide.useTouchPresentation, two media queries); only an enabled group under it tracks and watches its hit area. A press start reads the group's box once and each enabled toggle's box three times for a finger, twice for a pen. A press on the group's own box first reads each member once more, and a press reads no box outside the group. Nothing is read per move or at the lift. The count case sends the pointer events a real finger sends.Current specification
family:action-groupsFR1–FR5 and DEC-1;spec:AST-020DEC-5 (a lift outside the group changes nothing).Public delta and caller burden
No API or prop-default change.
onChangefires once, for the lifted toggle. Released default preserved:yesfor a mouse; under the touch presentation a press gains the slide. Under the touch presentation, an enabled group's root is alsoposition: relative, as the containing block of its hit layer. The layer is the root's::before(touchHitAreaStyles.layerBelowChildren), which cuts out the root's own box. The toggles paint after it, so each toggle keeps every pixel of its own box, edges included. So the layer needs no z-index, and the root noisolation. With a fine primary pointer the root keeps its stacking: noposition, no layer.Record change at this head, for the re-stamp:
component:ToggleButtonGroup's Compatibility class now reads "…the gesture host'sdata-astryx-touch-actionmarker on the group root and the hit layer's inset properties, and an enabled group's root is alsoposition: relative, so absolutely positioned descendants resolve against it there". It read "…the hit layer's inset properties; while the hit layer grows a member's touch target, an enabled group's root is alsoposition: relativeandisolation: isolate, so absolutely positioned and z-indexed descendants resolve against it there". The changeset says, in the spec owners' words: "An enabled ToggleButtonGroup root is position: relative under a coarse pointer, so absolutely positioned children anchor to the group." PR1's last claim about the layer now reads "The layer exists while the group tracks presses; with no growth it covers nothing", as CodeBunny suggested. It read "The layer exists while it grows a member's target", which the layer no longer matches: it applies whenever the group tracks presses.A caller's
refstill reaches the group root, as on main (architecture:public-component-apiINV8); the group merges it with its own refs.refstays undeclared in the group's props, as on main.Main's touch band on Button, at this head. Main now gives every Button outside a ButtonGroup its own touch band. After the merge, each toggle a tracking group tracks drew one too, beside the group's hit layer. A finger felt no difference: taps and slides at each toggle's center, 3 px past each edge and in each gap toggled the same toggle, and left focus on the same toggle, as before the merge, in Chromium and in WebKit. Only the element a touch landed on changed, and the group resolves its target from the point, not from that element. But each toggle's band re-measured the page as a press began, past PR1's read count. So a toggle the group tracks now leaves its band to the group (
PressGroupBandContext, a layer-scoped flag that Button reads), and a toggle without a value keeps its own. At this head, every touch lands on the same element as before the merge, and PR1's count holds. So a tracked toggle keeps its 44 px target, now drawn by the group, and the changeset says so.Record change at this head, for the re-stamp:
component:Button'sspec:AST-094FR42 verification row now names "a Button whose tracking group draws its band" in its verification, state and failure cells.component:ToggleButtonGroup's PR1 row names the band case "draws each tracked toggle's touch band on the group's hit layer: a tracked toggle draws none of its own, and a toggle without a value keeps its own".Census: absolutely positioned children inside a group. Under a coarse pointer an enabled group's root is
position: relative, so an absolutely positioned child anchors to the group there. The repository's every ButtonGroup and ToggleButtonGroup use was read: 124 groups in 29 files (Core's components, tests and docs, Lab, the Storybook stories, the docs site, the sandbox, and the CLI's templates and docs). Their children are Button (162), ToggleButton (75), IconButton (10), DropdownMenu (8), a nested ButtonGroup (2), Tooltip, HoverCard, Drawer, OverflowList, a plainbuttonand a test helper (1 each), with icons inside the members.position: relativeon main too, so they don't change.position, no layer. A browser case checks each pointer.The ToggleButtonGroup record is owner-gated: it needs an engineering owner's
/approve-spec <head sha>.Design and alternatives
ToggleButtonGroup uses the hook that ButtonGroup introduces in #8657 (
useGroupPressTracking) and the shared touch hit area's band drawn below its toggles (touchHitAreaStyles.layerBelowChildren), so the two groups can't drift apart.Anchoring the hit layer without a positioned root (CSS anchor positioning) was tried and not used: a scroll container then no longer clips the layer, so a tap just past a scroller's edge lands on the group, and in Chromium the layer lags a scroll (see #8657).
The layer is the root's
::before, so the toggles paint over it. As the root's::after, its clip path's edge gave the exact pixel on each toggle's top edge, and the first toggle's start column, to the group, in Chromium and WebKit. A browser case now checks those pixels.Testing
To check by hand, in the ToggleButton "Group multiple" story:
What was run:
Button.tsxandToggleButton.tsx) fails three cases: the two new band cases, and PR1's count, which reads [1, 5, 4, 4, 1] instead of [1, 3, 3, 3, 0]. The not-for-landing mutant 83aa2cd (the flag for every toggle in a group, a toggle without a value too) fails the band case. This head passes them all.CI=true pnpm lint,check:knowledge, changeset coverage andreview:prepass.test:ui22,729/22,729;test:node17,564 passed, 2 expected failures, 71 skipped, 0 failed. Chromium: ToggleButtonGroup and ButtonGroup tracking, ButtonHitArea, AlertDialog and main's ButtonTextSize, 53 of 53; the ToggleButton and Button accessibility contracts, 34 of 34. WebKit, CI profile (--cpus=4 -e CI=1 -e LP_NUM_THREADS=4 --cpuset-cpus=0-99, 1 worker): the same five files, 53 of 53.At the previous head, 980a495:
presentedHitTesting6/6.--cpus=4 -e CI=1 -e LP_NUM_THREADS=4 --cpuset-cpus=0-99, 1 worker): those 8 files, 71 passed and 2 skipped by engine gates.test:ui21,158/21,158;test:node16,638 passed, 2 expected failures, 71 skipped, and 1 failed: main's own import-hint case below, which passes alone at this head, twice.CI=true pnpm linton the changed files, strict ESLint, Prettier (the record included),check:knowledge, changeset coverage andreview:prepass.At the earlier head 414d6d6 (on #8657's a0f9257). This head changes the hit layer's pseudo-element and its tests, the changeset sentence and PR1's line about the layer; the runs above cover them. On #8657 (main bfc1dcc), fresh
pnpm install --frozen-lockfile(exit 0):test:ui.gestures.interactionandpresentedHitTestingas on feat(ButtonGroup): a finger's slide runs the button it lifts on #8657. ToggleButton's a11y contract passes 14/14 in Chromium.test:ui21,157/21,157;test:node16,633 passed, 2 expected failures, 76 skipped, and 1 failed: main's own import-hint case "builds its fixture where a scan of the repo's docs running at the same time never finds it", which times out at 30 s because it imports every doc (its fix is test(cli): the docs-scan case reads the scan's walk, not every doc #10060; alone it passes at this head and at main), the bundle test included.CI=true pnpm linton the changed files, strict ESLint and Prettier on the changed TypeScript files,check:knowledge,review:preand changeset coverage pass.Evidence
Desktop, real Chrome, before (main) and after (this head), a mouse press on Bold released on Underline:
Measured on both builds (the "Group multiple" story, a fine primary pointer): only Bold is
:activewhile held, no toggle carries the press paint or the group's marker, and no toggle changes at the release.Scope
Writing rubric results
component:ToggleButtonGroup: the compatibility lines name the DOM change under the touch presentation, andverified_byand the verification map name the tracking tests. The PR1 row names the band case. PR1 states only measured costs, each with its test or its named evidence gap. "Released default preserved" isyesfor a mouse, with the touch presentation's slide named. R1–R6 pass: present tense, with no research, references, rejected alternatives or open questions.component:Button: thespec:AST-094FR42 verification row names the new case, a Button whose tracking group draws its band, in its verification, state and failure cells. R1–R6 pass.