Skip to content

fix(Button): under a finger, a Button's target grows toward 44 px through the shared touch band - #10216

Merged
cixzhang merged 18 commits into
mainfrom
lane4/button-touch-band
Nov 7, 2026
Merged

cixzhang merged 18 commits into
mainfrom
lane4/button-touch-band

Conversation

@cixzhang

@cixzhang cixzhang commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

User impact

On a phone, a person tapping a small Button, an IconButton or an input's clear (✕) button often misses it, because the target is only as big as the drawn control: 20–32 px. With this change the target grows toward 44 px under a finger, as far as the neighbors leave room, and the drawn box doesn't change. Under a mouse nothing changes.

  • A disabled Button, or a busy one that can't be interrupted, gets no band, because it takes no tap.
  • A Button in a ButtonGroup keeps the group's own band (the press-tracking groups already have one), so members don't overlap.
  • The clear button drops its fixed 24 px overlay and uses the same shared band. At 24 px it stayed under the AST-094 FR42 target; now it grows like every other control, and it is still clamped away from the field's own text area by the shared neighbor rule.

What this guarantees

  1. A tap in the gap between two neighboring buttons goes to the nearer one, and never to both. Each band stops at half the gap, and a tap in one button's band that is nearer an offset neighbor presses neither.
  2. Disabled, busy-only and grouped buttons are excluded. A disabled button, or a busy one that can't be interrupted, gets no band, and a grouped button keeps its group's band.
  3. Under a mouse and on desktop, nothing changes: 0 px versus main. A caller's ::after decoration on a Button stays as it is, under a mouse and under a finger. The band exists only under (pointer: coarse), and no box changes size.
  4. The clear ✕ never takes a tap meant for the input's text. Its band stops at half the gap to the text box, and a tap on its band clears the field in Chromium and WebKit.

What changes

  • Button.tsx: a standalone, enabled Button calls useTouchHitArea, and its content wrapper (already rendered, display: contents) carries the band on its ::after. That's absolute and coarse-only, so it adds no element and no layout. The button's own ::before (the touch press) and ::after (a caller's xstyle decoration) are untouched.
  • useTouchHitArea takes ownsDescendantTouches (default true) and passes it to the watch. Button turns it off: its band sits on a descendant, and its content never paints past its box, so the press check still swallows a band tap nearer a neighbor.
  • InputClearButton.tsx: the ::after overlay and its two private vars are removed. They are also removed from Field.doc.mjs and the derived-var registry. The button cancels pointerdown only for a mouse or pen: WebKit drops the click of a touch whose pointerdown is cancelled. For touch, its mousedown handler still keeps focus in the field.
  • New Button.hitArea.test.tsx: a standalone and a link Button are watched and take the band; a disabled, busy or grouped Button takes none.
  • InputClearButton.test.tsx: the 24 px overlay tests become one test showing that the clear button takes Button's band, plus one showing that a touch pointerdown is not cancelled while mousedown still is.
  • Button.spec.md: an AST-094 FR42 verification row and verified_by. No requirement change, because AST-094 FR42 already governs a control that no record sets a hit area for.
  • The band's style module moves from utils/ to internal/touchHitArea.stylex and is listed with the other internal entries in sync-exports. Swizzle rewrites every .stylex import to a package subpath, so a swizzled Button needs it to resolve. The move also fixes the same unresolved import in a swizzled ListItem, CheckboxInput, RadioListItem, InfoTip or SegmentedControl item. Internal entries stay outside the public API, and every importer follows the move.
  • Changeset: core patch, [fix], which also names the swizzle fix.

Browser evidence

ButtonHitArea.interaction.browser.spec.ts runs on the new "Touch targets" Button story (a toolbar with 4 px gaps above a field with a clear button), under a real finger in a phone-sized touch context:

  • each toolbar band grows toward 44 px, stays at most half the gap, and grows no box;
  • a tap just inside the gap goes to the nearer button, never its neighbor, and a tap on the band above a button presses it;
  • a whole-pixel tap inside Undo's band but nearer Redo, which sits past Undo's corner on both axes, never presses Undo;
  • the clear button's band stops short of the field's text, a tap in the text keeps the value and focuses the field, and a tap on the band below the clear button clears. All cases run in Chromium and WebKit.

The interaction job's run on this head is the evidence. This PR goes ready only after it's green.

Tests

  • Red on main: the 3 new band tests fail.
  • Green: Button, IconButton, ButtonGroup, ToggleButton, Field, TextInput and the derived-var registry pass, 714 tests (the registry failure on the first green run is fixed in this head). pnpm check:knowledge and check:changesets pass.

Sequencing

Button.tsx is also changed by #7906 (a disabled Button stays focusable through aria-disabled), which is in review. The hunks don't overlap: that PR changes the disabled attributes, and this one adds the band's ref and style. This PR waits behind #7906 if both are ready, and merges main before landing. The Button label-wrapper fix for #6939 has no PR yet. Whichever of these lands second merges main and reruns the Button suites.

Writing rubric results

  • Present tense, system only: the new verification row describes the test and the failure condition, with no history.
  • Table widths are unchanged, and prettier is clean.
  • Every reference resolves (spec:AST-094 FR42, audit:Button/behavior).

…ough the shared touch band

A standalone, enabled Button takes useTouchHitArea and touchHitAreaStyles.layer,
so its target grows as far as its neighbors leave room, and its box stays as
it is. A grouped Button keeps its group's band; a disabled or busy Button gets
none. InputClearButton drops its fixed 24 px ::after and its two private vars,
and uses the Button band.
@vercel

vercel Bot commented Nov 6, 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 6, 2026 9:19pm UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 6, 2026
@github-actions github-actions Bot added the needs:design-review Affects visuals — Design should review label Nov 6, 2026
@astracat-bot

astracat-bot Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 6, 2026, 9:38 PM UTC

@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Nov 6, 2026
@cixzhang

cixzhang commented Nov 6, 2026

Copy link
Copy Markdown
Contributor Author

/approve-spec fc8a8fe

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Nov 6, 2026
@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 26bd5ed

Storybook · Sandbox · built from this PR's head

Modified components

Component Size LoC Visual · A11y · RTL
AppShell 🔴 85.1 kB (+3.9 kB) · 13.0 kB CSS (+242 B) — — · — · —
ChatLayoutScrollButton 🔴 56.1 kB (+3.9 kB) · 9.7 kB CSS (+239 B) — — · — · —
Button · Storybook 🔴 55.5 kB (+3.9 kB) · 9.5 kB CSS (+238 B) 678 (+16) — · — · —
95 more components
Component Size LoC Visual · A11y · RTL
ChatSendButton 🔴 56.0 kB (+3.9 kB) · 9.5 kB CSS (+239 B) — — · — · —
Banner 🔴 57.5 kB (+3.9 kB) · 10.1 kB CSS (+239 B) — — · — · —
SideNavCollapseButton 🔴 56.4 kB (+3.9 kB) · 9.6 kB CSS (+238 B) — — · — · —
IconButton 🔴 55.6 kB (+3.9 kB) · 9.5 kB CSS (+238 B) — — · — · —
MobileNavToggle 🔴 55.9 kB (+3.9 kB) · 9.5 kB CSS (+238 B) — — · — · —
ChatDictationButton 🔴 56.1 kB (+3.9 kB) · 9.6 kB CSS (+238 B) — — · — · —
ToggleButton 🔴 56.4 kB (+3.9 kB) · 9.6 kB CSS (+238 B) — — · — · —
ChatLayout 🔴 58.8 kB (+3.8 kB) · 10.1 kB CSS (+238 B) — — · — · —
Thumbnail 🔴 59.9 kB (+3.9 kB) · 11.1 kB CSS (+227 B) — — · — · —
TableSelectionToolbar 🔴 65.0 kB (+3.8 kB) · 12.6 kB CSS (+240 B) — — · — · —
Stepper 🔴 57.2 kB (+3.8 kB) · 9.7 kB CSS (+239 B) — — · — · —
Calendar 🔴 66.3 kB (+3.8 kB) · 10.1 kB CSS (+236 B) — — · — · —
DialogHeader 🔴 58.3 kB (+3.8 kB) · 11.1 kB CSS (+238 B) — — · — · —
DrawerHeader 🔴 58.5 kB (+3.8 kB) · 12.5 kB CSS (+240 B) — — · — · —
Popover 🔴 64.8 kB (+3.8 kB) · 13.6 kB CSS (+219 B) — — · — · —
CodeBlock 🔴 70.0 kB (+3.8 kB) · 10.8 kB CSS (+224 B) — — · — · —
SideNavItem 🔴 65.5 kB (+3.8 kB) · 10.7 kB CSS (+236 B) — — · — · —
Toast 🔴 93.0 kB (+3.8 kB) · 9.8 kB CSS (+236 B) — — · — · —
Carousel 🔴 63.4 kB (+3.8 kB) · 10.5 kB CSS (+221 B) — — · — · —
ChatComposer 🔴 72.0 kB (+3.7 kB) · 11.4 kB CSS (+231 B) — — · — · —
SideNavHeading 🔴 70.6 kB (+3.7 kB) · 10.8 kB CSS (+234 B) — — · — · —
BaseTypeahead 🔴 65.8 kB (+3.7 kB) · 10.5 kB CSS (+231 B) — — · — · —
TopNavHeading 🔴 70.0 kB (+3.7 kB) · 10.6 kB CSS (+235 B) — — · — · —
ChatComposerInput 🔴 70.0 kB (+3.7 kB) · 10.8 kB CSS (+232 B) — — · — · —
ChatComposerTokenElement 🔴 70.0 kB (+3.7 kB) · 10.8 kB CSS (+232 B) — — · — · —
TopNavMegaMenu 🔴 64.8 kB (+3.7 kB) · 11.4 kB CSS (+228 B) — — · — · —
TopNavMenu 🔴 69.6 kB (+3.7 kB) · 10.8 kB CSS (+236 B) — — · — · —
BreadcrumbItem 🔴 79.5 kB (+3.6 kB) · 11.7 kB CSS (+229 B) — — · — · —
TabMenu 🔴 66.8 kB (+3.6 kB) · 10.7 kB CSS (+234 B) — — · — · —
Lightbox 🔴 106.6 kB (+3.6 kB) · 10.0 kB CSS (+237 B) — — · — · —
lab/DiffViewer 🔴 81.9 kB (+3.8 kB) · 2.1 kB CSS (0) — — · — · —
AlertDialog 🔴 99.3 kB (+3.6 kB) · 13.9 kB CSS (+237 B) — — · — · —
SideNav 🔴 84.6 kB (+3.6 kB) · 10.9 kB CSS (+235 B) — — · — · —
lab/TourStep 🔴 70.9 kB (+3.8 kB) · 590 B CSS (0) — — · — · —
MobileNav 🔴 65.1 kB (+3.5 kB) · 10.2 kB CSS (+242 B) — — · — · —
TopNav 🔴 66.8 kB (+3.5 kB) · 10.5 kB CSS (+237 B) — — · — · —
DropdownMenu 🔴 89.7 kB (+3.7 kB) · 16.7 kB CSS (0) — — · — · —
MoreMenu 🔴 90.0 kB (+3.7 kB) · 16.7 kB CSS (0) — — · — · —
richtext/RichTextEditorToolbar 244.4 kB (+442 B) · 454 B CSS (0) — — · — · —
lab/Comments 302.1 kB (+366 B) · 2.5 kB CSS (0) — — · — · —
Timestamp 23.2 kB (+47 B) · 9.8 kB CSS (+239 B) — — · — · —
lab/CommentThread 296.4 kB (+275 B) · 2.4 kB CSS (0) — — · — · —
lab/EmojiPicker 81.4 kB (+174 B) · 751 B CSS (0) — — · — · —
Markdown 162.3 kB (+146 B) · 19.5 kB CSS (0) — — · — · —
lab/CommentComposer 120.2 kB (+146 B) · 1.9 kB CSS (0) — — · — · —
richtext/RichTextView 271.2 kB (+131 B) · 2.3 kB CSS (0) — — · — · —
FileInput 64.4 kB (+225 B) · 10.5 kB CSS (−101 B) — — · — · —
MultiSelector 88.9 kB (+188 B) · 16.2 kB CSS (−94 B) — — · — · —
DateRangeInput 85.8 kB (+197 B) · 12.0 kB CSS (−104 B) — — · — · —
lab/Schedule 99.3 kB (+93 B) · 3.9 kB CSS (0) — — · — · —
DateTimeInput 195.3 kB (+183 B) · 18.0 kB CSS (−96 B) — — · — · —
ComplexSelector 65.9 kB (+86 B) · 11.3 kB CSS (0) — — · — · —
NumberInput 67.0 kB (+186 B) · 11.0 kB CSS (−101 B) — — · — · —
TextInput 62.9 kB (+179 B) · 10.7 kB CSS (−103 B) — — · — · —
lab/ListInput 95.5 kB (+67 B) · 1.6 kB CSS (0) — — · — · —
Selector 93.3 kB (+169 B) · 16.8 kB CSS (−104 B) — — · — · —
TimeInput 149.8 kB (+179 B) · 15.3 kB CSS (−120 B) — — · — · —
DateInput 172.9 kB (+143 B) · 16.3 kB CSS (−105 B) — — · — · —
richtext/RichTextEditor 290.9 kB (+13 B) · 2.6 kB CSS (0) — — · — · —
TextArea 57.9 kB (+9 B) · 9.2 kB CSS (0) — — · — · —
ButtonGroup · Storybook 40.1 kB (+7 B) · 3.7 kB CSS (0) 146 (0) — · — · —
Field 50.5 kB (+6 B) · 7.2 kB CSS (0) — — · — · —
InputGroup 52.1 kB (+6 B) · 7.8 kB CSS (0) — — · — · —
RadioListItem 62.7 kB (+6 B) · 9.8 kB CSS (0) — — · — · —
SegmentedControlItem 16.2 kB (+6 B) · 4.3 kB CSS (0) — — · — · —
InfoTip · Storybook 43.3 kB (+5 B) · 5.3 kB CSS (0) 148 (0) — · — · —
RadioList 51.8 kB (+4 B) · 7.2 kB CSS (0) — — · — · —
lab/PageControl 71.7 kB (+4 B) · 709 B CSS (0) — — · — · —
lab/SelectableCardGroup 59.7 kB (+4 B) · 162 B CSS (0) — — · — · —
FieldLabel 47.1 kB (+3 B) · 5.6 kB CSS (0) — — · — · —
Slider 101.8 kB (+3 B) · 8.7 kB CSS (0) — — · — · —
Switch 96.3 kB (+2 B) · 9.8 kB CSS (0) — — · — · —
CheckboxList 54.3 kB (+1 B) · 7.9 kB CSS (0) — — · — · —
CheckboxIndicator 2.7 kB (0) · 813 B CSS (0) — — · — · —
CheckIndicator 8.0 kB (0) · 681 B CSS (0) — — · — · —
List 5.4 kB (0) · 469 B CSS (0) — — · — · —
RadioIndicator 2.5 kB (0) · 725 B CSS (0) — — · — · —
SegmentedControl 89.5 kB (0) · 6.8 kB CSS (0) — — · — · —
lab/NavigationScreen 78.4 kB (0) · 1.5 kB CSS (0) — — · — · —
lab/NavigationStack 78.4 kB (0) · 1.5 kB CSS (0) — — · — · —
CheckboxInput · Storybook 59.8 kB (−1 B) · 9.1 kB CSS (0) 441 (0) — · — · —
CheckboxListItem 65.9 kB (−1 B) · 10.9 kB CSS (0) — — · — · —
ListItem 64.9 kB (−1 B) · 10.9 kB CSS (0) — — · — · —
Pagination 103.3 kB (+70 B) · 17.2 kB CSS (−113 B) — — · — · —
lab/TransferListSelector 96.9 kB (−55 B) · 1.9 kB CSS (0) — — · — · —
lab/TransferList 90.0 kB (−63 B) · 1.7 kB CSS (0) — — · — · —
lab/ChatEmojiPicker 78.5 kB (−69 B) · 773 B CSS (0) — — · — · —
lab/ChatReactionBar 79.7 kB (−97 B) · 1.1 kB CSS (0) — — · — · —
TableCell 91.6 kB (−109 B) · 17.0 kB CSS (0) — — · — · —
ContextMenu 90.4 kB (−139 B) · 16.6 kB CSS (0) — — · — · —
PowerSearch 270.9 kB (−72 B) · 23.1 kB CSS (−80 B) — — · — · —
TableHeaderCell 91.2 kB (−154 B) · 16.8 kB CSS (0) — — · — · —
Tokenizer 84.7 kB (−52 B) · 18.0 kB CSS (−107 B) — — · — · —
Table 99.7 kB (−188 B) · 17.3 kB CSS (0) — — · — · —
Typeahead 74.2 kB (−177 B) · 12.0 kB CSS (−99 B) — — · — · —

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

API changes: none in this pull request

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

Wide change (shared styles: packages/core/src/internal/touchHitArea.stylex.ts, packages/core/src/utils/touchHitArea.stylex.ts): add ci:run-visual, ci:run-a11y or ci:run-rtl to run them.


Generated by PR Enrichment workflow | View full report

…p and never takes a neighbor's tap

A Touch targets story puts a dense toolbar above a field with a clear button;
the browser spec measures each band against its neighbors and taps the gap,
the band and the field's text.
@cixzhang

cixzhang commented Nov 6, 2026

Copy link
Copy Markdown
Contributor Author

/approve-spec a83f5f8

@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. The repository's CI runs nothing on a draft, so marking this ready is what starts it, including the touch interaction job the description names as its evidence.

Under a finger, standalone and enabled Buttons and IconButtons now take a band that grows toward 44 px and stops halfway to each neighbor, the input clear button uses the same band instead of its fixed 24 px overlay, and nothing changes under a mouse. The new browser spec and unit tests pass on this head in Chromium.

  • Non-blocking: the new comment above hasHitArea in Button.tsx restates what useTouchHitArea does; a shorter version that keeps only the reasons is suggested inline.

[Automated review]

Comment thread packages/core/src/Button/Button.tsx Resolved
@cixzhang
cixzhang marked this pull request as ready for review November 6, 2026 05:48
…resolves it; split the clear-button browser proof

Swizzle rewrites every .stylex import to its package subpath, so
utils/touchHitArea.stylex joins the deliberate STATIC_EXPORTS entries. The
clear button's text-tap and band-tap checks run on fresh pages, so one tap
cannot change how WebKit reads the next.
internal/touchHitArea.stylex is listed with the other internal entries, so
swizzle resolves it and it stays outside the public API. This replaces the
public subpath. Every importer follows the move, so a swizzled ListItem,
CheckboxInput, RadioListItem, InfoTip or SegmentedControl item resolves it
too.
@cixzhang
cixzhang marked this pull request as draft November 6, 2026 06:54
@cixzhang

cixzhang commented Nov 6, 2026

Copy link
Copy Markdown
Contributor Author

/approve-spec 717ea6f

@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: two small fixes before this can merge.

  • The new ./internal/touchHitArea.stylex export makes packages/core/src/__tests__/publicStyleXNamespaces.test.ts fail ("cover every exported .stylex subpath and style namespace"); import the module, add the subpath to styleNamespacesBySubpath and modulesBySubpath, and add touchHitAreaStyles to PropsOnlyNamespaces.
  • The changeset's last sentence says swizzling a Button, ListItem, CheckboxInput, RadioListItem, InfoTip or SegmentedControl no longer leaves an unresolved touch-band style import, but a swizzled Button never had that import, and each of those copies still imports useTouchHitArea from @astryxdesign/core/utils, which does not export it; please drop the sentence or narrow it to the style import that now resolves.

The touch band itself looks right: standalone, enabled Buttons and the input clear button get the shared coarse-pointer band, and nothing changes under a mouse. The earlier comment-style suggestion on Button.tsx still applies and is non-blocking.

[Automated review]

Comment thread packages/core/package.json Resolved
Comment thread .changeset/button-touch-band.md Resolved
@cixzhang
cixzhang marked this pull request as draft November 6, 2026 17:19
@cixzhang

cixzhang commented Nov 6, 2026

Copy link
Copy Markdown
Contributor Author

/approve-spec b0d6684

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

Requesting changes: one blocking issue with the input clear button in WebKit.

  • Miss: In WebKit, taps a few pixels beside the input clear ✕ (2–4 px below, 2–8 px right, 3–5 px above), which clear the field on main, do nothing on this head, because they now land on the band inside the button and InputClearButton's onPointerDown (InputClearButton.tsx:96) cancels every touch pointerdown, which in WebKit drops the click; skip preventDefault() for a touch pointerdown (the onMouseDown handler still keeps focus in the field), then drop the WebKit note in component:Field and the WebKit test.fixme, whose stated cause, engine touch adjustment, is not what happens.

The earlier press-check issue is fixed: in WebKit, a band tap nearer an offset neighbour is now swallowed instead of pressing the farther Button. Non-blocking: the offset-neighbour browser case's WebKit taps round onto the neighbour's band, so that leg passes without the fix; a whole-pixel point inside the first button's band would cover it.

[Automated review]

@cixzhang
cixzhang marked this pull request as ready for review November 6, 2026 17:50
WebKit drops the click of a touch whose pointerdown is cancelled, so a
tap on the band beside the clear button did nothing. The button cancels
pointerdown only for a mouse or pen now; for touch, its mousedown
handler still keeps focus in the field. The WebKit fixme and the Field
and Button records' gap notes go. The offset-neighbour browser case taps
a whole pixel inside Undo's band, so its WebKit leg fails without the
press check.
@cixzhang
cixzhang marked this pull request as draft November 6, 2026 19:05
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Nov 6, 2026
@cixzhang

cixzhang commented Nov 6, 2026

Copy link
Copy Markdown
Contributor Author

/approve-spec 319e3b0

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Nov 6, 2026
@cixzhang
cixzhang marked this pull request as ready for review November 6, 2026 19:37

@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: the touch band works as described for Buttons and on the text side of the clear button, but one regression in the clear button needs a fix first.

  • Miss: on a clearable Selector or MultiSelector, a finger tap on the disclosure chevron now clears the value instead of opening the list, in Chromium and WebKit, because the clear button's band reaches 12 px past the ✕ over the chevron with nothing to clamp it; stopping the band at half the gap to the next item in the field, and adding a browser case that taps the chevron, would fix it.

The rest checks out: bands stop at half the gap between buttons, nothing changes under a mouse, and a tap on the clear band clears and keeps focus in the field in both engines. Non-blocking: the header of internal/touchHitArea.stylex.ts still describes the band only as the host's own ::after, and the edited JSDoc line in utils/touchHitArea.ts needs rewrapping.

[Automated review]

…xt part

A clearable Selector's chevron sits 8 px past the clear button and is not
interactive itself, so no hit-area neighbour stopped the band over it: a
finger tap on the chevron cleared the value instead of opening the list.
The clear button passes Button a growth that stops each side at half the
gap to the field's next part (chevron, status icon, spinner), through an
internal ButtonHitAreaContext. A browser case taps a clearable Selector's
chevron. The touchHitArea headers name the descendant band.
@cixzhang
cixzhang marked this pull request as draft November 6, 2026 20:00
@cixzhang

cixzhang commented Nov 6, 2026

Copy link
Copy Markdown
Contributor Author

/approve-spec 054f11c

…:AST-094 FR42)

The verification map gains a row for the browser cases: the clear band
stops at half the gap to the text and to the field's next part, and a tap
on a clearable Selector's chevron opens it.
@cixzhang

cixzhang commented Nov 6, 2026

Copy link
Copy Markdown
Contributor Author

/approve-spec a60af0a

@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: the Button band and the clear button's band beside the text work as described in Chromium and WebKit, and the chevron fix works in Chromium, but two things need fixing first.

  • In WebKit, a finger tap at the centre of a clearable Selector's or MultiSelector's chevron still clears the value instead of opening the list (it opens on main), and the new chevron case in ButtonHitArea.interaction.browser.spec.ts fails in WebKit, so the clear button's reach toward the chevron needs to stay short enough for WebKit (main's 2 px holds) or the chevron area needs to take the field's open tap.
  • clearButtonGrowth in InputClearButton.tsx re-implements the half-gap clamp that clampedHitInsets in utils/hitArea.ts already provides, so pass the field's parts to the shared clamp (as useGroupPressTracking does with groupGrowth) instead of keeping a second copy.

Unit tests, Core's typecheck and the other browser cases pass. Non-blocking: the last sentence of clearButtonGrowth's JSDoc could be split into two shorter ones.

[Automated review]

@cixzhang
cixzhang marked this pull request as ready for review November 6, 2026 20:29
… parts

In WebKit, a tap moves toward a clickable element near it, and the chevron
is not clickable itself, so a band 4 px from the chevron still took a tap
on its centre. Toward a part beside it, the band now stops at 2 px, the
reach of the old overlay. The half-gap clamp is the shared
clampedHitInsets, given the field's parts.
@cixzhang
cixzhang marked this pull request as draft November 6, 2026 21:13
@cixzhang

cixzhang commented Nov 6, 2026

Copy link
Copy Markdown
Contributor Author

/approve-spec 26bd5ed

@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, because a draft runs no CI until it is marked ready for review.

Both earlier blocking findings are fixed: a finger tap on a clearable Selector's chevron now opens the list in WebKit as well as Chromium, and clearButtonGrowth uses the shared clampedHitInsets. The browser spec's touch-band cases pass in both engines, on this head and merged with main.

[Automated review]

@cixzhang
cixzhang marked this pull request as ready for review November 6, 2026 21:46
@cixzhang
cixzhang merged commit e10347c into main Nov 7, 2026
124 checks passed
@github-actions
github-actions Bot deleted the lane4/button-touch-band branch November 7, 2026 06:03

This branch was successfully deployed

1 active deployment
Preview — 26bd5ed8 Deployed Nov 6, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

1 participant