Navigate to the clicked expense in a multi-expense report preview - #92546
MonilBhavsar merged 56 commits into
Conversation
…s show grey View button
…expense-preview-per-item-nav # Conflicts: # src/components/ReportActionItem/MoneyRequestReportPreview/index.tsx
…expense-preview-per-item-nav
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.
|
|
@jayeshmangwani 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] |
|
🚧 @shawnborton has triggered a test Expensify/App build. You can view the workflow run here. |
This comment has been minimized.
This comment has been minimized.
|
Hmm I thought we wanted to open up the expense with the report below it? cc @mountiny Right now it seems like we only open up the expense in the RHP, and not the report with the expense open. |
|
Yep that was the idea to open both the multiexpense and over that the report detail so basically push both |
|
@wildan-m , we can see both buttons here. If there's only a single report, I don't think we should display the View button. when a single expense report is pressed, can we keep the current behavior and open staging-behavior-ve-PR-behavior.mov |
I think it's probably fine to show both buttons in that case - I thought we basically always wanted to show both buttons, so that all cases had at least a View button as well? cc @Expensify/design |
Agree! |
|
Yeah same. I agree with that. Looks fine to me 👍 |
…expense-preview-per-item-nav
…n just the report
…expense-preview-per-item-nav
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
Yeah I definitely think they should be almost the same but with a slight stagger of animation. The video seems too slow and unintentional atm. What's the current delay from sheet 1 to 2 in milliseconds? |
Agree 👍 We have cascading delay of 180ms @wildan-m @jayeshmangwani could anyone please take a look and make a followup PR? Other animations in the App and their timings are defined here, which should give the idea Line 2060 in 97bf173 |
|
🚀 Deployed to staging by https://github.com/MonilBhavsar in version: 9.4.45-0 🚀
|
|
🤖 I reviewed the changes in this PR and yes, a help site update is warranted. This PR changes user-facing behavior in the multi-expense Report Previews carousel:
The Getting Started with the Spend Page article documents the Report Previews carousel but predates both of these behaviors, so I drafted an update to it. Draft help site PR: #97142
Labeled @wildan-m, please review the linked help site PR and confirm it reflects the current behavior. Then mark the linked help site PR |
|
Deploy Blocker #97149 was identified to be related to this PR. |
|
Deploy Blocker ##97155 was identified to be related to this PR. |
|
Deploy Blocker #97183 was identified to be related to this PR. |
|
Deploy Blocker #97184 was identified to be related to this PR. |
[CP staging] Revert "Navigate to the clicked expense in a multi-expense report preview- #92546"
|
🚀 Deployed to production by https://github.com/marcaaron in version: 9.4.45-14 🚀
Bundle Size Analysis (Sentry): |
|
🚀 Deployed to staging by https://github.com/MonilBhavsar in version: 9.4.46-0 🚀
|
|
🤖 No help site changes required. I reviewed the changes in this PR against Expensify's help site articles under WhyThis PR is a bug fix / minor interaction change for the multi-expense report preview carousel shown in chat:
The help site documents how to accomplish tasks (creating expenses/reports, approving, paying, managing expenses in a report, etc.), not the interaction-level detail of tapping a card in an in-chat report preview. I searched @wildan-m — no linked help site PR was created since no documentation changes are required. If you believe a specific article should describe this behavior, point me at it and I'll draft an update. |
|
🚀 Deployed to production by https://github.com/marcaaron in version: 9.4.46-10 🚀
Bundle Size Analysis (Sentry): |
Tapping a card in the multi-expense report preview carousel opens that expense instead of the parent report. Wide layouts keep the report in the super-wide RHP and cascade the pressed expense on top; narrow layouts open the expense with a single forward navigation, so back returns to the chat. This is v2 of #92546, which was reverted for five deploy blockers. v1 inserted the parent report beneath the expense so back stopped on the report first -- a spliced stack entry on native, an extra history entry on mobile web. That hand-built stack is gone: it broke whenever another flow mutated it (#97184 replaced the deleted thread with a duplicate report route, #97183 left a stale route after a split save, #97158 crashed resolving duplicates) and on mobile web the extra entry forced a state rebuild that flashed the chat on back. Navigation.ts is untouched by this version. Also guards an expense deleted while offline (#97149): those rows stay in the carousel but their thread is gone, so pressing one now opens the parent report instead of landing on 'It's not here'.


Explanation of Change
In a multi-expense report preview — the carousel shown in chat when a report has more than one expense — clicking any expense card opens the parent report instead of the expense that was clicked. Every card is wired to the same report-level press handler, so the specific expense a user taps is ignored even though it is already known when each card is built.
Each card now opens its own expense instead. On wide layouts the expense opens in the right-hand pane; on narrow layouts the report is pushed first and the expense on top of it, so going back returns to the report rather than straight to the chat. If a card's expense thread hasn't been created yet it is created on the fly so the tap never lands on a dead route, falling back to the parent report only when neither is possible. A grey "View" button is now always present in the preview's action row so the parent report stays reachable alongside whatever primary action (Submit, Approve, Pay, and so on) the report currently shows.
Fixed Issues
$ #91042
PROPOSAL: #91042 (comment)
Tests
Offline tests
Same as Tests, performed with the network connection turned off. Opening an expense whose thread already exists is pure navigation and works offline. Opening one whose thread has not been created yet reuses the existing optimistic thread-creation flow (the same one used when opening a standalone expense in chat), so it also works offline.
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
Android: Native
Kapture.2026-06-07.at.13.51.00.mp4
Android: mWeb Chrome
Kapture.2026-06-07.at.13.53.22.mp4
iOS: Native
Kapture.2026-06-07.at.13.35.26.mp4
iOS: mWeb Safari
Kapture.2026-06-07.at.13.44.08.mp4
MacOS: Chrome / Safari
Kapture.2026-06-07.at.09.01.47.mp4