Skip to content

spec(native): Switch labelPosition and labelSpacing are web-only; Apple rows follow the system toggle layout - #8362

Merged
cixzhang merged 2 commits into
mainfrom
spec/native-switch-label-web-only
Oct 25, 2026
Merged

cixzhang merged 2 commits into
mainfrom
spec/native-switch-label-web-only

Conversation

@cixzhang

@cixzhang cixzhang commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Exact decision needed

Apply the owner's ruling of Oct 24: Switch's labelPosition and labelSpacing are web-only. On Apple platforms a switch row follows the system toggle layout: the label leading, the switch trailing, and the system's spacing between them.

What changes for people

A person using an Astryx Switch on iPhone, iPad, or Mac sees a settings row laid out the way every other switch on their device is, and the label reads first with VoiceOver. An iOS developer gets no parameter that would move the switch to an un-Apple position or change spacing the system owns.

Existing authority searched

  • spec:AST-082 FR3 (current): a prop a platform cannot honor with its own control belongs to the platforms that can; a platform never offers a prop it does not fully honor.
  • architecture:public-component-api INV2: a name carries the same meaning everywhere.
  • The Swift component API spec on main (A2, with Switch size as macOS-only), which this pull request extends with the same kind of rule.

Search terms (repository records and open pull requests): labelPosition, labelSpacing, Switch with native, web-only with native, component-api A2. Records found: only the Swift component API spec's existing Switch size rule; no record states Switch's label layout on any platform. Overlapping open pull requests inspected: #8027 (native screenshot CI), #8306 (Swift Avatar), #8321 (Swift Item); none touches Switch or these props. No other open pull request names labelPosition or labelSpacing.

Decision

  • Component API A2: Switch's labelPosition and labelSpacing are web-only; an Apple switch row follows the system toggle layout. No general rule is added; other components' layout props are decided on their own.
  • Check: the Swift Switch view takes neither parameter, and a capture shows the system row layout in light, dark, and the largest text size.
  • Current state: the generated SwitchProps still declare both props on iOS and macOS. Removing them from the native contracts is a generator change that follows this record.

Rejected alternatives

None recorded in the records.

Claim scope and non-goals

Only Switch's two label-layout props. The web Switch keeps both, unchanged. The generator change and the Swift Switch view are separate pull requests.

Writing rubric results

  • R1 narration: none.
  • R2 research in the record: none.
  • R3 evidence naming a change: none.
  • R4 rejected alternatives: none.
  • R5 pull request or issue references remaining: none in the records.
  • R6 ruled open questions still listing options: none.

Scope

  • Specification only; no implementation.
  • Every changed file is under packages/native/.
  • Public text contains no internal context.

@vercel

vercel Bot commented Oct 25, 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 Oct 25, 2026 5:52am UTC

Request Review

@astracat-bot

astracat-bot Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

AI review status for this pull request.

Review status Updated
🟡 Reviewed (for maintainers only) Oct 25, 2026, 12:09 PM UTC

@cixzhang
cixzhang marked this pull request as ready for review October 25, 2026 04:18
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 88fd5ff

@github-actions

github-actions Bot commented Oct 25, 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

No component packages changed.

Accessibility Audit

Status: No accessibility violations detected.

Visual Regression

48 of 502 shot(s) changed.

A change here is a question, not a failure: check whether the after is the
picture you intended. Record that review on the PR. Baseline maintenance is an
explicit dispatch of CI; this report never rewrites the baseline or adds a release gate.

component story theme mode pixels
Selector Indicator Space Bottom Sheet Narrow End RTL neutral light 753,933
Selector Indicator Space Bottom Sheet Wide Start neutral light 740,072
RichTextEditor Markdown parity: side by side probe dark 556,900
RichTextEditor Markdown parity: side by side probe light 538,816
Chat Full AI Chat probe light 230,823
Chat Full AI Chat probe dark 229,805
AppShell With Mobile Nav probe light 217,010
AppShell With Mobile Nav probe dark 216,960
Collapsible Dividers probe dark 66,445
Collapsible Dividers probe light 66,445
AppShell Playground neutral dark 65,198
AppShell Playground neutral light 63,788
Chat Default neutral dark 36,304
Chat Default neutral light 35,767
Chat Empty State probe light 23,531
Chat Empty State probe dark 22,622
ChatAutoScroll Scroll Behavior Comparison neutral dark 15,378
ChatAutoScroll Scroll Behavior Comparison neutral light 14,107
Chat With Attachments probe light 13,406
Chat With Attachments probe dark 11,232

and 28 more.


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

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

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

Changes requested: the Switch ruling is approved for this head by an engineering owner and fits AST-082 FR3, but the new general sentence in A2 reaches further than the Switch-only scope the pull request states. As written, "a prop that sets a layout the platform's own control fixes belongs to the web contract" also covers Selector's indicatorPosition, which the generated iOS and macOS SelectorProps still declare and which the Current state section does not list. Please either scope that sentence to Switch's two props, or keep the general rule and add Selector's indicatorPosition to the Current state bullet. The new commit then needs a fresh /approve-spec <full head SHA> from an engineering owner.

[Automated review]

Comment on lines +66 to +68
which only macOS can honor with the system switch. A prop that sets a layout
the platform's own control fixes belongs to the web contract: Switch's
`labelPosition` and `labelSpacing` are web-only, because an Apple switch row

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This general rule reaches beyond Switch: Selector's indicatorPosition also sets a layout the system picker fixes (the edge that carries the selection mark), and the generated iOS and macOS SelectorProps still declare it. Either scope this sentence to Switch's two props, or keep the rule and add Selector's indicatorPosition to the Current state bullet.

@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 071a3a7

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

Requesting changes to the description only: the record text is fine and already carries an engineering owner's approval for this exact head. Two open pull requests edit this same file, #8288 (moves it to packages/native/specs/swift/component-api.spec.md as a current record) and #8310 (amends A4), and architecture:knowledge-contracts INV13 asks the "Existing authority searched" section to record open work like that. Please list both there and say which should merge first, so the later one carries the new A2 sentence and check row. Editing the description adds no commit, so the existing approval still applies.

[Automated review]

@cixzhang
cixzhang merged commit 6f1ee41 into main Oct 25, 2026
71 checks passed
@github-actions
github-actions Bot deleted the spec/native-switch-label-web-only branch October 26, 2026 06:31

This branch was successfully deployed

1 active deployment
Preview — 071a3a78 Deployed Oct 25, 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant