Skip to content

[Liquid Glass Follow Up] Fix native tab bar issues when the Insights beta is on - #104368

Open
war-in wants to merge 7 commits into
Expensify:mainfrom
software-mansion-labs:war-in/fix-insights-beta-x-native-nav-bar
Open

war-in wants to merge 7 commits into
Expensify:mainfrom
software-mansion-labs:war-in/fix-insights-beta-x-native-nav-bar

Conversation

@war-in

@war-in war-in commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Explanation of Change

Fixes four native tab bar bugs seen with the Insights beta. NativeTabLayout remounts the native tab host when the hidden tab changes, so Android drops the stale Account item. Account's back button resets tab history to Home instead of a dropped REPLACE. Inbox and Insights lists get a ScrollViewMarker so a second tab tap scrolls them to top.

Fixed Issues

$ #104274
$ #104294
$ #104283
$ #104284
PROPOSAL:
MOBILE-EXPENSIFY: https://github.com/Expensify/Mobile-Expensify/pull/14193

Tests

Precondition: native app (iOS or Android), insightsPage beta on (Account > Troubleshoot > Beta overrides), account with enough reports to scroll Inbox.

Account tab with the beta on

  1. With the beta off, go to Account > Troubleshoot > Beta overrides and turn on insightsPage
  2. Verify that the bottom bar shows Home, Inbox, Spend, Insights and Workspaces, with no Account item, and the Account avatar is in the top bar
  3. From each of Home, Inbox, Spend and Insights, tap the top-bar avatar
  4. Verify that Account opens on the first tap every time
  5. Kill and relaunch the app, then repeat steps 2-4

Back button on Account

  1. Open Inbox, then tap the top-bar avatar
  2. Tap the back button on Account
  3. Verify that Inbox is shown
  4. Tap the avatar again, then kill and relaunch the app so it reopens on Account
  5. Tap the back button on Account
  6. Verify that Home is shown with the bottom bar visible
  7. On Android, press the hardware back button on Home
  8. Verify that Account does not reopen

Scroll to top on a second tab tap

  1. Open Inbox and scroll the chat list down
  2. Tap the Inbox tab again
  3. Verify that the chat list scrolls to the top
  4. Open Insights, scroll down, then tap the Insights tab again
  5. Verify that the dashboard scrolls to the top
  6. Repeat on Home, Spend and Workspaces and verify that they still scroll to the top
  7. Scroll Inbox down, switch to another tab and back to Inbox
  8. Verify that Inbox keeps its scroll position and still scrolls smoothly

Offline tests

N/A

QA Steps

Same as tests

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I verified any copy / text that was added to the app is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • If new assets were added or existing ones were modified, I verified that:
    • The assets are optimized and compressed (for SVG files, run npm run compress-svg)
    • The assets load correctly across all supported platforms.
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • If the PR adds or modifies the UI:
    • I asked an AI agent to review the changes for accessibility issues and addressed its findings.
    • I tested with a screen reader (VoiceOver on macOS) and verified all new/changed elements are reachable with a logical focus order.
    • I verified all new/changed elements have meaningful accessible names and roles.
    • I verified state changes are announced (e.g. checked/unchecked, expanded/collapsed, selected).
  • I added unit tests for any new feature or bug fix in this PR to help automatically prevent regressions in this user flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari

@war-in

war-in commented Oct 19, 2026

Copy link
Copy Markdown
Contributor Author

@codex review
@claude review
@MelvinBot review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-19T15:59:47.266837Z 717a358 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@war-in
war-in marked this pull request as ready for review October 19, 2026 15:43
@war-in
war-in requested review from a team as code owners October 19, 2026 15:43
@melvin-bot
melvin-bot Bot requested review from ZhenjaHorbach and removed request for a team October 19, 2026 15:43
@melvin-bot

melvin-bot Bot commented Oct 19, 2026

Copy link
Copy Markdown

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

@melvin-bot
melvin-bot Bot requested review from joekaufmanexpensify and removed request for a team October 19, 2026 15:43
@codecov

codecov Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.

Files with missing lines Coverage Δ
src/components/LHNOptionsList/LHNOptionsList.tsx 79.36% <ø> (ø)
...omContent/TabRootScrollViewMarker/index.native.tsx 100.00% <100.00%> (ø)
.../Navigators/NativeTabNavigator/NativeTabLayout.tsx 100.00% <100.00%> (ø)
src/pages/Insights/InsightsDashboard.tsx 82.95% <85.71%> (+0.19%) ⬆️
...BarBottomContent/TabRootScrollViewMarker/index.tsx 0.00% <0.00%> (ø)
src/pages/settings/InitialSettingsPage.tsx 83.58% <0.00%> (-6.75%) ⬇️
... and 21 files with indirect coverage changes

@MelvinBot

Copy link
Copy Markdown
Contributor

Review

One likely iOS crash needs a check before merge. The Account back-button fix looks correct.

1. iOS may crash when ScrollViewMarker mounts (needs verification)
ScrollViewMarker comes from react-native-screens/experimental, which is the "gamma" code. iOS only compiles that code when RNS_GAMMA_ENABLED=1 is set at pod install (RNScreens.podspec:5, :54-59). Without the flag, iOS builds RNSScrollViewMarkerComponentView as a bare NSObject stub (ios/stubs/RNSGammaStubs.h:24). Fabric still registers that class and calls componentDescriptorProvider on it. The stub doesn't implement it, so the call should throw on the first render of Inbox or Insights. Without the flag, the iOS tab code also skips the marker, so scroll-to-top wouldn't work on iOS anyway.

  • I found no RNS_GAMMA_ENABLED in App's ios/Podfile, package.json, scripts/ or .github/, and this PR is the first App code to import react-native-screens/experimental. I couldn't check the HybridApp iOS build config.
  • Please confirm with an iOS build that opens Inbox and Insights. If the flag is off, consider making the marker Android-only, for example with an index.android.tsx.
  • Android always registers the marker, so it's fine there.

2. The tab-host remount resets every tab's component state, and it may run on each cold start
NativeTabLayout.tsx:22-32 keys the whole children tree, so all tabs unmount and mount again. Tabs aren't lazy.

  • Navigation state survives, including nested stacks. Local state, input focus and scroll position are lost; the LHN is the exception because it restores its offset from ScrollOffsetContext. A report open in the Inbox stack mounts again and refetches.
  • While betas are still loading, isBetaEnabled returns false. For beta users, the key therefore starts as Insights and then flips to SettingsSplitNavigator. That causes a full remount during startup, and longer after a fresh sign-in.
  • The stale bar item is Android-only, but the remount also runs on iOS. Consider gating the key to Android, or waiting until betas have loaded before computing it.

3. Account back reset: looks correct
The parent is the tab navigator, and SCREENS.HOME is the right route name. A RESET with stale: false keeps history as passed, and other tabs keep their nested state. I confirmed that TabRouter returns null for REPLACE, so the old forceReplace call did nothing. Optional nits:

  • Add params: homeRoute.params to the history entry at InitialSettingsPage.tsx:85, which matches the router's own entries.
  • useNativeTabNavigator.ts:107 still uses navigate(HOME, {forceReplace: true}) on the tab navigator, so it's probably a no-op for the same reason. A shared helper could fix both.
Checked and fine
  • FlashList 2.3.2 wraps a function renderScrollComponent in its own forwardRef and passes ref in the props. Spreading the props onto Animated.ScrollView keeps scrollToOffset and measurement working. The default scroll component is also Animated.ScrollView.
  • The marker's flex1 wrapper doesn't change layout in the LHN or Insights.
  • Android's marker throws if its direct child isn't a plain ScrollView, so a future refreshControl on a marked list would crash. Nothing does that today.

view run

@joekaufmanexpensify joekaufmanexpensify left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Fixing deploy blockers

@github-actions

Copy link
Copy Markdown
Contributor

🚧 dubielzyk-expensify has triggered a test Expensify/App build. You can view the workflow run here.

@github-actions

This comment has been minimized.

@ZhenjaHorbach

Copy link
Copy Markdown
Contributor

Conflicts 🥲

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ This PR is possibly changing native code and/or updating libraries, it may cause problems with HybridApp. Please check if any patch updates are required in the HybridApp repo and run an AdHoc build to verify that HybridApp will not break. Ask Contributor Plus for help if you are not sure how to handle this. ⚠️

@war-in

war-in commented Oct 20, 2026

Copy link
Copy Markdown
Contributor Author

@ZhenjaHorbach Melvin's comments addressed, we should be ready for the review

@ZhenjaHorbach

ZhenjaHorbach commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Still have this issue
#104294

But this bug is unstable and I can reproduce it from time to time

Screen.Recording.2026-10-20.at.14.33.07.mov

@ZhenjaHorbach

Copy link
Copy Markdown
Contributor

@joekaufmanexpensify @grgia
Can you run adhoc builds here, please?

@github-actions

Copy link
Copy Markdown
Contributor

🚧 mountiny has triggered a test Expensify/App build. You can view the workflow run here.

@github-actions

Copy link
Copy Markdown
Contributor

@war-in

war-in commented Oct 20, 2026

Copy link
Copy Markdown
Contributor Author

But this bug is unstable and I can reproduce it from time to time

I checked the generated adhoc on a physical device and it worked for me
cc @ZhenjaHorbach

@ZhenjaHorbach

Copy link
Copy Markdown
Contributor

Nice then 😁
Will complete the review and approve tomorrow morning!

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants