Fix missing expense preview in chat list in Spend page#93728
Conversation
|
Product review not required. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7281f94dce
ℹ️ 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".
| <ChatTransactionPreview | ||
| action={action} | ||
| reportID={reportID} | ||
| chatReportID={report?.type === CONST.REPORT.TYPE.CHAT ? reportID : report?.chatReportID} |
There was a problem hiding this comment.
Pass the expense report when creating threads
When this new non-chat path renders an expense report, iouReport still comes from the ReportActionItem lookup that only resolves report-preview actions, so it is undefined for these IOU actions. For an existing expense action without childReportID—the preview's press handler explicitly supports creating the transaction thread on demand—pressing the newly rendered card calls createTransactionThreadReport without the current expense report, which makes CREATE actions fail to open a thread (and TRACK actions can be parented to the self-DM instead). Pass the current expense report as the IOU report for this non-chat case.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
The suggestion is correct. On the new non-chat path, ReportActionItem.tsx:177 derives iouReport via getIOUReportIDFromReportActionPreview(action), which only resolves REPORT_PREVIEW actions and returns undefined for an IOU action. That undefined flows into ChatTransactionPreview.tsx:67-75, so pressing a card with no childReportID calls createTransactionThreadReport without the IOU report — breaking thread creation for CREATE and mis-parenting TRACK.
For this path report is the expense report that owns the action, so pass it as the IOU report at ActionContentRouter.tsx:171:
iouReport={report?.type === CONST.REPORT.TYPE.CHAT ? iouReport : report}This is type-safe (report is OnyxEntry<Report>; ChatTransactionPreview's iouReport accepts OnyxEntry<Report>) and leaves the SELF_DM / split-bill chat cases unchanged.
There was a problem hiding this comment.
Good catch — fixed in 105cf1e. On the non-chat path report is the expense report that owns the IOU action, so it's now passed as iouReport:
iouReport={report?.type === CONST.REPORT.TYPE.CHAT ? iouReport : report}This keeps the SELF_DM / split-bill chat cases unchanged while letting on-demand transaction-thread creation work for CREATE actions and parent TRACK actions to the correct report.
On the non-chat path report is the expense report that owns the IOU action, so iouReport (derived from getIOUReportIDFromReportActionPreview) is undefined. Pass report itself so on-demand transaction thread creation works for CREATE actions and TRACK actions parent correctly. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / SafariMonosnap.screencast.2026-06-17.12-23-15.mp4 |
|
@luacmartins 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] |
|
🚧 @luacmartins has triggered a test Expensify/App build. You can view the workflow run here. |
|
✋ 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! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/luacmartins in version: 9.4.10-0 🚀
Bundle Size Analysis (Sentry): |
Help site review: no changes requiredI reviewed the changes in this PR against the help site articles under Conclusion: No documentation updates are needed. This PR is a frontend rendering bug fix. It restores a missing expense preview in the "In expense report" entry when filtering Chats on the Spend page (per #93641). The change only affects how an existing preview component is rendered:
There is no new feature, no new or renamed UI label, tab, setting, or button, and no behavioral change a user would need documented. The fix simply makes the UI match the already-expected behavior described in the issue. Help articles describe product features and workflows — none of them document the pixel-level preview rendering this PR corrects — so no article is now inaccurate or incomplete as a result of this change. Because no docs changes are required, I did not create a draft help site PR. @youssef-lr, please confirm you agree no help site updates are needed for this change. If you believe an article should be updated, let me know which behavior to document and I'll draft a PR. |
Explanation of Change
Fixed Issues
$ #93641
PROPOSAL:
Tests
Offline tests
QA Steps
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