fix(core): floor SegmentedControlItem to a 44px touch target on coarse pointers by ManoharPaturi · Pull Request #6084 · facebook/astryx · GitHub
Skip to content

fix(core): floor SegmentedControlItem to a 44px touch target on coarse pointers - #6084

Open
ManoharPaturi wants to merge 2 commits into
facebook:mainfrom
ManoharPaturi:fix/segmented-control-touch-floor
Open

ManoharPaturi wants to merge 2 commits into
facebook:mainfrom
ManoharPaturi:fix/segmented-control-touch-floor

Conversation

@ManoharPaturi

Copy link
Copy Markdown
Contributor

Fixes #6013

Summary

SegmentedControlItem topped out at 32px (size="lg" = --size-element-lg − 4px), below the 44px minimum touch target of WCAG 2.2 AA "Target Size (Minimum)" / Apple HIG / Material — and since lg is the ceiling, no prop combination could reach the floor. Button and ToggleButton already honour the floor on phone surfaces; the segmented control's class was simply not in it.

Change

A @media (pointer: coarse) min-height: 44px floor on the item's base style — mirroring TouchDateField's monthArrow floor (min-height scoped to coarse pointers, default: null). Every size is floored on touch; desktop density is unchanged (no unconditional rule), which is the part consumers cannot safely do themselves.

Tests

New case in SegmentedControl.test.tsx using the repo's injectedRules() CSSOM pattern (mirroring InputClearButton): the item's classes have a coarse-pointer rule carrying min-height: 44px, and no unconditional min-height exists. Verified the test fails on the unfloored component and passes with the fix.

vitest run packages/core/src/SegmentedControl → 44 passed; core tsc --noEmit, eslint, check:sync, and check:changesets clean. Doc note on the size prop; changeset included.

Copilot AI lite review requested due to automatic review settings September 6, 2026 06:33
@vercel

vercel Bot commented Sep 6, 2026 •

Copy link
Copy Markdown

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Sep 6, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions github-actions Bot added community Authored by a community contributor (not on the eng/design team) needs:code-review High-risk change (new package/component/API) — needs human code review before merge labels Sep 6, 2026
github-actions Bot added a commit that referenced this pull request Sep 6, 2026
@github-actions

github-actions Bot commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

📚 Storybook Preview

View Storybook for this PR

🧪 Sandbox Preview

View Sandbox for this PR

No new or modified components detected.

Bundle Size Summary

Package Size (ESM) Size (CJS) Gzipped
@astryxdesign/core N/A 4.9KB 1.2KB

Accessibility Audit

Status: No accessibility violations detected.

Visual Regression

Status: No visual change across 420 compared shot(s).


Generated by PR Enrichment workflow | Storybook | Sandbox | View full report

…e pointers

Signed-off-by: Manohar Paturi <186662190+ManoharPaturi@users.noreply.github.com>
@ManoharPaturi
ManoharPaturi force-pushed the fix/segmented-control-touch-floor branch from 3c610be to 08a3883 Compare September 17, 2026 17:46
github-actions Bot added a commit that referenced this pull request Sep 17, 2026
@ManoharPaturi

Copy link
Copy Markdown
Contributor Author

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Approval needs a maintainer decision first: please provide or identify the governing spec that adopts a 44px coarse-pointer touch target for SegmentedControl, and settle whether the intended contract is a 44px minimum height only or a full 44 by 44 target.

No current spec was found that settles this — the adopted accessibility baseline is WCAG 2.2 AA, whose target-size minimum is 24 by 24, and the component sizing records remain drafts. Until that contract is settled, the implementation cannot be approved as written. Separately, the doc, changeset, and code comment should not call 44px the WCAG AA minimum, and should not promise a 44px target in both dimensions while the rule floors only height and icon-only items remain 30/40/42px wide — please correct that wording, and add the inline floor and icon-only coverage if the settled contract is 44 by 44.

[Automated review]

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Approval needs a maintainer decision first: no current Astryx spec adopts a 44px coarse-pointer touch target for SegmentedControl, so a maintainer must provide or identify one and settle whether it means a 44px minimum height, as implemented here, or 44×44. Independently of that decision, please stop describing 44px as WCAG 2.2 AA “Target Size (Minimum)” (that criterion, 2.5.8, is 24×24 CSS px; 44×44 is the AAA criterion 2.5.5) and make the size doc match the rule, since icon-only segments stay 30/40/42px wide on touch. The changeset should also use [feat] rather than [fix] unless the change restores an existing spec, and drop the claim that every other control already honours 44px, because Button stays 28/32/36px on touch.

[Automated review]

This branch was successfully deployed

1 active deployment
Preview — 91733bd7 Deployed Sep 26, 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. community Authored by a community contributor (not on the eng/design team) needs:code-review High-risk change (new package/component/API) — needs human code review before merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SegmentedControl is 32px at size="lg", below the 44px touch-target floor at every size

2 participants