Redirect the expense of a single-expense report to the report view - #99811
Draft
MelvinBot wants to merge 3 commits into
Draft
Redirect the expense of a single-expense report to the report view#99811MelvinBot wants to merge 3 commits into
MelvinBot wants to merge 3 commits into
Conversation
…ort view Co-authored-by: Aimane Chnaif <aimane-chnaif@users.noreply.github.com>
Co-authored-by: Aimane Chnaif <aimane-chnaif@users.noreply.github.com>
Co-authored-by: Aimane Chnaif <aimane-chnaif@users.noreply.github.com>
Contributor
Author
Contributor
Author
|
Android: Native — Result: pass — all 6 test steps verified on standalone Android NewDot. Created a €25.00 "Test Merchant" expense on "Melvin Bot's Workspace" and submitted it into "Expense Report 2026-08-29" (report
Evidence (7)Single-expense report view after submission
Tapping expense from chat lands on Expense Report view
Transaction thread root URL redirects to Expense Report view
Report shows expense details plus a working added comment
First expense in a 2-expense report opens its own transaction thread
Second expense in a 2-expense report opens its own transaction thread
Message-specific thread link opens thread and highlights message, no redirect
Evidence (1)Recordings- [▶ Session recording of the verification run](https://melvinbot-assets.exops.io/session-33230351756-1-e7d63f40-0919-4bed-a567-d2c798ba13b6.mp4) |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.












Explanation of Change
A report that holds exactly one expense already renders that expense inline —
shouldDisplayReportTableViewskips the table view for it, and the report's action list is merged with the transaction thread's actions. That makes the expense's own transaction thread a duplicate of the report, so landing on it is the wrong destination.Several call sites already encode that rule individually — Search does it in
getReportIDForTransactionandcreateAndOpenSearchTransactionThread, and the Home "review flagged expenses" row does it inline — but nothing enforces it for a route that arrives some other way (deep link, push notification, a stale history entry, or any navigation that resolved the IOU action'schildReportIDwithout checking the transaction count).This PR adds
OneTransactionThreadRedirectHandler, a render-nothing handler mounted inReportScreennext to the existing route handlers. When the route lands on the transaction thread of a single-expense report it replaces the route with the report itself, so every entry point ends on the single-expense report view.The redirect deliberately does not fire when:
reportActionIDis in the route — that deep link points at a specific message and replacing the route would drop its anchor;isOneTransactionThreadexcludes those too, because the report and the thread are not interchangeable there;transactionCountis not 1 — the action-based derivation reads whatever report actions are in Onyx, so a multi-expense report that is still paginating in could otherwise look like a single-expense one for a moment.It replaces (
forceReplace) rather than pushes so back navigation doesn't return to the thread, and it reuses the route's ownbackTofor the same reason. In the Search RHP it stays in the RHP by rebuilding theSEARCH_REPORTroute instead of the inbox one.Fixed Issues
$ #99356
PROPOSAL:
Tests
// TODO: The human co-author must fill out the tests you ran before marking this PR as "ready for review".
Suggested steps:
/r/<expenseReportID>), not the standalone expense view./r/<expenseReportID>.Automated coverage:
tests/navigation/OneTransactionThreadRedirectHandlerTest.tsx.Offline tests
// TODO: The human co-author must confirm the offline behavior before marking this PR as "ready for review".
Offline expectation: the redirect reads Onyx data that is already cached, so opening the transaction thread of a single-expense report while offline should still land on the report.
QA Steps
// TODO: The human co-author must fill out the QA steps before marking this PR as "ready for review". These must be filled out, or the issue title must include "[No QA]."
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, 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.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
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari