Repository navigation
[Liquid Glass Follow Up] Fix native tab bar issues when the Insights beta is on
#104368
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
grgia
merged 7 commits into
Expensify:main
from
software-mansion-labs:war-in/fix-insights-beta-x-native-nav-bar
Oct 21, 2026
+208
−70
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
606df82
fix: wrap inbox and insights with screens marker
war-in 5340620
fix: rerender nav bar when enabling insights beta
war-in 717a358
fix: replace `REPLACE` with reset so back button on Account tab works…
war-in c8e35e7
Merge branch 'main' into war-in/fix-insights-beta-x-native-nav-bar
war-in 0c410ea
fix: crash on iOS when using marker
war-in 1260bb9
fix: dont close the account tab immediately after open
war-in 33aeeb2
chore: update details
war-in File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
...screens/react-native-screens+4.28.0+006+stack-scroll-to-top-uses-scroll-view-marker.patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| diff --git a/node_modules/react-native-screens/ios/RNSScreenStack.mm b/node_modules/react-native-screens/ios/RNSScreenStack.mm | ||
| --- a/node_modules/react-native-screens/ios/RNSScreenStack.mm | ||
| +++ b/node_modules/react-native-screens/ios/RNSScreenStack.mm | ||
| @@ -143,8 +143,12 @@ namespace react = facebook::react; | ||
| tabScreenController.tabScreenComponentView.shouldUseRepeatedTabSelectionPopToRootSpecialEffect) { | ||
| return [[self popToRootViewControllerAnimated:true] count] > 0; | ||
| } else if (tabScreenController.tabScreenComponentView.shouldUseRepeatedTabSelectionScrollToTopSpecialEffect) { | ||
| - UIScrollView *scrollView = | ||
| - [RNSScrollViewFinder findScrollViewInFirstDescendantChainFrom:[[self topViewController] view]]; | ||
| + // A ScrollViewMarker registers its scroll view with the tabs screen, not with this stack, so it can be on any | ||
| + // screen of the stack. It is used only while the stack shows a single screen. | ||
| + UIScrollView *markedScrollView = | ||
| + [[self viewControllers] count] == 1 ? [tabScreenController.tabScreenComponentView cachedContentScrollView] : nil; | ||
| + UIScrollView *scrollView = markedScrollView | ||
| + ?: [RNSScrollViewFinder findScrollViewInFirstDescendantChainFrom:[[self topViewController] view]]; | ||
| return [scrollView rnscreens_scrollToTop]; | ||
| } | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
src/components/Navigation/TabBarBottomContent/TabRootScrollViewMarker/index.native.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| import useThemeStyles from '@hooks/useThemeStyles'; | ||
|
|
||
| import type {ScrollViewProps} from 'react-native'; | ||
|
|
||
| import React from 'react'; | ||
| // FlashList's default scroll component is React Native's Animated.ScrollView, not Reanimated's. | ||
| // eslint-disable-next-line no-restricted-imports | ||
| import {Animated} from 'react-native'; | ||
| import {ScrollViewMarker} from 'react-native-screens/experimental'; | ||
|
|
||
| import type TabRootScrollViewMarkerProps from './types'; | ||
|
|
||
| /** | ||
| * A second tap on the focused native tab scrolls the tab's content to the top. Without a marker, react-native-screens | ||
| * scrolls the first scroll view it finds by following each view's first child, which on a screen with a horizontal | ||
| * selector above its list is the selector. The marker has to be the scroll view's direct native parent. | ||
| */ | ||
| function TabRootScrollViewMarker({children}: TabRootScrollViewMarkerProps) { | ||
| const styles = useThemeStyles(); | ||
|
|
||
| return <ScrollViewMarker style={styles.flex1}>{children}</ScrollViewMarker>; | ||
| } | ||
|
|
||
| /** | ||
| * For a FlashList's `renderScrollComponent`, which replaces the list's own ScrollView rather than wrapping it. It renders | ||
| * the list's default scroll component, Animated.ScrollView. FlashList passes the ref among the props, so it reaches it. | ||
| */ | ||
| function renderTabRootScrollComponent(props: ScrollViewProps) { | ||
| return ( | ||
| <TabRootScrollViewMarker> | ||
| <Animated.ScrollView {...props} /> | ||
| </TabRootScrollViewMarker> | ||
| ); | ||
| } | ||
|
|
||
| export default TabRootScrollViewMarker; | ||
| export {renderTabRootScrollComponent}; |
12 changes: 12 additions & 0 deletions
12
src/components/Navigation/TabBarBottomContent/TabRootScrollViewMarker/index.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| import type TabRootScrollViewMarkerProps from './types'; | ||
|
|
||
| /** On web the JS tab bar has no scroll to top on a second tap, so there is nothing to mark. */ | ||
| function TabRootScrollViewMarker({children}: TabRootScrollViewMarkerProps) { | ||
| return children; | ||
| } | ||
|
|
||
| /** Lists keep their default scroll component. */ | ||
| const renderTabRootScrollComponent = undefined; | ||
|
|
||
| export default TabRootScrollViewMarker; | ||
| export {renderTabRootScrollComponent}; |
8 changes: 8 additions & 0 deletions
8
src/components/Navigation/TabBarBottomContent/TabRootScrollViewMarker/types.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| import type {ReactElement} from 'react'; | ||
|
|
||
| type TabRootScrollViewMarkerProps = { | ||
| /** The tab's vertical scroll view, rendered as the marker's only child */ | ||
| children: ReactElement; | ||
| }; | ||
|
|
||
| export default TabRootScrollViewMarkerProps; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.