Skip to content

Navigation Menu

Sign in
Sign up

fix(core): scope the 16px input floor to iOS - #6085

Open
ManoharPaturi wants to merge 2 commits into
facebook:main from
ManoharPaturi:fix/input-floor-ios-only
Open

fix(core): scope the 16px input floor to iOS #6085
ManoharPaturi wants to merge 2 commits into
facebook:main from
ManoharPaturi:fix/input-floor-ios-only

Conversation

@ManoharPaturi

@ManoharPaturi ManoharPaturi commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Fixes #6015

Summary

Text controls carried @media (pointer: coarse) { font-size: max(1rem, var(--text-body-size)) } — the iOS no-zoom floor — for every coarse pointer. Only iOS Safari zooms on focus below 16px; Android and desktop-touch browsers do not, so non-iOS touch users got inflated text for no benefit. This nests the floor in @supports (-webkit-touch-callout: none) inside the existing coarse-pointer branch (option 1 from the issue): iOS output is byte-identical, every other platform keeps the theme's token size.

Scope

All 19 floored sites, found by recursive scan rather than by hand: 16 body-size controls (including RichTextEditor in packages/richtext, which carried the identical rule), 3 label-size controls (Selector, ComplexSelector, PanelSearchInput), and the two derived height: firstThatWorks('1lh', ...) fallbacks in NativeDateField/nativePickerSegmentStyles, which became conditional so pre-1lh browsers stay height-consistent on both sides of the gate.

Tests

  • New family-wide source-invariant suite packages/core/src/inputFontFloor.test.ts: asserts every floored control carries the iOS gate and (recursively) that no bare coarse-pointer floor remains anywhere in core — so a future control can't reintroduce the over-broad rule.
  • A declaredValue read-back test in TextInput.test.tsx. (Source-level assertions are necessary: jsdom's CSSOM silently drops at-rule-wrapped max(1rem, ...) declarations — verified empirically against the old pattern too, so the old code was equally untestable that way.)

Docs (ChatComposerInput.doc.mjs, all locales) now say "iOS" where they said "touch device". Changeset included.

Verification

Affected suites 714 + 656 passed, dependents 183 passed, final commit pass 77; tsc --noEmit clean (core + richtext); eslint 0 errors on touched files; check:sync and check:changesets clean.

vercel Bot commented Sep 6, 2026
edited
Loading

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Sep 6, 2026 8:08am UTC

Request Review

@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 needs:design-review Affects visuals — Design should review labels Sep 6, 2026
github-actions Bot added a commit that referenced this pull request Sep 6, 2026

github-actions Bot commented Sep 6, 2026
edited
Loading

Copy link
Copy Markdown
Contributor

PR Analysis Report

📚 Storybook Preview

View Storybook for this PR
GitHub Pages may take up to a minute to hydrate after deploy.

🧪 Sandbox Preview

View Sandbox for this PR
GitHub Pages may take up to a minute to hydrate after deploy.

Modified Components

Chat (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A N/A N/A
Lines of Code N/A 5600 -
Complexity N/A Very High (456) -
CommandPalette (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A N/A N/A
Lines of Code N/A 1012 -
Complexity N/A Very High (114) -
ComplexSelector (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A N/A N/A
Lines of Code N/A 461 -
Complexity N/A Very High (44) -
DateInput (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A N/A N/A
Lines of Code N/A 3312 -
Complexity N/A Very High (356) -
DateRangeInput (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A N/A N/A
Lines of Code N/A 541 -
Complexity N/A Very High (66) -
DateTimeInput (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A N/A N/A
Lines of Code N/A 3404 -
Complexity N/A Very High (532) -
Field (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A N/A N/A
Lines of Code N/A 805 -
Complexity N/A Very High (50) -
FileInput (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A N/A N/A
Lines of Code N/A 663 -
Complexity N/A Very High (102) -
NumberInput (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A N/A N/A
Lines of Code N/A 1071 -
Complexity N/A Very High (151) -
Selector (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A N/A N/A
Lines of Code N/A 2001 -
Complexity N/A Very High (222) -
TextArea (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A N/A N/A
Lines of Code N/A 436 -
Complexity N/A Very High (65) -
TextInput (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A N/A N/A
Lines of Code N/A 333 -
Complexity N/A Very High (55) -
TimeInput (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A N/A N/A
Lines of Code N/A 528 -
Complexity N/A Very High (91) -
Typeahead (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A N/A N/A
Lines of Code N/A 1354 -
Complexity N/A Very High (188) -
RichTextEditor (@astryxdesign/richtext) · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A N/A N/A
Lines of Code N/A 604 -
Complexity N/A Very High (57) -

Bundle Size Summary

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

Accessibility Audit

Status: 4 accessibility violation(s) found — 2 critical, 2 serious.

DateRangeInput - 1 issue(s)
  • 🔴 critical: Ensure an element's role supports its ARIA attributes
    • Rule: aria-allowed-attr · Affects 1/20 stories · Learn more
    • WCAG: 4.1.2 (Level A)
FileInput - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 3/15 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
RichTextEditor - 2 issue(s)
  • 🟠 serious: Ensure every ARIA input field has an accessible name
    • Rule: aria-input-field-name · Affects 2/18 stories · Learn more
    • WCAG: 4.1.2 (Level A)
  • 🔴 critical: Ensure every form element has a label
    • Rule: label · Affects 1/18 stories · Learn more
    • WCAG: 4.1.2 (Level A)

Visual Regression

2 of 32 shot(s) changed. View the report

A repository maintainer can accept these exact frames: /accept-visual 34020809682/1 <why every changed frame is correct>

A change here is a question, not a failure: check whether the after is the
picture you intended. If it is, say so in the PR — the release gate's baseline
is updated deliberately, and this check never rewrites it.

component story theme mode pixels
ComplexSelector Fruit ripeness selector neutral light 3,992
ComplexSelector Fruit ripeness selector neutral dark 3,825
ComplexSelector — Fruit ripeness selector — neutral light
BeforeAfterDiff
Before visual regression frame After visual regression frame Pixel difference frame
ComplexSelector — Fruit ripeness selector — neutral dark
BeforeAfterDiff
Before visual regression frame After visual regression frame Pixel difference frame

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

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

Thanks for tightening the floor to iOS. The Chromium path and generated CSS look right, but the family regression guard omits RichTextEditor. Please include the rich-text package so all 19 changed controls are protected.

[Reviewed by Robohands]

ManoharPaturi reacted with heart emoji
'TextArea/TextArea.tsx',
'TextInput/TextInput.tsx',
'TimeInput/TimeInput.tsx',
'Typeahead/BaseTypeahead.tsx',

@cixzhang cixzhang Sep 6, 2026

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 omits RichTextEditor, so its broad coarse-pointer floor can regress while this ‘family-wide’ suite stays green.

[Reviewed by Robohands]

Copy link
Copy Markdown
Contributor Author

Done in the updated branch — inputFontFloor.test.ts now scans the rich-text package too: RichTextEditor.tsx is in the gated-controls list (path relative to core), and the bare-floor offender scan covers packages/richtext/src alongside core, so a reintroduced ungated floor fails wherever it lands in either tree. Both guard tests green.

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

Thanks for fixing the RichTextEditor coverage gap—the family guard and non-iOS path now check out. I still can’t verify the iOS half of this compatibility fix. Please add latest-stable iOS Safari evidence showing the nested gate computes the input to 16px and focusing it keeps visualViewport.scale at 1, with the device/OS/Safari version and this exact head recorded. Chromium or Playwright WebKit cannot establish that browser-specific behavior.

[Reviewed by Robohands]

ManoharPaturi reacted with heart emoji

ManoharPaturi commented Sep 6, 2026
edited
Loading

Copy link
Copy Markdown
Contributor Author

Real-device evidence, as requested — captured on an iPhone running current Safari 27.0, at head d2b04b4 (fix/input-floor-ios-only).

I put up a self-contained harness that embeds the exact nested gate from this PR's head, so the numbers below are recorded on-device against this change: https://manoharpaturi.github.io/astryx/ios-floor-evidence.html

Environment (recorded on-device):

  • userAgent: Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/27.0 Mobile/15E148 Safari/604.1 (Safari 27.0; the OS token in Safari's UA is a frozen compatibility string — Version/27.0 is the actual browser version)
  • maxTouchPoints 5 · (pointer: coarse) matches · CSS.supports('-webkit-touch-callout', 'none') true · initial visualViewport.scale 1

Field A — gated by the fix (font-size: var(--text-body-size) + the nested @media (pointer: coarse) { @supports (-webkit-touch-callout: none) { font-size: max(1rem, var(--text-body-size)) } } from this head):

  • computed font-size: 16px
  • min visualViewport.scale while focused: 1 — focusing does not zoom

Field B — negative control (raw font-size: 14px, no gate):

  • computed font-size: 14px
  • min scale while focused: 1.142 — iOS auto-zooms on focus, confirming the harness does detect the failure mode on this device

iOS Safari evidence — Field A floors to 16px with no zoom; the un-gated 14px control zooms to 1.142x

The harness prints astryx PR #6085 · head d2b04b4 in its header, so the recording is bound to this exact head.

I hope this help you to verify.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot
Copilot review effort, defaults to Lite
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments
@cixzhang cixzhang cixzhang requested changes
@imdreamrunner imdreamrunner Awaiting requested review from imdreamrunner imdreamrunner is a code owner
@josephfarina josephfarina Awaiting requested review from josephfarina josephfarina is a code owner
@potatowagon potatowagon Awaiting requested review from potatowagon potatowagon is a code owner
@cvkxx cvkxx Awaiting requested review from cvkxx
@ernestt ernestt Awaiting requested review from ernestt
@kentonquatman kentonquatman Awaiting requested review from kentonquatman
@rubyycheung rubyycheung Awaiting requested review from rubyycheung

Requested changes must be addressed to merge this pull request.

Assignees

No one assigned

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 needs:design-review Affects visuals — Design should review

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Scope the 16px input floor to iOS, not every coarse pointer

AltStyle によって変換されたページ (->オリジナル) /