Skip to content

Add Super Wide RHP Routes#75886

Merged
mountiny merged 39 commits intoExpensify:mainfrom
software-mansion-labs:swrhp-v2
Dec 11, 2025
Merged

Add Super Wide RHP Routes#75886
mountiny merged 39 commits intoExpensify:mainfrom
software-mansion-labs:swrhp-v2

Conversation

@WojtekBoman
Copy link
Contributor

@WojtekBoman WojtekBoman commented Nov 24, 2025

Explanation of Change

This PR adds a new route to display the expense report in the Inbox tab and changes the way the expense report is displayed in the Reports tab from central screen to Super Wide RHP.

In this PR, the SecondaryOverlay has also been moved as a separate component and
secondaryOverlayProgress has been split into 3 variables depending on the case being handled

  1. RHP is displayed on Wide RHP
  2. RHP is displayed on Super Wide RHP
  3. Wide RHP is displayed on Super Wide RHP

Fixed Issues

$ #71821
PROPOSAL:

Tests

  • Verify that no errors appear in the JS console

Test 1

  1. Go to the Reports page in the Reports tab.
  2. Click on the report you created.
  3. Verify that it opens as a super wide RHP, no style bugs appear, the overlay works correctly, the backButton returns you back, and there are no other issues.

Test 2

  1. Add two more reports: one empty, and one containing a single expense.
  2. Go to the Reports page in the Reports tab.
  3. Click on any report.
  4. Switch between the reports you created using the arrows in the top-right corner.
  5. Verify that:
  • the report with one transaction displays as a wide RHP,
  • the empty report also displays as a wide RHP (but without a receipt),
  • when switching between reports, all styles update correctly,
  • and the RHP sizes change depending on the number of transactions (0, 1, >1).

Test 3

  1. Go to the Reports page in the Reports tab.
  2. Open a report with more than one transaction.
  3. Click on one of the expenses.
  4. Verify that a wide RHP opens and overlays are displayed correctly.
  5. Close the wide RHP by clicking on the overlay or using the backButton.
  6. Verify that the wide RHP closed correctly, the overlay disappeared, and the UI returned to the super wide RHP.

Test 4

  1. Go to the Inbox page and find a report with multiple expenses.
  2. Click on it.
  3. Verify that the SWRHP opens, nothing is broken, and everything functions correctly.

Test 5

  1. Go to the Reports page in the Reports tab.
  2. Open a report with more than one transaction.
  3. Click on one of the expenses.
  4. Click the More button in the wide RHP and choose an option that opens an RHP (e.g., Info).
  5. Verify that the RHP opened correctly, overlays reflect the proper structure, and nothing is broken.

Test 6

  1. Go to the Reports page in the Reports tab.
  2. Open a report with more than one transaction.
  3. Click on one of the expenses.
  4. Click the link below the wide RHP title that leads back to the parent report.
  5. Verify that the wide RHP correctly returns back to the parent super wide RHP.

Verify if these bugs don't appear:

Offline tests

QA Steps

  • 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
    • MacOS: Desktop
  • 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 there are no new alerts related to the canBeMissing param for useOnyx
  • 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
      • If any non-english text was added/modified, I used JaimeGPT to get English > Spanish translation. I then posted it in #expensify-open-source and it was approved by an internal Expensify engineer. Link to Slack message:
    • 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: mWeb Chrome
iOS: Native
Screen.Recording.2025-12-05.at.14.19.57.mov
iOS: mWeb Safari
Screen.Recording.2025-12-05.at.14.36.06.mov
MacOS: Chrome / Safari
MacOS: Desktop
Screen.Recording.2025-12-05.at.09.34.25.mov

@codecov
Copy link

codecov bot commented Nov 24, 2025

@WojtekBoman WojtekBoman force-pushed the swrhp-v2 branch 3 times, most recently from 052c950 to 17237de Compare December 5, 2025 11:50
@WojtekBoman WojtekBoman changed the title SWRHP V2 Add Super Wide RHP Routes Dec 5, 2025
const {wideRHPRouteKeys, superWideRHPRouteKeys} = useContext(WideRHPContext);
const [network] = useOnyx(ONYXKEYS.NETWORK, {canBeMissing: true});
const shouldDisplayNarrowMoreButton = !shouldDisplayNarrowVersion || (wideRHPRouteKeys.length > 0 && !isSmallScreenWidth);
const shouldDisplayNarrowMoreButton = !shouldDisplayNarrowVersion || ((wideRHPRouteKeys.length > 0 || superWideRHPRouteKeys.length > 0) && !isSmallScreenWidth);
Copy link
Contributor

Choose a reason for hiding this comment

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

We should switch the implementation here to use the shouldUseNarrowLayout wrapper instead


const {shouldUseNarrowLayout} = useResponsiveLayout();
// eslint-disable-next-line rulesdir/prefer-shouldUseNarrowLayout-instead-of-isSmallScreenWidth
const {shouldUseNarrowLayout: shouldUseNarrowLayoutByDefault, isSmallScreenWidth} = useResponsiveLayout();
Copy link
Contributor

Choose a reason for hiding this comment

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

here too

const styles = useThemeStyles();
// eslint-disable-next-line rulesdir/prefer-shouldUseNarrowLayout-instead-of-isSmallScreenWidth
const {isSmallScreenWidth, isMediumScreenWidth, isLargeScreenWidth, shouldUseNarrowLayout} = useResponsiveLayout();
const {isSmallScreenWidth, isMediumScreenWidth, isLargeScreenWidth, shouldUseNarrowLayout: shouldUseNarrowLayoutByDefault} = useResponsiveLayout();
Copy link
Contributor

Choose a reason for hiding this comment

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

here too

const {translate, localeCompare} = useLocalize();
// eslint-disable-next-line rulesdir/prefer-shouldUseNarrowLayout-instead-of-isSmallScreenWidth
const {shouldUseNarrowLayout, isSmallScreenWidth, isMediumScreenWidth} = useResponsiveLayout();
const {shouldUseNarrowLayout: shouldUseNarrowLayoutByDefault, isSmallScreenWidth, isMediumScreenWidth} = useResponsiveLayout();
Copy link
Contributor

Choose a reason for hiding this comment

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

here

const secondOverlayRHPOnSuperWideRHPProgress = new Animated.Value(0);
const thirdOverlayProgress = new Animated.Value(0);

// This array contains the names of wide and super wide right modals.
Copy link
Contributor

@collectioneur collectioneur Dec 5, 2025

Choose a reason for hiding this comment

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

It seems to me it would be better to split this into three screen sets for WRHP:
Wide RHP – search_report
Super-Wide RHP – money_request_report, expense_report
combined - money_request_report, expense_report, search_report


const lastRHPKeys = extractNavigationKeys(lastRHPRoute.state);
const superWideRHPIndex =
lastRHPRoute.state?.routes.findLastIndex((route) => route.name === SCREENS.RIGHT_MODAL.SEARCH_MONEY_REQUEST_REPORT || route.name === SCREENS.RIGHT_MODAL.EXPENSE_REPORT) ?? -1;
Copy link
Contributor

Choose a reason for hiding this comment

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

We can use here SUPER_WIDE_RIGHT_MODALS.has()

const superWideRHPIndex =
lastRHPRoute.state?.routes.findLastIndex((route) => route.name === SCREENS.RIGHT_MODAL.SEARCH_MONEY_REQUEST_REPORT || route.name === SCREENS.RIGHT_MODAL.EXPENSE_REPORT) ?? -1;

const wideRHPIndex = lastRHPRoute.state?.routes.findLastIndex((route) => route.name === SCREENS.RIGHT_MODAL.SEARCH_REPORT) ?? -1;
Copy link
Contributor

Choose a reason for hiding this comment

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

And here we can use WIDE_RIGHT_MODALS.has() (after it only contains one screen) for consistency

return routeName === SCREENS.RIGHT_MODAL.SEARCH_REPORT;
}

function SecondaryOverlay() {
Copy link
Contributor

@collectioneur collectioneur Dec 5, 2025

Choose a reason for hiding this comment

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

I think we can move the SecondaryOverlay component into a separate file located in the same folder as Overlay and BaseOverlay

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For now, I would leave it in this file as it's used only here, it's easier to find it and we don't need to jump between files

const singleRHPWidth = variables.sideBarWidth;
const getWideRHPWidth = (windowWidth: number) => variables.sideBarWidth + calculateReceiptPaneRHPWidth(windowWidth);

function SecondaryOverlay() {
Copy link
Contributor

Choose a reason for hiding this comment

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

We can move this component as well to the same place where we have Overlay and BaseOverlay.
I’d also suggest merging these two components into a single one that returns both overlays at once, for example, as an object with two fields (innerOverlay and outerOverlay), or as a component with a boolean prop like shouldReturnInnerOverlay.

const screenOptions = useRHPScreenOptions();
const {shouldRenderSecondaryOverlay, isWideRHPFocused, shouldRenderTertiaryOverlay, isWideRHPClosing, clearWideRHPKeys, syncWideRHPKeys, syncSuperWideRHPKeys} =
useContext(WideRHPContext);
const {shouldRenderTertiaryOverlay, clearWideRHPKeys, syncWideRHPKeys, syncSuperWideRHPKeys} = useContext(WideRHPContext);
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we can extract the tertiary overlay into a separate component as well?

return false;
}
const params = lastRoute.params;
if (params && 'screen' in params && typeof params.screen === 'string' && params.screen === SCREENS.RIGHT_MODAL.SEARCH_REPORT) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Here we also can use WIDE_RIGHT_MODALS.has() after refactor

@WojtekBoman WojtekBoman marked this pull request as ready for review December 5, 2025 13:52
@WojtekBoman WojtekBoman requested review from a team as code owners December 5, 2025 13:52
@melvin-bot melvin-bot bot requested review from ZhenjaHorbach and trjExpensify and removed request for a team December 5, 2025 13:53
@melvin-bot
Copy link

melvin-bot bot commented Dec 5, 2025

@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 removed the request for review from a team December 5, 2025 13:53
@github-actions
Copy link
Contributor

github-actions bot commented Dec 5, 2025

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

@github-actions

This comment has been minimized.

@trjExpensify
Copy link
Contributor

I created an empty report > created an expense to add to it and then I got this view:

2025-12-05_18-16-14.mp4

I can't seem to delete the expense from that view either.

@trjExpensify
Copy link
Contributor

Not sure what to do about this, but the sizing of the modal changing while it's loading is a bit jarring. Even if I'm cycling through reports that should go from super wide > super wider, it still goes to a skeleton loader of the wide modal first:

2025-12-05_18-13-08.mp4

@MonilBhavsar
Copy link
Contributor

Yet to confirm, but looks like this PR caused #77606

WojtekBoman added a commit to software-mansion-labs/expensify-app-fork that referenced this pull request Dec 15, 2025
…/swrhp-v2"

This reverts commit 50f5b59, reversing
changes made to 8df157e.
mountiny added a commit that referenced this pull request Dec 15, 2025
Revert "Merge pull request #75886 from software-mansion-labs/swrhp-v2"
OSBotify pushed a commit that referenced this pull request Dec 15, 2025
Revert "Merge pull request #75886 from software-mansion-labs/swrhp-v2"

(cherry picked from commit 1a72783)

(cherry-picked to staging by mountiny)
@jponikarchuk
Copy link

This PR is fail in Test 2 with this issue
Reproduced on Web, Android and iOS app

Bug7028707_1765628675164.77578-PR75886_-_Expense_preview_increase_when_navigating_a_single_expense___empty_report_with_arrow.mp4

collectioneur added a commit to software-mansion-labs/expensify-app-fork that referenced this pull request Dec 15, 2025
@OSBotify
Copy link
Contributor

🚀 Deployed to production by https://github.com/AndrewGable in version: 9.2.78-8 🚀

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

@OSBotify
Copy link
Contributor

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

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

@OSBotify
Copy link
Contributor

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

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

WojtekBoman pushed a commit to software-mansion-labs/expensify-app-fork that referenced this pull request Dec 17, 2025
@OSBotify
Copy link
Contributor

🚀 Deployed to production by https://github.com/AndrewGable in version: 9.2.81-5 🚀

platform result
🖥 desktop 🖥 success ✅
🕸 web 🕸 success ✅
🤖 android 🤖 failure ❌
🍎 iOS 🍎 success ✅

@OSBotify
Copy link
Contributor

🚀 Deployed to production by https://github.com/AndrewGable in version: 9.2.81-5 🚀

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

WojtekBoman pushed a commit to software-mansion-labs/expensify-app-fork that referenced this pull request Dec 19, 2025
WojtekBoman pushed a commit to software-mansion-labs/expensify-app-fork that referenced this pull request Dec 22, 2025
WojtekBoman pushed a commit to software-mansion-labs/expensify-app-fork that referenced this pull request Jan 7, 2026
WojtekBoman pushed a commit to software-mansion-labs/expensify-app-fork that referenced this pull request Jan 9, 2026
WojtekBoman pushed a commit to software-mansion-labs/expensify-app-fork that referenced this pull request Jan 13, 2026
WojtekBoman pushed a commit to software-mansion-labs/expensify-app-fork that referenced this pull request Jan 14, 2026
@IuliiaHerets IuliiaHerets mentioned this pull request Jan 15, 2026
52 tasks
@OSBotify
Copy link
Contributor

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

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

@OSBotify
Copy link
Contributor

🚀 Deployed to production by https://github.com/francoisl in version: 9.3.3-8 🚀

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

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.