Add Explain link to MOVED_TRANSACTION report actions#84279
Conversation
When Concierge automatically moves a transaction (e.g. due to policy violations during harvesting), the backend now includes a reasoning field in the MOVED_TRANSACTION action. This change renders the Explain link on those actions so users can ask Concierge why their expense was moved. Co-authored-by: Alex Beaman <Beamanator@users.noreply.github.com>
Co-authored-by: Alex Beaman <Beamanator@users.noreply.github.com>
|
Fixed the failing Prettier check. The ternary expression in |
|
The failing check ( Analysis: The job failed during "Set up job" before any tests ran. GitHub Actions couldn't download the Evidence: The failure occurred at the action download phase, not during test execution. The PR changes ( Next step: Please re-run the failed job — it should pass on retry since this was a transient network issue. |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
@MelvinBot please add automatic tests to this PR |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2026-03-06.at.23.18.52.mp4Android: mWeb ChromeScreen.Recording.2026-03-06.at.23.20.46.mp4iOS: HybridAppScreen.Recording.2026-03-06.at.23.25.06.mp4iOS: mWeb SafariScreen.Recording.2026-03-06.at.23.29.33.mp4MacOS: Chrome / SafariScreen.Recording.2026-03-06.at.23.12.41.mp4Screen.Recording.2026-03-06.at.23.14.29.mp4 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e1abca43cb
ℹ️ 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".
| if (hasReasoning(action)) { | ||
| return ( | ||
| <ReportActionItemMessageWithExplain |
There was a problem hiding this comment.
Keep pending-delete formatting when reasoning is present
The new hasReasoning(action) early return bypasses the isPendingDelete branch, so a MOVED_TRANSACTION action with reasoning from a report marked pendingFields.preview=DELETE no longer renders with the deleted (<del>) styling and text-only fallback. In that state, users will see an active-looking message (including links/Explain) for an action that should still appear as deleted, which is a regression from the previous behavior in this component.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Yeah I considered that, but I believe the other callers of ReportActionItemMessageWithExplain act the same
Unit tests for the hasReasoning utility covering: non-empty reasoning, missing reasoning, empty string reasoning, and null/undefined actions. UI tests for MOVED_TRANSACTION actions verifying the Explain link renders when reasoning is present and is absent when reasoning is not present. Co-authored-by: Alex Beaman <Beamanator@users.noreply.github.com>
|
@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] |
|
Added automatic tests in a313014: Unit tests (
UI tests (
All 6 tests pass locally. |
|
@MelvinBot pull main and resolve conflicts |
Resolved conflict in tests/unit/ReportActionsUtilsTest.ts by keeping both the new isRejectedAction tests from main and the hasReasoning tests from this branch. Co-authored-by: Alex Beaman <Beamanator@users.noreply.github.com>
|
Merged main and resolved conflicts in ae43038. The only conflict was in |
|
Please ping me when it's ready |
|
It seems no internal engineer is assigned. |
…nToMovedTransaction
|
The failing check ( Analysis: The error is Evidence: The same |
Yeah this is the same for all Tried adding an internal reviewer, sorry @jjcoffee - will post in slack to get one |
…nToMovedTransaction
|
perf tests most likely fixed in #84571 |
|
The failing check ( The latest merge commit ( |
|
🚧 @Beamanator has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/Beamanator in version: 9.3.34-0 🚀
|
|
The QA team isn't receiving any movement message from the concierge. Do I need a special account for this? Screenrecorder-2026-03-10-20-09-54-213.mp4 |
|
@lanitochka17 Which option did you choose for Delay Submission? Daily, weekly, or something else? |
|
@huult Daily |
|
🚀 Deployed to production by https://github.com/luacmartins in version: 9.3.34-2 🚀
|
|
@Beamanator It seems MelvinBot didn’t create a payment ticket. Could you please create one? |
|
oh wtf! yeah will check it out |
|
Thank you |
|
@Beamanator Sorry, we already have a ticket for the payment. My mistake |
Explanation of Change
When Concierge automatically moves a transaction between reports (e.g., extracting an expense with policy violations during harvesting so the remaining expenses can be submitted), the backend now includes a
reasoningfield in theMOVED_TRANSACTIONreport action'soriginalMessage. This PR adds support for rendering the "Explain" link on those actions, allowing users to ask Concierge why their expense was moved — the same UX that already exists for auto-categorization (MODIFIED_EXPENSE) and auto-submission (SUBMITTED).Changes:
OriginalMessage.ts— Added optionalreasoningfield toOriginalMessageMovedTransactiontypeMovedTransactionAction.tsx— WhenhasReasoning(action)is true, rendersReportActionItemMessageWithExplain(with sparkle icon + Explain link) instead of plainReportActionItemBasicMessage. Backwards-compatible: old moves without reasoning render unchanged.PureReportActionItem.tsx— PasseschildReportandoriginalReportprops toMovedTransactionAction(needed byReportActionItemMessageWithExplainfor the Explain thread flow)Fixed Issues
$ https://github.com/Expensify/Expensify/issues/603700
Tests
Prerequisite: Trigger an automated
MOVED_TRANSACTIONreport action with reasoning:MOVED_TRANSACTIONaction withreasoningin itsoriginalMessage.Test steps:
Offline tests
The Explain link opens a child thread and posts a message — this follows the same offline behavior as the existing Explain feature on
MODIFIED_EXPENSEandSUBMITTEDactions. When offline, the thread creation and message should be queued and sent when connectivity is restored.QA Steps
Prerequisite: Trigger an automated
MOVED_TRANSACTIONreport action with reasoning on staging:MOVED_TRANSACTIONaction that includesreasoning.Test 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
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari