86919: Message in IOU is not scrolled to when navigating via link, 'submitted' not shown - #96428
86919: Message in IOU is not scrolled to when navigating via link, 'submitted' not shown#96428abbasifaizan70 wants to merge 11 commits into
Conversation
…ubmitted' not shown
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
Do publish the PR if code changes are done |
|
@abdulrahuman5196 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] |
|
@abdulrahuman5196 Sorry, my bad. I just forgot to make it ready for review. Thanks for giving remainder. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7a8a51d0c1
ℹ️ 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".
joekaufmanexpensify
left a comment
There was a problem hiding this comment.
Good for product.
|
Reviewing |
|
Same concern as Codex: in both usePaginatedReportActions and LinkedActionNotFoundGuard, how do we distinguish “action isn’t in this report’s loaded actions yet” from “action truly isn’t on this report (e.g. it lives on the merged transaction thread)”? Right now both paths treat “not found in the current collection” as decisive |
|
@abdulrahuman5196 Fixed: the anchor is now dropped only when the linked action is confirmed to live in the merged one-transaction thread, not merely when it's absent from the current report's cache. useReportActionsPagination resolves the transaction thread and passes an explicit isLinkedActionInMergedTransactionThread flag into usePaginatedReportActions; a not-yet-loaded action that belongs to this report keeps its anchor, so the list still scrolls to it once OpenReport hydrates it. Non-one-transaction reports resolve to no thread, so regular chat deep-links are unchanged. LinkedActionNotFoundGuard already gates its not-found decision on the loading cycle completing, so it doesn't treat mere absence as decisive. Added a unit test covering the not-loaded-yet case (keeps anchor, stays empty) alongside the merged-thread case (drops anchor, newest window). |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 64267ad04c
ℹ️ 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".
…tead of rewriting copied links
|
@abdulrahuman5196 Implemented new solution as discussed in above chat. Thanks |
Explanation of Change
When a message link is copied from a one-transaction expense, the link points at the transaction thread — so opening it showed the thread on its own, without the parent's "Submitted" system message, and without scrolling to the linked message.
This fixes it by deciding at open time which report to show, rather than rewriting the link when it is copied:
ReportFetchHandlerredirects to the parent expense report while the thread is still that report's only transaction (shouldRedirectLinkedActionToParentReport), so the combined view opens with "Submitted" visible and the list anchors to the linked message.forceReplacekeeps the redirect out of the history stack.LinkedActionNotFoundGuardalso resolves the linked action in the transaction thread, since after the redirect the route is the parent while the action lives in the thread.usePaginatedReportActionsonly drops the pagination anchor when the linked action is confirmed to be in the merged transaction thread, so a valid action that simply hasn't loaded yet still scrolls into view onceOpenReporthydrates it.Fixed Issues
$ #86919
PROPOSAL: #86919 (comment)
Tests
1. Linked message opens the combined expense view (the reported bug)
/r/<transactionThreadID>/<reportActionID>to/r/<expenseReportID>/<reportActionID>2. A previously copied link still works after the report gains more expenses
("Submitted" is not expected here — the report is no longer a one-transaction expense, so the thread is correctly shown on its own.)
3. Regular chat message links are unchanged
Offline tests
Same as tests.
QA Steps
Same as tests.
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
Screen.Recording.2026-07-18.at.3.37.35.AM.mov
Android: mWeb Chrome
Screen.Recording.2026-07-18.at.3.42.06.AM.mp4
iOS: Native
Screen.Recording.2026-07-18.at.2.58.01.AM.mov
Screen.Recording.2026-07-18.at.2.59.07.AM.mov
iOS: mWeb Safari
Screen.Recording.2026-07-18.at.3.02.19.AM.mov
MacOS: Chrome / Safari
Screen.Recording.2026-08-26.at.3.51.50.AM.mov
Screen.Recording.2026-08-26.at.4.09.37.AM.mov