Repository navigation
spec(Switch): React Native platform record - #12834
imdreamrunner wants to merge 5 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
There was a problem hiding this comment.
This draft record needs an engineering owner's decision before it can be approved: component:react-native/Switch adds requirements (FR1–FR8, AR1–AR4, DEC-1 to DEC-3) that no current spec states yet.
An engineering owner records the decision by commenting /approve-spec <full head SHA>, and as an engineering owner the author may do so. The decision also covers render, named beside core's presentation: 'native', and the boolean isBackSwipeAllowed, which architecture:public-component-api INV2 would express as a <thing>Behavior union. Approval would not clear the findings below, each of which needs a change to the record or, first, an amendment to the current record it contradicts:
- FR3 and ORD1 draw core's switch where the platform has its own (
render="drawn", a themerender.defaultofdrawn, or a square-corner theme), butspec:AST-082FR11 andspec:AST-093FR2 allow a custom control only where the platform has none. - AR3 says a disabled switch with a reason "is not reported as disabled", which contradicts
spec:AST-085FR5's requirement that the disabled state be exposed together with the name and reason. - DEC-3 and FR7 leave
sizeandisBackSwipeAllowedaccepted but ignored underrender="system", whichspec:AST-082FR3 ("never offers a prop it does not fully honor") and INV3 do not allow. - The FR3, FR4 and AR1 basis cells cite
spec:AST-126FR2, FR11 and FR12, which leave Switch out, and "Open questions: None." treatsspec:AST-126OQ6 as settled although it is still open.
Claims and files checked
- Review mode: full; reason: no-earlier-review
- Claim: the record is stacked on the knowledge-check change and merges after it. Verified: the base branch is that pull request's head.
- Claim: the record cites the open control, gesture and system-module drafts and the foundation amendment for FR16, FR19 and FR21. Verified: those claims exist only in those open pull requests.
- Claim: the descriptions of the current Switch, native-first and disabled-focus records. Verified against those records on
main. - Claim: the control-group draft's FR2 gap and OQ6 leave Switch's system presentation to React Native's own switch. False: OQ6 is an open design question with two options.
- Claim: no Swift Switch record exists, and no open pull request adds a React Native Switch record. The Swift part is verified on
main; the open pull request part was not enumerated. - Claim: the Decision bullets match the record. Verified against FR1, FR3, FR4, FR6–FR8, AR1–AR4 and DEC-1 to DEC-3.
- Claim: each requirement was read against the current React Native implementation, and each difference is a gap line. Unverified: no React Native implementation is in this repository.
- Claim: writing rubric results R1–R7. Verified: present tense, no pull request references, "None." under Open questions, and the gap lines name their FR or AR.
- Claim: the public text has no internal context. Verified.
- Claim: the knowledge check, Prettier
--checkandgit diff --checkpass. Verified at this head. - File
docs/specs/components/Switch/Switch.react-native.spec.md: the four findings above, plus non-blocking notes on the Governing rules row andsystem_specs.
…ed state reported; OQ1 is AST-126 OQ6
There was a problem hiding this comment.
This draft record needs an engineering owner's decision before it can be approved: component:react-native/Switch writes FR1–FR7, AV1, ORD1–ORD2, PR1, AR1–AR4, DEC-1 and DEC-2, none of which a current spec states. An engineering owner records the decision by commenting /approve-spec <full head SHA> on this pull request, and as an engineering owner the author may do so. The decision reaches past this record twice: offering no size on either platform takes that prop out of the core contract spec:AST-082 FR3 defines, and naming Material 3's pages as Android's guidelines answers spec:AST-093 OQ1, which FR3 leaves to iOS and macOS. This head fixes all four blocking findings of the previous review — the drawn-rendering default, the disabled-state wording, the ignored size and isBackSwipeAllowed, and the spec:AST-126 basis cells — and leaves one:
- Miss: FR1 takes
labelIcon"with web's names, types, defaults and meaning", but web'slabelIconisReactNode | IconType, andIconTypeis a web SVG component React Native cannot draw, so the contract would accept an icon that never appears;spec:AST-082FR3 forbids a prop a platform does not fully honor and FR4 makes an icon a shared icon name (FR17). GivelabelIconits React Native form in FR1, or list it with the props that stay on the web. - Non-blocking: four requirement rows rest on claims that are not in the repository at this head —
spec:AST-112FR16 and FR19,spec:AST-124FR3 andspec:AST-130FR6 — so a reader following a basis cell reaches nothing until the open drafts the description names land.
Claims and files checked
Review mode: full; reason: spec-record
- Claim: the record is stacked on the knowledge-check change and merges after it. Verified: the base branch is that pull request's head, which adds
react-nativeto the platform record languages. - Claim: the record also cites the open control, gesture and system-module drafts and the foundation amendment for FR16 and FR19. Verified: those claims exist only in those open pull requests; the foundation record at this head stops at FR15.
- Claim: the descriptions of the current Switch, native-first, native-guidelines and disabled-focus records. Verified against those records on the default branch.
- Claim: the Decision bullets match the record. Verified against FR1–FR7, AR1–AR4, DEC-1 and DEC-2.
- Claim: each requirement was read against the current React Native implementation, and every difference is a gap line. Unverified: no React Native implementation exists in this repository, so the eight gap lines could not be checked.
- Claim: no Swift Switch record exists, and no open pull request adds a React Native Switch record. Verified: the Switch folder holds only the core record, and a title search of open pull requests returns this one alone.
- Claim: writing rubric results R1–R7. Verified: present tense, no pull request references in the record, no rejected-alternative lines, OQ1 unanswered with its two options, and each gap line names its FR or AR.
- Claim: the public text carries no internal context. Verified by scanning both commits' added lines, the title, the body and the branch name.
- Claim: the knowledge check, Prettier
--checkandgit diff --checkpass. Verified at this head. - File
docs/specs/components/Switch/Switch.react-native.spec.md: the finding above, plus non-blocking notes on the unresolvable basis citations, FR2's undefined "platform turned off in the subtree", and the Swift Switch sentence.
There was a problem hiding this comment.
Approval waits on an engineering owner's decision: this draft record writes requirements that no current record states, and three of them reach beyond the record itself. An engineering owner records the decision by commenting /approve-spec <full head SHA> on this pull request, or says what to change; the author may do that if they are an engineering owner. What must be settled: whether dropping size on both platforms and scoping labelPosition and labelSpacing to Android is the intended change to Switch's core contract; whether Material 3's pages are Android's guidelines, which the native-guidelines record reserves for a decision before a platform's first native component merges; and whether an app that turns the platform off may draw the custom switch where the system has one, which the native-first rule allows only where the platform has none. One finding needs a change whichever way that decision goes.
- Miss: "The Swift Switch also takes no
labelPosition,labelSpacingor iOSsize" (docs/specs/components/Switch/Switch.react-native.spec.md:235, repeated in the description) is not true at this head, because there is no Swift Switch view and the generated iOSSwitchPropsdeclaressize(the macOS-onlysizeis intent in the draft Swift component API, which lists the iOS declaration as an open gap), so the sentence offers draft intent as precedent for DEC-1; name the draft contract instead, or drop the sentence, and correct the description. - Four requirement bases are not in the repository at this head: FR1 cites
spec:AST-112FR16 and AR1 cites FR19, while that record stops at FR15, and FR6 and FR7 citespec:AST-124FR3 andspec:AST-130FR6, whose records do not exist yet, so landing those pull requests first keeps every basis followable.
Claims and files checked
Review mode: full; reason: spec-record
Claims
- Stacked on the knowledge-paths pull request and merges after it: verified, the base branch is that pull request's head, which adds the
react-nativeplatform language. - The record cites four open group records and an amendment, and merges after them: verified, all five are open drafts.
- Existing authority searched (core Switch; the native-first record's core and platform contracts and native-first rule; the native-guidelines record's platform-control and theme rules; the focusable-disabled record's reason rules): verified against those records.
- The controls record's Switch is not one of its six
rendercomponents and its switch question is open: verified at that pull request's head. - No open pull request adds a Switch React Native record: verified by a repository search.
- The Swift Switch takes no
labelPositionorlabelSpacingand nosizeon iOS: the label props are verified; the iOSsizeclaim is false, as the finding above states. - The record's decision list (props kept and dropped, platform-switch-first rendering, the row at large text sizes, the drawn thumb's drag, one change report and haptic, one accessibility element, the gap lines): verified line by line against the record.
- Rejected alternatives: none recorded, and the writing-rubric results (no narration, no research, no pull-request references, the open question keeps its options, gaps named by requirement): verified.
- The record is a specification only with no implementation here: verified, one changed file.
- Validation: the knowledge check, Prettier
--checkandgit diff --checkpass: verified by running all three on the head tree.
Files
docs/specs/components/Switch/Switch.react-native.spec.md: one blocking finding (line 235) and two non-blocking notes; the rest of the record reads as the description describes it.
|
|
||
| | ID | Candidate invariant | Basis | Draft review state | | ||
| | --- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ------------------ | | ||
| | FR1 | The React Native `Switch` MUST take web's `label`, `value`, `onChange`, `isLoading`, `isLabelHidden`, `description`, `isDisabled`, `disabledMessage`, `isOptional`, `isRequired`, `status`, `labelIcon` and `labelTooltip` with web's names, types, defaults and meaning, and the shared base props on its root (`spec:AST-082` FR7). `onChange` receives the new value. `labelIcon` takes a shared icon name, which the label draws with `Icon`, and not a web SVG component (`spec:AST-082` FR4, FR17). `labelPosition` and `labelSpacing` are in the Android contract and are type errors on iOS. `size` is not offered on iOS or Android (DEC-1). `ref`, `changeAction`, `htmlName`, `onFocus`, `onBlur` and `width` are not offered, and Switch takes no visual prop. | `component:Switch`; `spec:AST-082` FR3–FR5, FR7, DEC-2; `spec:AST-112` FR16; DEC-1 | settled | |
There was a problem hiding this comment.
Non-blocking: the row opens with "web's names, types, defaults and meaning" and then carves labelIcon out of it, so the lead and the carve-out disagree on types. Dropping "types" from the lead, or scoping it to the props that keep web's type, would make the row read straight. The Builder impact row above still names only two porting exceptions; labelIcon is a third, since web code that passes an SVG icon component changes at the call site.
There was a problem hiding this comment.
Approval waits on an engineering owner's decision: this draft record writes requirements that no current record states, and three of them reach beyond the record itself.
sizeis offered on neither iOS nor Android, andlabelPositionandlabelSpacingare Android-only (FR1, DEC-1), which changes whatspec:AST-082FR3 calls Switch's core contract.- Material 3's Switch, Lists and Accessibility pages are named as Android's guidelines under
spec:AST-093FR3, which covers Apple platforms, while that record's OQ1 keeps Android open. - FR2 counts "the platform turned off in the subtree" as an absent platform switch, so an app opt-out draws core's switch where
spec:AST-082FR11 asks for the platform's.
An engineering owner records the decision by commenting /approve-spec <full head SHA> on this pull request, or says which requirement to change; the author may do so as an engineering owner. The Swift family line is now accurate, and the remaining notes are non-blocking: FR1's "types" wording and the Builder impact row, two governing citations that rest on core claims the record assigns to the web, and bases that land with the open drafts.
Claims and files checked
Review mode: full; reason: spec-record
- Claim: stacked on the pull request that teaches the knowledge checks React Native records, and merges after it: verified (the base is that pull request's head).
- Claim: the record cites three open group records and an amendment to the React Native foundation record, which merge first: verified (all four are open drafts, and the cited requirements exist only there).
- Claim: the core Switch record is current and covers props, busy and disabled rules, label placement, the thumb's touch behaviour and the switch accessibility binding, with no React Native rendering: verified.
- Claim: the native-first record's contract, base-prop, native-first (switches listed) and visuals-as-theme requirements are current: verified.
- Claim: the native component guidelines record's platform-control-first and theme requirements are current: verified.
- Claim: the platform-controls draft leaves Switch out of its six
rendercomponents and keeps open which native piece draws the switch: verified. - Claim: the draft Swift component API keeps the label props off Apple platforms and makes
sizemacOS-only, while the generated iOS props still declaresize; the native package scopes the label props to Android and Windows: verified. - Claim: open React Native records exist for TopNav and TabBar, and no open pull request adds a Switch one: verified.
- Claim: the decision bullets (props per platform, the platform's switch with a drawn fallback, the large-text row, the drawn drag against the back swipe, one change report with a haptic, one accessibility element, gap lines for the library's differences) match the record: verified; the record limits the haptic to a tap or drag where the platform's switch plays none.
- Claim: the record is a specification only, with no implementation here: verified; that each requirement was read against the current React Native library cannot be checked, since that library is not in this repository.
- Claim: no rejected alternatives are recorded, and the writing rubric holds (present tense, no pull request references, the open question keeps its options, release status only in the lifecycle field and readiness cell): verified.
- Claim: the knowledge check, Prettier and the whitespace check pass: verified at this head.
- File:
docs/specs/components/Switch/Switch.react-native.spec.md: non-blocking notes at lines 42, 45, 95, 143 and 233; otherwise consistent with the current records it cites.
… follows isRequired
There was a problem hiding this comment.
Approval waits on an engineering owner's decision: this draft record writes requirements that no current record states, and three of them reach beyond the record itself.
sizeis offered on neither iOS nor Android, andlabelPositionandlabelSpacingare Android-only (FR1, DEC-1), which changes whatspec:AST-082FR3 calls Switch's core contract.- Material 3's Switch, Lists and Accessibility pages are named as Android's guidelines under
spec:AST-093FR3, which covers Apple platforms, while that record's OQ1 keeps Android open. - FR2 counts "the platform turned off in the subtree" as an absent platform switch, so an app opt-out draws core's switch where
spec:AST-082FR11 asks for the platform's.
An engineering owner records the decision by commenting /approve-spec <full head SHA> on this pull request, or says which requirement to change; the author may do so as an engineering owner. The governing-rules row and AR1's required word now read straight, and AR3's tap reveal follows the web tooltip's rule for a disabled control. The remaining notes are non-blocking: FR1's "types" wording and the Builder impact row, and bases that land with the open drafts.
Claims and files checked
Review mode: full; reason: spec-record
- Claim: stacked on the pull request that teaches the knowledge checks React Native records, and merges after it: verified (the base is that pull request's head).
- Claim: the record cites three open group records and an amendment to the React Native foundation record, which merge first: verified (all four are open drafts, and the cited requirements exist only there).
- Claim: the core Switch record is current and covers props, busy and disabled rules, label placement, the thumb's touch behaviour and the switch accessibility binding, with no React Native rendering: verified.
- Claim: the native-first record's contract, base-prop, native-first (switches listed) and visuals-as-theme requirements are current: verified.
- Claim: the native component guidelines record's platform-control-first and theme requirements are current: verified.
- Claim: the platform-controls draft leaves Switch out of its six
rendercomponents and keeps open which native piece draws the switch: verified. - Claim: the disabled-reason record exposes the disabled state with the name and reason: verified.
- Claim: the draft Swift component API keeps the label props off Apple platforms and makes
sizemacOS-only, while the generated iOS props still declaresize; the native package scopes the label props to Android and Windows: verified. - Claim: open React Native records exist for TopNav and TabBar, and no open pull request adds a Switch one: verified.
- Claim: the decision bullets (props per platform, the platform's switch with a drawn fallback, the large-text row, the drawn drag against the back swipe, one change report with a haptic, one accessibility element with a reachable disabled state, gap lines for the library's differences) match the record: verified; the record limits the haptic to changes where the platform's switch plays none.
- Claim: the record is a specification only, with no implementation here: verified; that each requirement was read against the current React Native library cannot be checked, since that library is not in this repository.
- Claim: no rejected alternatives are recorded, and the writing rubric holds (present tense, no pull request references, the open question keeps its options, release status only in the lifecycle field and readiness cell): verified.
- Claim: the knowledge check, Prettier and the whitespace check pass: verified.
- File:
docs/specs/components/Switch/Switch.react-native.spec.md: non-blocking notes at lines 42 and 145, and on the bases that land with the open drafts; otherwise consistent with the current records it cites.
Stacked on #12592 (react-native records in the knowledge checks); merges after it.
Merge order: the record also cites the open group records
spec:AST-126(#12556, platform controls; its OQ6 is this record's OQ1),spec:AST-124(#12562, gestures and drag) andspec:AST-130(#12553, system modules), and the AST-112 amendment (#12563) for FR16 and FR19. It merges after those too.Exact decision needed
How React Native's
Switchimplementscomponent:Switch: which props it offers on iOS and on Android, when it is the platform's switch and when it draws core's switch, how the theme reaches it, the row's layout, the drawn thumb's drag, and how screen readers see it.Existing authority searched
component:Switch(docs/specs/components/Switch/Switch.spec.md, current): props, busy and disabled rules, label placement, the thumb's touch behaviour and the switch-pattern accessibility binding; no React Native rendering.spec:AST-082(current): FR3–FR5 (core and platform contracts; a platform never offers a prop it does not fully honor), FR7 (base props), FR11 (native-first; switches are listed) and DEC-2 (native-only visuals are theme configuration).spec:AST-093(current) FR2–FR4: the platform's control first; the theme reaches it.spec:AST-126(open draft): the platform control group; Switch is not one of its sixrendercomponents, and its OQ6 (which native piece draws the platform's switch) is open, so this record lists it as OQ1.spec:AST-124(open draft) FR3: drag frames and back-swipe arbitration;spec:AST-130(open draft) FR6: haptics.spec:AST-085: the disabled-reason rules, including the disabled state exposed with the name and reason.labelPositionandlabelSpacingout of the Apple contracts and makessizemacOS-only (the generated iOSSwitchPropsstill declaressize);@astryxdesign/nativescopeslabelPositionandlabelSpacingto Android and Windows.Decision
docs/specs/components/Switch/Switch.react-native.spec.md(component:react-native/Switch,platform_of: component:Switch):Switchkeeps web's props and meaning. On iOS the row follows the system's layout, solabelPositionandlabelSpacingare in the Android contract only;sizeis not offered, because the platform's switch has one size; the web's form, Action, DOM-event and CSS props stay on the web (FR1, DEC-1).onChangeonce and plays the theme'stogglehaptic (FR7).sizeandisBackSwipeAllowedprops, and a square theme's drawn switch.Rejected alternatives
None recorded in the record.
Claim scope and non-goals
The record covers only what React Native adds to
component:Switchor does differently. The native piece behind the platform's switch, drag arbitration and haptics stay withspec:AST-126,spec:AST-124andspec:AST-130, which the record's ownership lines name.Evidence and implementation relationship
The record is a specification only and has no implementation in this pull request. Each requirement was read against the current React Native implementation, and every place where that implementation differs is one of the record's gap lines.
Writing rubric results
Rejected:lines.spec:AST-126OQ6) and keeps its two options.FRn gapandARn gaplines; "not yet released" appears only in the template's lifecycle field and readiness cell.Scope
Components: Switch (React Native)
Validation
node scripts/check-knowledge.mjs: knowledge templates and records are aligned; no finding in this record.--checkclean on the record.git diff --check: clean.