Skip to content

feat(ToggleButtonGroup): a finger's slide toggles the one it lifts on - #8660

Merged
cixzhang merged 5 commits into
meta:mainfrom
vjeux:uikit/c01-togglegroup-tracking
Nov 8, 2026
Merged

cixzhang merged 5 commits into
meta:mainfrom
vjeux:uikit/c01-togglegroup-tracking

Conversation

@vjeux

@vjeux vjeux commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

#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-groups lists ToggleButtonGroup as a member. Under the touch presentation (spec:AST-094 FR13), 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-groups FR1 and DEC-1).

  • A finger on a disabled toggle's edge toggles nothing: disabled toggles count as neighbours.
  • After a slide or a tap, focus goes where a click on the lifted toggle would.
  • Only a ToggleButton with a value joins the tracking. A toggle without a value keeps its own press, as the record's AV1 says, and so does any other child, such as a plain Button. The group counts them as neighbours, so no grown target reaches into them.
  • A toggle in a tracking group writes the group's pointer types into the press-group mark, as ButtonGroup's buttons do.
  • ToggleButtonGroup.doc.mjs describes the touch-only slide.
  • The record's PR1 states the group's measured cost: every group reads the touch presentation (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-groups FR1–FR5 and DEC-1; spec:AST-020 DEC-5 (a lift outside the group changes nothing).

Public delta and caller burden

No API or prop-default change. onChange fires once, for the lifted toggle. Released default preserved: yes for a mouse; under the touch presentation a press gains the slide. Under the touch presentation, an enabled group's root is also position: 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 no isolation. With a fine primary pointer the root keeps its stacking: no position, no layer.

Record change at this head, for the re-stamp: component:ToggleButtonGroup's Compatibility class now reads "…the gesture host's data-astryx-touch-action marker on the group root and the hit layer's inset properties, and an enabled group's root is also position: 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 also position: relative and isolation: 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 ref still reaches the group root, as on main (architecture:public-component-api INV8); the group merges it with its own refs. ref stays 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's spec:AST-094 FR42 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 plain button and a test helper (1 each), with icons inside the members.

  • No group puts an absolutely or fixed positioned element of its own directly inside it, except OverflowList's hidden measurement row in the library page template's "Filter by category" ToggleButtonGroup. It has no inset, so it stays at its static position. Probed in Chromium and WebKit with the element around it positioned (local probe, not part of the diff): its offset parent switches, but its width, each item's width and the visible items are identical.
  • A member's own positioned parts, such as Button's status region and press overlay, sit inside the member, which is position: relative on main too, so they don't change.
  • Tooltip, HoverCard, DropdownMenu and Drawer render their layers in the top layer, which a group's position doesn't reach.
  • With a fine primary pointer the root keeps main's stacking: no 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:

  1. On an iPhone (or the iOS simulator), press Bold, slide to Underline, and lift: only Underline turns on.
  2. On an iPhone, tap just below a toggle: it toggles.
  3. On a desktop, press Bold with the mouse, move to Underline, and release: nothing toggles, and only Bold looks pressed while held, as on main.

What was run:

  • At this head (main 7bc8230 merged in, with the band fix): packages and Storybook built at this head.
    • The band, measured: in both group stories under a finger, the tracked toggles draw no band of their own, and the group's band reaches 6 px. A scan of every pixel within 30 px of the group finds the same pixels starting a group press with and without the toggles' own bands. Taps and slides at each toggle's center, 3 px past each edge, in each gap and 1 px into it (31 cases) toggle the same toggle, leave focus on the same toggle, and land on the same element as at the previous head, 980a495, in Chromium and in WebKit.
    • Red first, the band fix: the not-for-landing commit 75a5c59 (this head's tests with the merge's Button.tsx and ToggleButton.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.
    • Gates at this head: typecheck, CI=true pnpm lint, check:knowledge, changeset coverage and review:pre pass. test:ui 22,729/22,729; test:node 17,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:

  • At this head: Storybook built at a8f8340, whose code this head keeps (this head changes one record sentence), in Chromium. WebKit ran on a Storybook built at this head, 980a495.
    • Chromium: ToggleButtonGroup 12/12. Among them, "the pixels on a toggle's own edges are the toggle's" fails at the earlier head 414d6d6, where each toggle's top-edge pixel and the first toggle's start column resolve to the group, and passes here. The finger-stacking case passes too. ButtonGroup 19/19, the list touch-target cases 16/16, hit area 2/2, DropdownMenu 5/5 and 2/2, AlertDialog 11/11, presentedHitTesting 6/6.
    • WebKit, CI profile (--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.
    • Accessibility contracts, Chromium: ToggleButton 14/14, Button 20/20, MenuPress 13/13, MenuButton 13/13, InfoTipTouch 4/4.
    • Full suites at this head: test:ui 21,158/21,158; test:node 16,638 passed, 2 expected failures, 71 skipped, and 1 failed: main's own import-hint case below, which passes alone at this head, twice.
    • Static: typecheck, CI=true pnpm lint on the changed files, strict ESLint, Prettier (the record included), check:knowledge, changeset coverage and review:pre pass.

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):

  • Unit: the ToggleButtonGroup tracking cases 17/17, among them the PR1 read count and the caller-ref case; the ToggleButton, ButtonGroup, hook, utils, gesture, DropdownMenu, Button and AlertDialog suites pass in this head's test:ui.
  • Red first: with ToggleButtonGroup.tsx and ToggleButton.tsx at feat(ButtonGroup): a finger's slide runs the button it lifts on #8657's, 13 of the 17 group cases fail. With ToggleButtonGroup.tsx at this branch's previous head (772c715), whose root took only the group's own refs, the caller-ref case fails.
  • Browser, Storybook built at this head, in Chromium and in WebKit (container, without the CI profile's CPU cap): ToggleButtonGroup 10/10; ButtonGroup 17/17; AlertDialog 11/11; gestures.interaction and presentedHitTesting as on feat(ButtonGroup): a finger's slide runs the button it lifts on #8657. ToggleButton's a11y contract passes 14/14 in Chromium.
  • Full suites at this head: test:ui 21,157/21,157; test:node 16,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.
  • Static: typecheck, CI=true pnpm lint on the changed files, strict ESLint and Prettier on the changed TypeScript files, check:knowledge, review:pre and changeset coverage pass.

Evidence

Desktop, real Chrome, before (main) and after (this head), a mouse press on Bold released on Underline:

main (bb3838b) this PR
A mouse press on Bold, moved over Underline and held main, held PR, held
After the release over Underline main, after PR, after

Measured on both builds (the "Group multiple" story, a fine primary pointer): only Bold is :active while held, no toggle carries the press paint or the group's marker, and no toggle changes at the release.

Scope

  • One capability is added.
  • Unrelated fixes, cleanup, and policy changes were removed or split.
  • Consumer docs, focused tests, and migration evidence ship with the feature.
  • Public text and artifacts contain no internal Meta context.

Writing rubric results

component:ToggleButtonGroup: the compatibility lines name the DOM change under the touch presentation, and verified_by and 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" is yes for 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: the spec:AST-094 FR42 verification row names the new case, a Button whose tracking group draws its band, in its verification, state and failure cells. R1–R6 pass.

@vercel

vercel Bot commented Oct 27, 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 8, 2026 1:34pm UTC

Request Review

@astracat-bot

astracat-bot Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 8, 2026, 1:52 PM UTC

@github-actions github-actions Bot added the needs:design-review Affects visuals — Design should review label Oct 27, 2026
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Oct 27, 2026
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 27, 2026
@cixzhang

Copy link
Copy Markdown
Contributor

Posted by Cindy's agent on her behalf.

Thanks for the action-group work. Two review points:

  1. One hit-area helper: this PR adds its own hooks/actionGroupHitArea.ts. Cindy's touch-target rule (44 px on touch only, never overlapping a neighbor's target, clamped to half the gap) has one shared helper, utils/hitArea.ts with resolveHitTarget (chore(core): a shared touch hit area that grows toward 44 px and stops at half the gap to each neighbour #8635). Please use it instead of a second implementation, so the clamp behaves the same everywhere.
  2. A missing test: touching buttons must take no area from each other. For example, with 28 px buttons at x = 0, 80 and 160 px under a touch pointer, a finger at x = 82 runs only the middle button, and a finger 8 px below a button still counts for that button.

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.

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This 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 :active 0.98 scale while the tracker lights another toggle, because a ToggleButton keeps styles.pressable and the tracked look overrides only background-image; the browser test checks only the overlay.
  • ToggleButtonGroup.spec.md still says each member owns its press paint, and the spec:AST-094 record conflicts with main.

[Automated review]

Comment thread packages/core/src/Button/Button.tsx Resolved

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This 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 of architecture:react-component-runtime INV13.
  • Keep Button's :active press scale off the toggle a mouse press started on while another toggle is lit, and assert transform in the browser test's mouse case.
  • Resolve the spec:AST-094 conflict with main.

[Automated review]

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This 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 :active press scale off the toggle a mouse press started on while another toggle is lit, and assert transform in the browser test's mouse case.
  • Make ToggleButtonGroup.spec.md PR1, its ownership boundary and verified_by match the hit-area watch and the group-painted press, and amend the fine-pointer sentence of architecture:react-component-runtime INV13.
  • Resolve a touch on the edge of a disabled toggle to no toggle instead of its enabled neighbour.

[Automated review]

@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 7ad2f92

Storybook · Sandbox · built from this PR's head

Modified components

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

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This 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 :active press scale off the toggle a mouse press started on while another toggle is lit, and assert transform in the browser test's mouse case.
  • Make ToggleButtonGroup.spec.md PR1, its ownership boundary and verified_by match 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]

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This 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 :active 0.98 scale while another toggle is lit; keep that scale off tracked toggles and assert transform in the mouse browser test.
  • Update ToggleButtonGroup.spec.md PR1, its ownership boundary and verified_by for 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]

@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: 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]

@cixzhang

cixzhang commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

/approve-spec ce91ef0

@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: 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]

@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: 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 its position: relative / isolation: isolate for a frame after each parent render, because the hit-area ref's cleanup clears isGrowing (useGroupPressTracking.ts:166-168).

[Automated review]

@cixzhang

cixzhang commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

/approve-spec c3657c5

@cixzhang

cixzhang commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

/approve-spec d1db0b5

@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: 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 its position: relative / isolation: isolate for a frame after each parent render, because the hit-area ref's cleanup clears isGrowing (useGroupPressTracking.ts:166-168).

[Automated review]

@cixzhang

cixzhang commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

/approve-spec 4fd8584

@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: 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 its position: relative / isolation: isolate for a frame after each parent render, because the hit-area ref's cleanup clears isGrowing (useGroupPressTracking.ts:168).

[Automated review]

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This 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.md PR1 (lines 162-163) says the hit layer exists only while it grows a member's target, but ToggleButtonGroup.tsx now applies touchHitAreaStyles.layer whenever 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]

@cixzhang

cixzhang commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

/approve-spec 215e9f3

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

@cixzhang

cixzhang commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

/approve-spec 215e9f3

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

cixzhang commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

/approve-spec 980a495

@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: 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]

@cixzhang

cixzhang commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

/approve-spec 980a495

vjeux added 2 commits November 7, 2026 05:14
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.
@cixzhang

cixzhang commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

/approve-spec 0a75cfa

@astracat-bot astracat-bot Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Changes requested: one wording fix 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.md lists "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 on main every grouped toggle already has that target (a tap 5 px below Bold toggles it on main too), 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.
@cixzhang

cixzhang commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

/approve-spec 0c70bbf

@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: 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-haspopup in a tracking group draws no finger band and gets none from the group (see the inline note on Button.tsx).
  • The description's user need still says small toggles are under the 44 px a finger needs; main already 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;

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.

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

cixzhang commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

/approve-spec 7ad2f92

@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: 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-haspopup in a tracking group draws no finger band and gets none from the group (see the inline note on Button.tsx).

[Automated review]

This branch was successfully deployed

1 active deployment
Preview — 7ad2f922 Deployed Nov 8, 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) 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.

2 participants