You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Due for payment 2026-03-30] Expense - Expense auto enters selection mode after clicking Move to report #85537
Version Number: 9.3.39-0 Reproducible in staging?: Yes Reproducible in production?: N/A - new feature, doesn't exist in prod If this was caught during regression testing, add the test name, ID and link from BrowserStack:#85038 Email or phone of affected tester (no customers):sjdoisjoisdjonsnjo@gmail.com Issue reported by: Applause Internal Team Bug source: Exploratory - Significant User Experience Deterioration Device used: Mac 26.2 / Chrome App Component: Money Requests
Action Performed:
Go to staging.new.expensify.com
Go to workspace chat.
Create two expenses.
Open expense report.
Open any expense.
Click More > Move to report.
Close the RHP.
Close expense details RHP.
Expected Result:
Expense will not enter selection mode.
Actual Result:
Expense auto enters selection mode after clicking Move to report, even after RHP is closed.
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
Identify the pull request that introduced this issue and revert it.
Classification: Frontend bug Causing PR: #85038 - "Feat: Add 'Move to report' in the 'More' menu of a one-expense report" by @nyomanjyotisa (High confidence) Related Issues: None
Recommendation: REVERT
PR #85038 introduced a "Move to report" option in the More menu for single-expense reports. When this action is triggered, it calls setSelectedTransactions([transactionID]) to mark the transaction for moving. However, the selected transaction state persists in SearchContext even after the RHP is closed. The useHandleSelectionMode hook then detects this populated selectedTransactionIDs array and automatically activates mobile selection mode, causing the expense to unexpectedly enter selection mode.
This is the exact behavior reported in the issue: "Expense auto enters selection mode after clicking Move to report, even after RHP is closed."
When the user returns to the expense report view after closing the RHP, useHandleSelectionMode detects the persisted selected transaction and automatically activates mobile selection mode, causing the unexpected behavior.
The fix should either:
Clear selected transactions when the "Move to report" flow completes or is cancelled
Use a different mechanism for tracking which transaction to move that doesn't trigger selection mode
Prevent useHandleSelectionMode from activating when transactions are selected for non-selection-mode purposes
Please re-state the problem that we are trying to solve in this issue.
After clicking "More > Move to report" on an expense in an expense report, then closing the RHP without selecting a target report, the expense report auto-enters selection mode. The user sees the selection UI (checkboxes, "Select multiple" header) even though they never intended to enter selection mode.
What is the root cause of that problem?
When "Move to report" is clicked, MoneyRequestHeader.tsx (line 681) calls setSelectedTransactions([transaction.transactionID]) to populate the global SearchContext with the transaction, then navigates to the IOURequestEditReport RHP.
Meanwhile, MoneyRequestReportTransactionList.tsx (line 225) uses the useHandleSelectionMode hook, which automatically calls turnOnMobileSelectionMode() when it detects selectedTransactionIDs.length > 0 (useHandleSelectionMode.ts line 30).
The problem is that IOURequestEditReport.tsx has no cleanup on unmount. It only calls turnOffMobileSelectionMode() and clearSelectedTransactions() inside the selectReport and removeFromReport handlers — the "happy path" where the user completes the move action (lines 87-112). When the user dismisses the RHP without taking action (back button, swipe), the component unmounts silently, leaving selectedTransactionIDs populated and mobile selection mode enabled.
Additionally, the useFocusEffect cleanup in MoneyRequestReportTransactionList.tsx (line 243-252) intentionally skips clearing when navigating to the RHP, and doesn't re-clear when focus returns.
What changes do you think we should make in order to solve the problem?
Add a useEffect cleanup in IOURequestEditReport.tsx that calls turnOffMobileSelectionMode() and clearSelectedTransactions(true) on unmount. This ensures that when the user dismisses the RHP without completing the move, the selection state is properly cleaned up. On the happy path where the user does complete the move, these functions will have already been called, so calling them again on unmount is a safe no-op.
What alternative solutions did you explore? (Optional)
Enhancing navigateBack in IOURequestEditReportCommon.tsx — This would only cover the back button case, not all dismissal paths (swipe, navigation to another screen, etc.). A useEffect cleanup on unmount is more robust since it covers all dismissal scenarios.
Clearing state in the useFocusEffect of MoneyRequestReportTransactionList — This would mean modifying the focus/blur logic that intentionally preserves selections when navigating to the RHP, which could have unintended side effects on other flows that use selection mode with the RHP open.
Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, @MelvinBot <your feedback> to refine this analysis, or explain why you are rejecting Melvin's proposal.
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.41-4 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@aldo-expensify The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]
Skipping the payment summary for this issue since all the assignees are employees or vendors. If this is incorrect, please manually add the payment summary SO.
Skipping the payment summary for this issue since all the assignees are employees or vendors. If this is incorrect, please manually add the payment summary SO.
Activity
melvin-bot commentedon Mar 17, 2026
You have been assigned to this deploy blocker because you recently merged this PR: #85038
melvin-bot commentedon Mar 17, 2026
💬 A slack conversation has been started in #expensify-open-source
github-actions commentedon Mar 17, 2026
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
OSBotify commentedon Mar 17, 2026
Investigation Summary
Classification: Frontend bug
Causing PR: #85038 - "Feat: Add 'Move to report' in the 'More' menu of a one-expense report" by @nyomanjyotisa (High confidence)
Related Issues: None
Recommendation: REVERT
PR #85038 introduced a "Move to report" option in the More menu for single-expense reports. When this action is triggered, it calls
setSelectedTransactions([transactionID])to mark the transaction for moving. However, the selected transaction state persists inSearchContexteven after the RHP is closed. TheuseHandleSelectionModehook then detects this populatedselectedTransactionIDsarray and automatically activates mobile selection mode, causing the expense to unexpectedly enter selection mode.This is the exact behavior reported in the issue: "Expense auto enters selection mode after clicking Move to report, even after RHP is closed."
Labels: Keeping
DeployBlockerCash(frontend bug blocking App deploy)Detailed Analysis
Evidence
Verification
PR #85038 modified the following files related to the bug:
src/components/MoneyReportHeader.tsx- Added Move Expense secondary action (line 1120-1137 in diff)src/components/MoneyRequestHeader.tsx- Added Move Expense secondary action (line 211-236 in diff)src/components/MoneyRequestReportView/MoneyRequestReportTransactionList.tsx- UsesuseHandleSelectionModehooksrc/hooks/useHandleSelectionMode.ts- Automatically turns on selection mode whenselectedTransactionIDs.length > 0Root Cause
When the user clicks "Move to report" from the More menu:
These calls populate the
selectedTransactionIDsinSearchContext, which persists even after navigation or RHP closure.When the user returns to the expense report view after closing the RHP,
useHandleSelectionModedetects the persisted selected transaction and automatically activates mobile selection mode, causing the unexpected behavior.The fix should either:
useHandleSelectionModefrom activating when transactions are selected for non-selection-mode purposesMelvinBot commentedon Mar 17, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
After clicking "More > Move to report" on an expense in an expense report, then closing the RHP without selecting a target report, the expense report auto-enters selection mode. The user sees the selection UI (checkboxes, "Select multiple" header) even though they never intended to enter selection mode.
What is the root cause of that problem?
When "Move to report" is clicked,
MoneyRequestHeader.tsx(line 681) callssetSelectedTransactions([transaction.transactionID])to populate the globalSearchContextwith the transaction, then navigates to theIOURequestEditReportRHP.Meanwhile,
MoneyRequestReportTransactionList.tsx(line 225) uses theuseHandleSelectionModehook, which automatically callsturnOnMobileSelectionMode()when it detectsselectedTransactionIDs.length > 0(useHandleSelectionMode.ts line 30).The problem is that
IOURequestEditReport.tsxhas no cleanup on unmount. It only callsturnOffMobileSelectionMode()andclearSelectedTransactions()inside theselectReportandremoveFromReporthandlers — the "happy path" where the user completes the move action (lines 87-112). When the user dismisses the RHP without taking action (back button, swipe), the component unmounts silently, leavingselectedTransactionIDspopulated and mobile selection mode enabled.Additionally, the
useFocusEffectcleanup inMoneyRequestReportTransactionList.tsx(line 243-252) intentionally skips clearing when navigating to the RHP, and doesn't re-clear when focus returns.What changes do you think we should make in order to solve the problem?
Add a
useEffectcleanup inIOURequestEditReport.tsxthat callsturnOffMobileSelectionMode()andclearSelectedTransactions(true)on unmount. This ensures that when the user dismisses the RHP without completing the move, the selection state is properly cleaned up. On the happy path where the user does complete the move, these functions will have already been called, so calling them again on unmount is a safe no-op.What alternative solutions did you explore? (Optional)
Enhancing
navigateBackinIOURequestEditReportCommon.tsx— This would only cover the back button case, not all dismissal paths (swipe, navigation to another screen, etc.). AuseEffectcleanup on unmount is more robust since it covers all dismissal scenarios.Clearing state in the
useFocusEffectofMoneyRequestReportTransactionList— This would mean modifying the focus/blur logic that intentionally preserves selections when navigating to the RHP, which could have unintended side effects on other flows that use selection mode with the RHP open.Next Steps for Contributor+ team: Reply with
@MelvinBot implement thisto create a draft PR,@MelvinBot <your feedback>to refine this analysis, or explain why you are rejecting Melvin's proposal.ZhenjaHorbach commentedon Mar 17, 2026
CC: @nyomanjyotisa
ZhenjaHorbach commentedon Mar 17, 2026
But as for me, it's not a deploy blocker
nyomanjyotisa commentedon Mar 17, 2026
Looking 👀
Also, I agree that this is not a deploy blocker
aldo-expensify commentedon Mar 17, 2026
Are you planing to work on a PR to fix it? If it is the only issue, we could try to fix it instead of reverting
10 remaining items
melvin-bot commentedon Mar 23, 2026
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Mar 23, 2026
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.41-4 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2026-03-30. 🎊
melvin-bot commentedon Mar 23, 2026
@aldo-expensify The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]
melvin-bot commentedon Mar 23, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)melvin-bot commentedon Mar 30, 2026
Skipping the payment summary for this issue since all the assignees are employees or vendors. If this is incorrect, please manually add the payment summary SO.
melvin-bot commentedon Mar 30, 2026
Skipping the payment summary for this issue since all the assignees are employees or vendors. If this is incorrect, please manually add the payment summary SO.
mallenexpensify commentedon Mar 31, 2026
Closing, the issue linked to the offending PR has been commented on