Repository navigation
spec(TabBar): React Native platform record - #12686
imdreamrunner wants to merge 4 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report
Generated by PR Enrichment workflow | View current CI run |
There was a problem hiding this comment.
Approval waits on an engineering owner's decision on this draft record, and four statements in it need to change first. For three of them, the alternative is to amend the current record they conflict with.
The record's new requirements (FR1–FR17, DEC-1–DEC-6) and the edited knowledge-contracts sentence are not approved yet. An engineering owner records the decision by commenting /approve-spec <full head SHA>, and the author may do so as an engineering owner.
Blocking findings:
- FR5, FR6 and DEC-4 choose the bar, sidebar or rail by iOS size class and Android's 600 dp, but
spec:AST-012FR9,spec:AST-082FR11 andspec:AST-093FR3 require the shared compact definition (width belowmd, 768 pt/dp by default, or height below 500) rather than platform size classes. - FR2 and FR12 add
surface, a React-Native-only visual prop, whichspec:AST-082DEC-2 andspec:AST-093FR4 rule out because native-only visuals belong in the native theme. - FR3 and ORD1 depend on a theme
render.default, but the clause they cite,spec:AST-082FR10, defines a closed theme vocabulary without it. - The Builder impact row says web code ports unchanged apart from
panelId, but FR1 narrowsiconto anIconelement and FR6 stops a six-tab Android phone app in development.
Also worth settling with the owner: DEC-1's drawn default on Android, given that Material's navigation bar exists, and whether minimize should be minimizeBehavior.
Claims and files checked
Review mode: full; reason: no-earlier-review
Claims:
- The first commit is the stacked tooling change: verified, it is that pull request's head commit.
- This pull request's own change is one file, the new record: verified for its own commit.
- The record is the React Native platform record of the core TabBar and states only what React Native adds or changes: verified (front matter and ownership boundary).
- No other record owns TabBar on React Native or the bottom accessory: verified, no such record exists on the default branch.
- The listed decisions (web API without
panelId, default rendering, layout, Android limit, re-select, options, badges, minimize, accessory, look, touch, insets, native dependencies, missing host, theme-derived options, accessibility) match the record: verified, though three of them conflict with current records (findings above). - No rejected alternatives, and one open question on Android release builds: verified.
- No React Native implementation exists in this repository: verified (the native package has no React Native source).
- The writing-rubric results hold: verified (present tense, no pull request references, and each gap line names its requirement).
- The pull request contains specification records only: true for its own commit; the diff also carries the stacked tooling commit.
- The knowledge check passes: verified on the head.
- Prettier passes: verified.
- The whitespace check is clean: verified.
Files:
.github/scripts/knowledge-paths.cjs: clear.github/scripts/change-scope.test.mjs: clear.github/scripts/knowledge-paths.test.mjs: clearscripts/check-knowledge.test.mjs: clearscripts/specs-for-file.test.mjs: cleardocs/architecture/knowledge-contracts.md: needs owner approval with the recorddocs/specs/components/TabBar/TabBar.react-native.spec.md: four blocking findings; needs owner approval
There was a problem hiding this comment.
Approval waits on an engineering owner's decision on this draft record and the edited knowledge-contracts sentence; the author's rulings settle the Android default, the Android tab limit and the minimize name.
An engineering owner records the decision by commenting /approve-spec <full head SHA>, and the author may do so as an engineering owner. Approval also needs the current theme vocabulary updated for this record's theme default:
- FR3 and ORD1 read a theme
render.defaultthat the currentspec:AST-082FR10 does not list, and #12563 names that member only in the draftspec:AST-112while leaving FR10's member list unchanged, so FR10 itself needs the member before this lands, or the theme step goes.
Also worth fixing (non-blocking):
- FR6 lets a non-compact Android screen hold seven destinations under either rendering, but the drawn rendering has no rail (FR5 gap), so it would draw a seven-item bottom bar.
- Miss: FR1 takes only an
Iconelement foricon, whilespec:AST-082FR4 makes the shared icon name the form every native platform accepts. - FR9 says a badge shows in the locale's digits "as the core component gives it", but the web TabBar renders the badge value as given.
- A sentence each in DEC-3 and DEC-5 would record why Android departs from the core More tab and why
minimizeis notminimizeBehavior, so the approval carries those rulings.
Claims and files checked
Review mode: same-head; reason: none
Claims:
- Stacked on the tooling pull request and merges after it: verified, the first commit is that pull request's head commit.
- Also merges after the foundation-record pull request, which adds the foundation clauses the record cites: verified for the new foundation requirements; that pull request does not edit the current theme-vocabulary clause, so the theme member stays outside current authority after it.
- This pull request's own change is one file, the new record: verified, both later commits edit only the record.
- The record is the React Native platform record of the core TabBar and covers TabBar, TabBarItem and the More list: verified (front matter and Intent).
- The listed existing records, code and overlap were searched: verified.
- No other record owns TabBar on React Native or the bottom accessory: verified on the default branch.
- The decision bullets (web API without the panel id, icon elements, the three additions, the rendering choice and its defaults, the look from the theme with no surface prop, a drawn standalone bar, layout by compact, More on iOS and the Android error, re-select, the option table with six gap lines, badges, minimize, the accessory, touch, insets, no third-party native library, the missing-host error, option meanings, accessibility): verified against the record; the theme override names a member the current theme vocabulary does not have.
- No rejected alternatives and one open question on Android release builds: verified.
- No React Native implementation exists in this repository: verified.
- The gap lines sit under FR5, FR8 and FR9: verified (six lines).
- The writing-rubric results: verified (present tense, no pull request references, each gap line names its requirement).
- Specification records only: true of the record commits; the diff also carries the tooling commit, which the description names.
- No internal context in public text: verified.
- The knowledge check, Prettier and the whitespace check pass: verified on this head.
Files:
.github/scripts/knowledge-paths.cjs: clear.github/scripts/change-scope.test.mjs: clear.github/scripts/knowledge-paths.test.mjs: clearscripts/check-knowledge.test.mjs: clearscripts/specs-for-file.test.mjs: cleardocs/architecture/knowledge-contracts.md: needs owner approval with the recorddocs/specs/components/TabBar/TabBar.react-native.spec.md: needs owner approval and the theme-vocabulary update; four non-blocking points
| | ---- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | ------------------ | | ||
| | FR1 | The React Native `TabBar`, `TabBarItem` and `TabBarMoreList` MUST take web's props with web's names, types, defaults and meaning, with two exceptions. `panelId` is not offered, because React Native has no element ids to wire as `aria-controls`; FR7 gives re-select its scroll target instead. `icon` and `selectedIcon` take an `Icon` element, so the system rendering can read the icon's name (FR3). TabBar MUST NOT offer a prop it does not fully honor; web base props follow `spec:AST-082` FR7. | `spec:AST-082` FR3, FR5, FR7; `spec:AST-112` FR16; DEC-5 | settled | | ||
| | FR2 | React Native adds, each for a platform reason: `bottomAccessory` on `TabBar`, a `BottomAccessory` the bar carries (FR11), because iOS 26's tab bar has an accessory and a web page does not; `minimize` (FR10), because phone tab bars get smaller or leave as content scrolls; and `onLongPress(value)`, called when a tab is held, because the platforms' tab bars report a long press (a menu of the section's recent places). The router's tab navigator takes `render` (FR3). An unset addition changes nothing. | `spec:AST-125` FR8, FR9; `spec:AST-082` FR5 | settled | | ||
| | FR3 | In the Astryx router's tab navigator, the navigator's `render` prop MUST say who draws the tab bar's pixels: with `'system'` the tabs host presents the platform's tab bar (`UITabBarController` on iOS and iPadOS, Material's `NavigationBarView` on Android); with `'drawn'` Astryx draws the bar in React (a bar on the chrome glass on iOS, a Material 3 navigation bar on Android); `'auto'`, the default, is this component's default, `system` on iOS and iPadOS and `drawn` on Android, unless the native theme's `render.default` overrides every `auto` (`spec:AST-112/FR21`, the member it adds to `spec:AST-082` FR10). `render` never chooses glass or material: the drawn bar's look is FR12's. TabBar decides this default; the navigation library and the header record do not. | `spec:AST-125` FR1, FR8; `spec:AST-093` FR2, FR3; `spec:AST-112/FR21`; DEC-1 | settled | |
There was a problem hiding this comment.
render.default now cites spec:AST-112/FR21, but spec:AST-112 on main is draft and ends at FR15; FR21 and its amendment adding render.default to spec:AST-082 FR10 exist only in the open draft #12563. Until that lands, FR10's closed vocabulary still makes this member a type error, so this record either merges after #12563 or drops the theme step from FR3, ORD1 and the two auto states.
| | FR3 | In the Astryx router's tab navigator, the navigator's `render` prop MUST say who draws the tab bar's pixels: with `'system'` the tabs host presents the platform's tab bar (`UITabBarController` on iOS and iPadOS, Material's `NavigationBarView` on Android); with `'drawn'` Astryx draws the bar in React (a bar on the chrome glass on iOS, a Material 3 navigation bar on Android); `'auto'`, the default, is this component's default, `system` on iOS and iPadOS and `drawn` on Android, unless the native theme's `render.default` overrides every `auto` (`spec:AST-112/FR21`, the member it adds to `spec:AST-082` FR10). `render` never chooses glass or material: the drawn bar's look is FR12's. TabBar decides this default; the navigation library and the header record do not. | `spec:AST-125` FR1, FR8; `spec:AST-093` FR2, FR3; `spec:AST-112/FR21`; DEC-1 | settled | | ||
| | FR4 | A standalone TabBar, outside the router's tab navigator, MUST render the drawn bar on both platforms and takes no `render` prop, because the system tab bar owns its tabs' content views and a standalone TabBar leaves its sections to the app, as on the web. It is the bar an app draws on another router, such as Expo Router, inside that router's screens, or with no router. | `spec:AST-125` FR1, DEC-6; DEC-1 | settled | | ||
| | FR5 | Compact, as `spec:AST-012` FR9 defines it (a viewport width below the effective `md` point, 768 by default, or a height below 500, in points or dp), MUST choose the layout; platform size classes do not. On a compact screen the destinations sit in a bar along the bottom. On any other screen they sit along the leading edge: under the system rendering, the library asks the tabs host for the iPadOS sidebar that the tab bar adapts to (iPadOS 18 and later, as `tabBarControllerMode` allows) or Android's Material navigation rail; under the drawn rendering, a rail the library draws. A change while the app runs (a rotation, a resized window, a fold) switches the layout without remounting any tab's content or changing the selection. | `spec:AST-012` FR9; `spec:AST-082` FR11; `spec:AST-093` FR3; `spec:AST-125` FR8; DEC-4 | verify | | ||
| | FR6 | Past five tabs on a compact screen on iOS and iPadOS, the bar MUST show four tabs and More, as the core component's FR1–FR4 state: the system rendering uses `UITabBarController`'s More list, and the drawn rendering shows `TabBarMoreList`, which the router's tab navigator renders for the app. On a compact Android screen, more than five destinations MUST stop a development build with an error that names the count and fixes that work on a phone: keep five destinations in the bar and reach the rest from a screen, a navigation drawer or a menu in the top app bar. On any other Android screen, the rail holds up to seven destinations under either rendering; more than seven is the same error. | `component:TabBar` FR1–FR4; Material 3 navigation bar guidance; DEC-3; OQ1 | verify | |
There was a problem hiding this comment.
Non-blocking: a non-compact Android screen holds up to seven destinations "under either rendering", but the drawn rendering, Android's default, has no rail (FR5 gap), so it would draw a seven-item bottom bar. One limit for the drawn bar would close it; OQ1 still says "an Android phone" where this says a compact Android screen.
| | FR6 | Past five tabs on a compact screen on iOS and iPadOS, the bar MUST show four tabs and More, as the core component's FR1–FR4 state: the system rendering uses `UITabBarController`'s More list, and the drawn rendering shows `TabBarMoreList`, which the router's tab navigator renders for the app. On a compact Android screen, more than five destinations MUST stop a development build with an error that names the count and fixes that work on a phone: keep five destinations in the bar and reach the rest from a screen, a navigation drawer or a menu in the top app bar. On any other Android screen, the rail holds up to seven destinations under either rendering; more than seven is the same error. | `component:TabBar` FR1–FR4; Material 3 navigation bar guidance; DEC-3; OQ1 | verify | | ||
| | FR7 | Choosing the selected tab again MUST call `onReselect` with its value, never `onChange`. In the router's tab navigator, unless the tab's `tabBarRepeatedPressBehavior` is `none`, a tab whose stack is deeper than its root pops to the root through the stack's own guard, and a tab at its root scrolls its screen's scroll target to the top; under the system rendering the tabs host does both, and a guarded stack reports a refused re-select. A standalone TabBar calls `onReselect` only, and the app returns its section to the top. | `component:TabBar` FR3; `spec:AST-125` FR3, FR8, DEC-4 | verify | | ||
| | FR8 | The router's tab options MUST behave as the option table below states, and every option MUST mean the same under both renderings: where both honor an option, they draw the same value for it. An option a rendering does not honor warns once in development and changes nothing else. | `spec:AST-125` FR5, FR8; `spec:AST-112` FR16; DEC-6 | verify | | ||
| | FR9 | A badge MUST show as the core component gives it: a number as a count in the locale's digits, a short string as written, and nothing for an empty string. It appears, changes and disappears without animating. Under the system rendering it is `UITabBarItem`'s badge on iOS and Material's badge on Android; the drawn rendering draws the same at the icon's top-trailing corner. | `component:TabBar` (`badge`); `spec:AST-125` FR8 | verify | |
There was a problem hiding this comment.
Non-blocking: web's TabBar renders {item.badge} (packages/lab/src/TabBar/TabBar.tsx:812) and reads String(item.badge), with no locale digits. Drop "as the core component gives it", or cite the record that sets locale digits.
|
Rulings on the points this review leaves to the owner:
|
|
I'll run a full review to re-check this with your note. |
There was a problem hiding this comment.
Approval waits on an engineering owner's decision on this draft record and the edited knowledge-contracts sentence, and one citation in the record needs fixing first.
An engineering owner records the decision by commenting /approve-spec <full head SHA> on this pull request, and the author may do so as an engineering owner; that decision also settles whether the theme default step stays while no record defines it.
Blocking:
- Regression: FR3 cites
spec:AST-112FR21 as adding the theme'srender.default, and the description says #12563 adds it, but the render rule was removed from FR21 after #12563 merged andspec:AST-082FR10 still lists no such member, so drop the theme step from FR3, ORD1, DEC-1, the Behavior row, therenderdefault, the twoautostates and the FR3/FR4 verification row (and fix the description), or cite a record that defines it.
Also worth fixing (non-blocking):
- FR6 lets a non-compact Android screen hold seven destinations under either rendering, but the drawn rendering has no rail (FR5 gap), so it would draw a seven-item bottom bar; OQ1 still says "an Android phone".
- Miss: FR1 takes only an
Iconelement foricon, whilespec:AST-082FR4 makes the shared icon name the form every native platform accepts. - FR9 says a badge shows in the locale's digits "as the core component gives it", but the web TabBar renders the badge value as given.
- A sentence each in DEC-3 and DEC-5 would record the rulings on the Android error and the
minimizename with the record.
Claims and files checked
Review mode: full; reason: spec-record
Claims:
- Stacked on the tooling pull request and merges after it: verified; the first commit is that pull request's head commit, and that pull request is still open.
- Also merges after the foundation-record pull request, which adds the clauses the record cites and the theme default member: false for the theme member; that pull request merged, and a later follow-up removed the render rule, so the theme vocabulary still lacks the member.
- The first commit is the tooling change, and this pull request's own change is one file: verified; the three later commits edit only the record.
- The record is the React Native platform record of the core TabBar and covers TabBar, TabBarItem and the More list: verified.
- The listed records, code and overlap were searched, and no other record owns TabBar on React Native or the bottom accessory: verified on the default branch.
- The decision bullets (web API without the panel id, icon elements, three additions, the rendering choice and its defaults, the look from the theme with no surface prop, a drawn standalone bar, layout by compact, More on iOS and the Android error, re-select, the option table with six gap lines, badges, minimize, the accessory, touch, insets, no third-party native library, the missing-host error, option meanings, accessibility): match the record; the theme override rests on the removed clause.
- No rejected alternatives and one open question on Android release builds: verified.
- No React Native implementation exists in this repository: verified.
- The gap lines sit under FR5, FR8 and FR9: verified (six lines).
- The writing-rubric results: verified (present tense, no pull request references in the record, each gap line names its requirement).
- Specification records only: true of the record commits; the diff also carries the tooling commit, which the description names.
- No internal context in public text: verified.
- The knowledge check, Prettier and the whitespace check pass: verified on this head.
- Web parity now cites the foundation record's package clause, and the bar's look cites the glass-and-materials draft alone: verified.
Files:
.github/scripts/knowledge-paths.cjs: clear.github/scripts/change-scope.test.mjs: clear.github/scripts/knowledge-paths.test.mjs: clearscripts/check-knowledge.test.mjs: clearscripts/specs-for-file.test.mjs: cleardocs/architecture/knowledge-contracts.md: needs engineering-owner approval with the recorddocs/specs/components/TabBar/TabBar.react-native.spec.md: needs engineering-owner approval; one blocking citation fix and four non-blocking points
| | ---- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | ------------------ | | ||
| | FR1 | The React Native `TabBar`, `TabBarItem` and `TabBarMoreList` MUST take web's props with web's names, types, defaults and meaning, with two exceptions. `panelId` is not offered, because React Native has no element ids to wire as `aria-controls`; FR7 gives re-select its scroll target instead. `icon` and `selectedIcon` take an `Icon` element, so the system rendering can read the icon's name (FR3). TabBar MUST NOT offer a prop it does not fully honor; web base props follow `spec:AST-082` FR7. | `spec:AST-082` FR3, FR5, FR7; `spec:AST-112` FR10; DEC-5 | settled | | ||
| | FR2 | React Native adds, each for a platform reason: `bottomAccessory` on `TabBar`, a `BottomAccessory` the bar carries (FR11), because iOS 26's tab bar has an accessory and a web page does not; `minimize` (FR10), because phone tab bars get smaller or leave as content scrolls; and `onLongPress(value)`, called when a tab is held, because the platforms' tab bars report a long press (a menu of the section's recent places). The router's tab navigator takes `render` (FR3). An unset addition changes nothing. | `spec:AST-125` FR8, FR9; `spec:AST-082` FR5 | settled | | ||
| | FR3 | In the Astryx router's tab navigator, the navigator's `render` prop MUST say who draws the tab bar's pixels: with `'system'` the tabs host presents the platform's tab bar (`UITabBarController` on iOS and iPadOS, Material's `NavigationBarView` on Android); with `'drawn'` Astryx draws the bar in React (a bar on the chrome glass on iOS, a Material 3 navigation bar on Android); `'auto'`, the default, is this component's default, `system` on iOS and iPadOS and `drawn` on Android, unless the native theme's `render.default` overrides every `auto` (`spec:AST-112/FR21`, the member it adds to `spec:AST-082` FR10). `render` never chooses glass or material: the drawn bar's look is FR12's. TabBar decides this default; the navigation library and the header record do not. | `spec:AST-125` FR1, FR8; `spec:AST-093` FR2, FR3; `spec:AST-112/FR21`; DEC-1 | settled | |
There was a problem hiding this comment.
Regression: this cites spec:AST-112/FR21 as "the member it adds to spec:AST-082 FR10", but the render rule was removed from FR21 after #12563 merged: on main, FR21 is "Glass and materials are a look" with no render or render.default, and spec:AST-082 FR10 still rejects any member outside material, corners, imageScaling and textGrid. Drop the theme step here and in ORD1, DEC-1, the Behavior row, the render default, the two auto states and the FR3/FR4 verification row, or cite a record that defines render.default once one lands.
Stacked on #12592; merges after it.
It also merges after #12563, which adds the
spec:AST-112clauses it cites (FR16, FR19–FR21, and therender.defaultmember ofspec:AST-082FR10).The first commit is #12592's (it lets
check:knowledgeacceptreact-nativeplatform records). This PR's own change is one file:docs/specs/components/TabBar/TabBar.react-native.spec.md.Exact decision needed
How React Native renders
TabBar, which rendering is the default on each platform, and where the bottom accessory lives. The record is the React Native platform record ofcomponent:TabBar(component:react-native/TabBar,platform_of: component:TabBar). It states only what React Native adds or does differently. The core counterpart is Lab'sTabBar(packages/lab/src/TabBar), whose record coversTabBar,TabBarItemandTabBarMoreList;TabBarMoreListis that component's More list, not a separate counterpart.Existing authority searched
component:TabBar(FR1–FR7, AR1–AR2);spec:AST-012FR9 (the one compact definition);architecture:knowledge-contracts(platform records beside the core record);spec:AST-082FR3–FR5, FR7, FR10, FR11 andspec:AST-093FR1–FR5 (core and platform contracts, native-first, theme intent);spec:AST-085FR1, FR2, FR5 (disabled controls);spec:AST-112as amended in spec(AST-112): React Native commands are one astryx rn group; package shape (Expo wrapper, default linking, named features) #12563 (package layers, native dependencies, glass as a look); the open draftsspec:AST-125(navigation hosts: tabs host, tab screen, tab accessory),spec:AST-123(surfaces and glass),spec:AST-127(icons and drawing),spec:AST-129(safe area),spec:AST-140(platform code), and the React NativeNavigationStackrecord (spec(NavigationStack): React Native platform record #12596).packages/lab/src/TabBar/andpackages/lab/src/TabBarMoreList/(props, the More tab, badges, re-select, disabled tabs, catalog messages).Decision
TabBar,TabBarItemandTabBarMoreListprops, names, types and defaults, withoutpanelId(React Native has no element ids).iconandselectedIcontake anIconelement (FR1). React Native addsbottomAccessory,minimizeandonLongPress(FR2).render: 'auto' | 'system' | 'drawn'on the router's tab navigator says who draws the bar's pixels. Withsystem, the tabs host presents the platform's tab bar. Withdrawn, Astryx draws it in React.autois this component's default,systemon iOS anddrawnon Android, unless the native theme'srender.default(spec:AST-112/FR21, the member it adds tospec:AST-082FR10) overrides everyauto. The drawn bar's glass or material look comes from the native theme'smaterialmember and, where needed, the tab options; TabBar has nosurfaceprop. A standalone TabBar is drawn (FR3, FR4, FR12, DEC-1).spec:AST-012FR9 defines it, chooses the layout: a bottom bar on a compact screen, and an iPadOS sidebar or a navigation rail on any other. Platform size classes do not choose it. A size change keeps tab content and selection (FR5, DEC-4).BottomAccessoryhas two placements,expandedandinline(FR11, DEC-2). The look comes from props and the theme, with no public glass component (FR12), and touch behaviour is per platform (FR13). The record also covers insets (FR14) and requires no third-party native library (FR15). A missing host fails loudly (FR16).Rejected alternatives
None recorded.
Claim scope and non-goals
The claims are FR1–FR17, AR1–AR7, ORD1–ORD4, PR1–PR2 and DEC-1–DEC-6. The record's "Does not own" list names the owner of each adjacent responsibility.
Open question:
human-api): what a release build does with more than five destinations on an Android phone.Evidence and implementation relationship
No React Native implementation exists in this repository. The record states the target behavior, and its verification map names the evidence for each requirement: unit tests through the package's testing doubles, Simulator and emulator captures, and VoiceOver and TalkBack checks. Where the drawn rendering does not yet meet the target, the record lists the gap as a requirement gap line (FR5, FR8, FR9).
Writing rubric results
Released default preserved.Scope
Components: TabBar
Validation
pnpm check:knowledge: passes ("Knowledge templates and records are aligned.")git diff --check: cleanFollow-up: claims moved from
spec:AST-112Cites
spec:AST-112FR10 for web parity, where #13029 folds FR16, and FR12's basis citesspec:AST-123alone for the bar's look.