Fix bottom tab bar incorrectly visible on cold-start to a deep screen#90489
Conversation
getStateFromPath produces a PartialState in which nested levels may omit `index`. React Navigation's convention is that the last route is then focused, but getFocusedLeafScreenName was returning undefined. That made isAtRoot fall through `!name => true` in TabNavigatorBar, showing the tab bar on restored deep routes (e.g. /r/:reportID) until the navigator fully hydrated. Resolve the focused index as `state.index ?? routes.length - 1` so the helper matches React Navigation semantics for PartialState.
|
@ZhenjaHorbach Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
Reviewer Checklist
Screenshots/VideosAndroid: HybridApp2026-05-14.11.46.00.movAndroid: mWeb Chrome2026-05-14.11.01.21.moviOS: HybridApp2026-05-14.11.46.00.moviOS: mWeb Safari2026-05-14.11.01.21.movMacOS: Chrome / Safari2026-05-14.10.59.54.mov |
mountiny
left a comment
There was a problem hiding this comment.
Thank you for a quick fix!
|
🚧 @mountiny has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/mountiny in version: 9.3.74-7 🚀
Bundle Size Analysis (Sentry): |
|
No help site changes are required for this PR. This is an internal navigation bug fix that corrects how |
|
🚀 Deployed to production by https://github.com/Beamanator in version: 9.3.74-7 🚀
|
Explanation of Change
Resolved the focused index in
getFocusedLeafScreenNameasstate.index ?? routes.length - 1, matching React Navigation's convention forPartialState(last route is focused whenindexis missing). This letsTabNavigatorBarcorrectly identify a deep restored route as non-root and keep the bottom tab bar hidden.Fixed Issues
$ #90490
PROPOSAL:
Tests
Offline tests
N/A
QA Steps
Same as tests.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
iOS: Native
Screen.Recording.2026-05-13.at.14.19.20.mov