Skip to content

Migrate ConnectToQuickbooksOnlineFlow and ConnectToXeroFlow to @react-navigation modal screens#92512

Merged
mountiny merged 24 commits into
Expensify:mainfrom
software-mansion-labs:borys3kk-migrate-quickbooks-to-react-modal-screen
Jun 30, 2026
Merged

Migrate ConnectToQuickbooksOnlineFlow and ConnectToXeroFlow to @react-navigation modal screens#92512
mountiny merged 24 commits into
Expensify:mainfrom
software-mansion-labs:borys3kk-migrate-quickbooks-to-react-modal-screen

Conversation

@borys3kk

@borys3kk borys3kk commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Explanation of Change

Migrates the QuickBooks Online and Xero connect flows from rendering an inline fullscreen Modal/WebView inside ConnectTo*Flow components to dedicated RHP setup screens. Added QuickbooksOnlineSetupPage and XeroSetupPage (with platform-specific variants: native renders the WebView in a ScreenWrapper, web uses openLink + goBack). Wired up new routes, screens, navigators, linking config, and types.

Fixed Issues

$ #90476
PROPOSAL:

Tests

  1. Open a workspace → Accounting.

  2. Click Connect (or Set up) on the QuickBooks Online integration.

  3. On native (iOS/Android), verify the app navigates to a dedicated setup screen showing the QBO authentication WebView inside a screen with a header and back button.

  4. On web/desktop, verify the QBO setup link opens in a new tab and the app navigates back to the Accounting page.

  5. Verify that Taxes are disabled in the LHN after initiating the QBO connection.

  6. Verify that no errors appear in the JS console.

  7. Open a workspace → Accounting.

  8. Click Connect (or Set up) on the Xero integration.

  9. If 2FA is not enabled on the account, verify the "Two-factor authentication required" modal appears; tapping Cancel navigates back, and tapping the action navigates to the 2FA setup route.

  10. If 2FA is enabled, on native verify the app navigates to a dedicated setup screen showing the Xero authentication WebView; on web/desktop verify the Xero setup link opens in a new tab and the app navigates back.

  11. Verify that no errors appear in the JS console.

  12. With the app deep-linking enabled, open workspaces/<policyID>/accounting/quickbooks-online/setup and workspaces/<policyID>/accounting/xero/setup directly.

  13. Verify each route resolves to the correct setup screen and behaves as in the tests above (from both a logged-in and logged-out account).

Offline tests

In offline mode the buttons for adding the accounting connections are disabled so no tests.

QA Steps

Same as tests.

  • Verify that no errors appear in the JS console

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 followed proper code patterns (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and 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)
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • 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)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.ts or at the top of the file that uses the constant) are defined as such
  • I verified that if a function's arguments changed that all usages have also been updated correctly
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))
  • 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 a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • 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_quickbooks.mov
android_xero.mov
Android: mWeb Chrome
iOS: Native
ios_quickbooks.mov
ios_xero.mov
iOS: mWeb Safari
MacOS: Chrome / Safari
web_quickbooks.mp4
web_xero.mov

@codecov

codecov Bot commented Jun 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ Changes either increased or maintained existing code coverage, great job!

Files with missing lines Coverage Δ
src/ROUTES.ts 21.35% <100.00%> (+0.78%) ⬆️
src/SCREENS.ts 100.00% <ø> (ø)
...nts/ConnectToQuickbooksOnlineFlow/index.native.tsx 100.00% <100.00%> (+100.00%) ⬆️
...components/ConnectToQuickbooksOnlineFlow/index.tsx 100.00% <ø> (+100.00%) ⬆️
src/components/ConnectToXeroFlow/index.native.tsx 100.00% <100.00%> (+100.00%) ⬆️
src/components/ConnectToXeroFlow/index.tsx 100.00% <100.00%> (+100.00%) ⬆️
...gation/linkingConfig/RELATIONS/WORKSPACE_TO_RHP.ts 100.00% <ø> (ø)
src/libs/Navigation/linkingConfig/config.ts 76.92% <ø> (ø)
...ing/qbo/QuickbooksOnlineSetupPage/index.native.tsx 100.00% <100.00%> (ø)
...accounting/qbo/QuickbooksOnlineSetupPage/index.tsx 100.00% <100.00%> (ø)
... and 5 more
... and 362 files with indirect coverage changes

@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

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

@github-actions

This comment has been minimized.

@borys3kk

borys3kk commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/components/ConnectToQuickbooksOnlineFlow/index.native.tsx
Comment thread src/pages/workspace/accounting/qbo/QuickbooksOnlineSetupPage/index.native.tsx Outdated
Comment thread src/pages/workspace/accounting/qbo/QuickbooksOnlineSetupPage/index.native.tsx Outdated
Comment thread src/pages/workspace/accounting/qbo/QuickbooksOnlineSetupPage/index.tsx Outdated
Comment thread src/pages/workspace/accounting/xero/XeroSetupPage/index.native.tsx Outdated
Comment thread src/pages/workspace/accounting/xero/XeroSetupPage/index.tsx Outdated
Comment thread src/pages/workspace/accounting/xero/XeroSetupPage/index.native.tsx Outdated
Comment thread tests/unit/components/ConnectToQuickbooksOnlineFlowTest.tsx Outdated

@jmusial jmusial 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.

Looking good, just the useEffect fix and 🚀

Comment thread src/pages/workspace/accounting/qbo/QuickbooksOnlineSetupPage/index.tsx Outdated
Comment thread src/pages/workspace/accounting/xero/XeroSetupPage/index.native.tsx Outdated
Comment thread src/pages/workspace/accounting/qbo/QuickbooksOnlineSetupPage/index.native.tsx Outdated
Comment thread tests/unit/components/ConnectToXeroFlowTest.tsx Outdated

@jmusial jmusial 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.

LGTM

@borys3kk
borys3kk marked this pull request as ready for review June 16, 2026 15:05
@borys3kk
borys3kk requested review from a team as code owners June 16, 2026 15:05
@melvin-bot
melvin-bot Bot requested review from Gonals and flaviadefaria and removed request for a team June 16, 2026 15:05
@melvin-bot

melvin-bot Bot commented Jun 16, 2026

Copy link
Copy Markdown

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

@mountiny

Copy link
Copy Markdown
Contributor

Yeah I think we should fix those 2 issues before merging

@borys3kk

Copy link
Copy Markdown
Contributor Author

I noticed that when we enable the 2FA during Xero setup, pressing GOT it on 2FA success screen opens the xero setup link in browser. But then if I click connect on xero in accounting page, it opens a webView on IOS.

Happens on staging too.

Screen.Recording.2026-06-29.at.12.27.40.mov

fixed this bug

as well as the backdrop and xero crash ones

@mountiny

Copy link
Copy Markdown
Contributor

@parasharrajat can you please retest? thanks

@borys3kk

Copy link
Copy Markdown
Contributor Author

Okay, I've investigated further and it turns out it's not that trivial to have a native-only implementation for the RHP. The current solution consists of two
parts:

  • Web: when we navigate to the accounting setup via the link, we get navigated back to the Workspace > Accounting screen. We can't use openLink to open the
    accounting integration in a new tab, because that requires a user gesture — which we don't have when navigating via a link — so we'd get stuck in a backdrop
    state with no integration opened.
  • Native: when clicking the link, we're redirected to the workspace overview and the accounting integration does open. However, when going back out of it we
    land on the main workspace page on narrow layout. It works through links because we genuinely open a new RHP, so the navigation behaves correctly and the
    integration can be completed that way.

TL;DR:

  • On web, we can't send someone a link to integrate an accounting software in one go — they have to re-click the "Connect" button (with a bit of a
    Navigation.goBack hack).
  • On native, it works in one go.

Let me know whether I should work on this further, or whether it's acceptable that:

  1. on web the user has to click "Connect" again to continue the flow (using the goBack hack), and
  2. on native it works in one go.

@parasharrajat parasharrajat left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lGTM.

Comment thread src/pages/workspace/accounting/xero/XeroSetupPage/index.native.tsx Outdated
Comment thread src/pages/workspace/accounting/xero/XeroSetupPage/index.tsx
@borys3kk

Copy link
Copy Markdown
Contributor Author

all done 🚀

@borys3kk

Copy link
Copy Markdown
Contributor Author

To the best of my knowledge the failing tests are not coming from this PR, when the situation stabilizes I will re-merge main and rerun the tests, in the meantime it is ready to be reviewed.

@melvin-bot
melvin-bot Bot requested a review from mountiny June 30, 2026 14:18
Comment thread tests/navigation/TmpSetupDeeplinkProbe.ts Outdated
Comment thread src/pages/workspace/accounting/AccountingSetupWebViewPage.tsx Outdated
@borys3kk

Copy link
Copy Markdown
Contributor Author

all checks pass now

@mountiny mountiny 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.

Thanks!

@mountiny
mountiny merged commit 5bdef28 into Expensify:main Jun 30, 2026
35 checks passed
@OSBotify

Copy link
Copy Markdown
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@github-actions

Copy link
Copy Markdown
Contributor

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

@OSBotify

OSBotify commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/mountiny in version: 9.4.26-0 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

@MelvinBot

Copy link
Copy Markdown
Contributor

🤖 I reviewed this PR against the help site files under docs/articles and no help site changes are required.

Why: This PR is an internal navigation/architecture refactor. It migrates the QuickBooks Online and Xero connect flows from an inline fullscreen Modal/WebView (rendered inside ConnectTo*Flow) to dedicated RHP setup screens (QuickbooksOnlineSetupPage, XeroSetupPage), and wires up the new routes, screens, navigators, and linking config. None of this changes the user-facing steps.

The two relevant help articles document the flow only at the user level, and both remain accurate:

  • Connect-to-QuickBooks-Online.md — "Click Set up next to QuickBooks Online" → "Log in with your Intuit credentials when prompted." Still exactly what the user does.
  • Connect-to-Xero.md — "Click Set up next to Xero" → "Log in to your Xero account." The article also already lists the two-factor authentication requirement, which this PR preserves (it shows the "Two-factor authentication required" modal when 2FA isn't enabled).

Since no documented behavior changes, I did not create a draft help site PR. If you'd like a docs update anyway (e.g. new screenshots reflecting the redesigned setup screen), let me know and I'll open one.

@OSBotify

OSBotify commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/grgia in version: 9.4.27-2 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

Bundle Size Analysis (Sentry):

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.

7 participants