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-01-25] [$125] The report carousel is disappearing when report is Approved #79082
Please re-state the problem that we are trying to solve in this issue.
The report carousel disappears when a report is approved from the search view. In APPROVE, UNAPPROVED_CASH, and UNAPPROVED_CARD searches, users see a carousel (e.g., “1 of X”) to navigate between reports. After approving one report, the carousel disappears instead of updating to reflect the remaining reports (e.g., “1 of X-1”) and allowing continued navigation.
What is the root cause of that problem?
In approveMoneyRequestOnSearch, when a report is approved from certain suggested searches (APPROVE, UNAPPROVED_CASH, UNAPPROVED_CARD), the implementation immediately removes the approved report from the search snapshot by setting its entry to null in ONYXKEYS.COLLECTION.SNAPSHOT. This prematurely mutates the snapshot data, causing the allReports array used by MoneyRequestReportNavigation to shrink unexpectedly and break the carousel navigation logic.
What changes do you think we should make in order to solve the problem?
Remove the logic that immediately removes approved reports from the search snapshot data. Instead, keep the snapshot intact so the carousel can continue to function correctly. The search results can refresh naturally later or reflect updated report status without deleting entries mid-navigation.
Please re-state the problem that we are trying to solve in this issue.
The report carousel disappears after a report is approved from the search view. In approval-related searches (APPROVE, UNAPPROVED_CASH, UNAPPROVED_CARD), users can navigate between multiple reports using a carousel (for example, “1 of X”). After approving a report, the carousel is removed instead of updating to reflect the remaining reports and allowing continued navigation.
What is the root cause of that problem?
When approving a report from certain suggested searches, the approved report is removed from the search snapshot data. This causes the list of reports used by the carousel navigation to shrink unexpectedly, which breaks the navigation logic that depends on a stable set of reports.
What changes do you think we should make in order to solve the problem?
Instead of removing the approved report from the snapshot, update the report’s status within the snapshot data to reflect that it has been approved. This preserves the report list used by the carousel while still representing the updated approval state.
functionapproveMoneyRequestOnSearch(hash: number,reportIDList: string[],currentSearchKey?: SearchKey){constoptimisticData: Array<OnyxUpdate<typeofONYXKEYS.COLLECTION.REPORT_METADATA>>=[{onyxMethod: Onyx.METHOD.MERGE_COLLECTION,key: ONYXKEYS.COLLECTION.REPORT_METADATA,value: Object.fromEntries(reportIDList.map((reportID)=>[`${ONYXKEYS.COLLECTION.REPORT_METADATA}${reportID}`,{isActionLoading: true}])),},];constsuccessData: Array<OnyxUpdate<typeofONYXKEYS.COLLECTION.REPORT_METADATA|typeofONYXKEYS.COLLECTION.SNAPSHOT>>=[{onyxMethod: Onyx.METHOD.MERGE_COLLECTION,key: ONYXKEYS.COLLECTION.REPORT_METADATA,value: Object.fromEntries(reportIDList.map((reportID)=>[`${ONYXKEYS.COLLECTION.REPORT_METADATA}${reportID}`,{isActionLoading: false}])),},];// If we are on the 'Approve', `Unapproved cash` or the `Unapproved company cards` suggested search, update the report status instead of removing itconstapproveActionSuggestedSearches: Partial<SearchKey[]>=[CONST.SEARCH.SEARCH_KEYS.APPROVE,CONST.SEARCH.SEARCH_KEYS.UNAPPROVED_CASH,CONST.SEARCH.SEARCH_KEYS.UNAPPROVED_CARD,];if(approveActionSuggestedSearches.includes(currentSearchKey)){successData.push({onyxMethod: Onyx.METHOD.MERGE,key: `${ONYXKEYS.COLLECTION.SNAPSHOT}${hash}`,value: {data: Object.fromEntries(reportIDList.map((reportID)=>[`${ONYXKEYS.COLLECTION.REPORT}${reportID}`,{stateNum: CONST.REPORT.STATE_NUM.APPROVED}]),),},});}constfailureData: Array<OnyxUpdate<typeofONYXKEYS.COLLECTION.REPORT_METADATA|typeofONYXKEYS.COLLECTION.REPORT>>=[{onyxMethod: Onyx.METHOD.MERGE_COLLECTION,key: ONYXKEYS.COLLECTION.REPORT_METADATA,value: Object.fromEntries(reportIDList.map((reportID)=>[`${ONYXKEYS.COLLECTION.REPORT_METADATA}${reportID}`,{isActionLoading: false}])),},{onyxMethod: Onyx.METHOD.MERGE_COLLECTION,key: ONYXKEYS.COLLECTION.REPORT,value: Object.fromEntries(reportIDList.map((reportID)=>[`${ONYXKEYS.COLLECTION.REPORT}${reportID}`,{errors: getMicroSecondOnyxErrorWithTranslationKey('common.genericErrorMessage')},]),),},];playSound(SOUNDS.SUCCESS);API.write(WRITE_COMMANDS.APPROVE_MONEY_REQUEST_ON_SEARCH,{hash, reportIDList},{optimisticData, failureData, successData});}
What alternative solutions did you explore? (Optional)
Removing the logic that deletes reports from the snapshot and relying on a later search refresh
Please re-state the problem that we are trying to solve in this issue.
When an approver on a policy with multiple reports awaiting approval goes to Reports > Approve and approves a report, the navigation carousel (showing "1 of X" arrows to cycle through reports) disappears instead of updating to "1 of X-1" and allowing navigation to the next report.
What is the root cause of that problem?
The root cause is that approveMoneyRequest does not explicitly remove the approved report from the search snapshot, unlike approveMoneyRequestOnSearch which does.
Root Cause Flow:
User approves report via confirmApproval in MoneyReportHeader.tsx which calls approveMoneyRequest:
Onyx's merge behavior propagates this update to the snapshot's nested data.report_<id> because the key format ${ONYXKEYS.COLLECTION.REPORT}${reportID} matches the snapshot's nested data keys.
The filtering logic in getReportSections uses actionFilterMapping['approve'] which maps to expenseStatusActionMapping['outstanding'], requiring statusNum === 1:
// If we are on the 'Approve', `Unapproved cash` or the `Unapproved company cards` suggested search, remove the report from the view once the action is taken, don't wait for the view to be re-fetched via Search
constconfirmApproval=()=>{if(hasDynamicExternalWorkflow(policy)){showDWEModal();return;}setRequestType(CONST.IOU.REPORT_ACTION_TYPE.APPROVE);if(isDelegateAccessRestricted){showDelegateNoAccessModal();}elseif(isAnyTransactionOnHold){setIsHoldMenuVisible(true);}else{startApprovedAnimation();approveMoneyRequest(moneyRequestReport,policy,accountID,email??'',hasViolations,isASAPSubmitBetaEnabled,nextStep,true);// Remove the approved report from the search snapshot to prevent filtering issues// This mirrors the pattern used in approveMoneyRequestOnSearchif(currentSearchQueryJSON?.hash&&moneyRequestReport?.reportID){constapproveActionSuggestedSearches=[CONST.SEARCH.SEARCH_KEYS.APPROVE,CONST.SEARCH.SEARCH_KEYS.UNAPPROVED_CASH,CONST.SEARCH.SEARCH_KEYS.UNAPPROVED_CARD,];if(approveActionSuggestedSearches.includes(currentSearchKey)){Onyx.merge(`${ONYXKEYS.COLLECTION.SNAPSHOT}${currentSearchQueryJSON.hash}`,{data: {[`${ONYXKEYS.COLLECTION.REPORT}${moneyRequestReport.reportID}`]: null,},});}}}};
This fix:
Explicitly removes the approved report from the snapshot by setting it to null
Only applies when in an approve-related search context (matching the logic in approveMoneyRequestOnSearch)
Prevents the filtering from excluding a "half-updated" report
Allows the carousel to correctly update to show remaining reports
Please re-state the problem that we are trying to solve in this issue.
The report carousel is disappearing when report is Approved
What is the root cause of that problem?
This issue was caused by this PR #77957. In that change, we started filtering search data when the action key is present, such as submit, approve, or pay to fix the issue #76519.
What changes do you think we should make in order to solve the problem?
To resolve this issue, we don’t need to apply search-data filtering when an action key is present for MoneyRequestReportNavigation. We can implement it like this:
What alternative solutions did you explore? (Optional)
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
changed the title [-][$250] The report carousel is disappearing when report is Approved[/-][+][$125] The report carousel is disappearing when report is Approved[/+]on Jan 21, 2026
changed the title [-][$125] The report carousel is disappearing when report is Approved[/-][+][Due for payment 2026-01-25] [$125] The report carousel is disappearing when report is Approved[/+]on Jan 24, 2026
Activity
melvin-bot commentedon Jan 8, 2026
Triggered auto assignment to @kadiealexander (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.twinkle-react commentedon Jan 8, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
The report carousel disappears when a report is approved from the search view. In APPROVE, UNAPPROVED_CASH, and UNAPPROVED_CARD searches, users see a carousel (e.g., “1 of X”) to navigate between reports. After approving one report, the carousel disappears instead of updating to reflect the remaining reports (e.g., “1 of X-1”) and allowing continued navigation.
What is the root cause of that problem?
In
approveMoneyRequestOnSearch, when a report is approved from certain suggested searches (APPROVE, UNAPPROVED_CASH, UNAPPROVED_CARD), the implementation immediately removes the approved report from the search snapshot by setting its entry tonullinONYXKEYS.COLLECTION.SNAPSHOT. This prematurely mutates the snapshot data, causing theallReportsarray used byMoneyRequestReportNavigationto shrink unexpectedly and break the carousel navigation logic.What changes do you think we should make in order to solve the problem?
Remove the logic that immediately removes approved reports from the search snapshot data. Instead, keep the snapshot intact so the carousel can continue to function correctly. The search results can refresh naturally later or reflect updated report status without deleting entries mid-navigation.
Code change (remove snapshot mutation):
What alternative solutions did you explore? (Optional)
N/A
yatin-italy commentedon Jan 8, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
The report carousel disappears after a report is approved from the search view. In approval-related searches (APPROVE, UNAPPROVED_CASH, UNAPPROVED_CARD), users can navigate between multiple reports using a carousel (for example, “1 of X”). After approving a report, the carousel is removed instead of updating to reflect the remaining reports and allowing continued navigation.
What is the root cause of that problem?
When approving a report from certain suggested searches, the approved report is removed from the search snapshot data. This causes the list of reports used by the carousel navigation to shrink unexpectedly, which breaks the navigation logic that depends on a stable set of reports.
What changes do you think we should make in order to solve the problem?
Instead of removing the approved report from the snapshot, update the report’s status within the snapshot data to reflect that it has been approved. This preserves the report list used by the carousel while still representing the updated approval state.
What alternative solutions did you explore? (Optional)
TaduJR commentedon Jan 8, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
When an approver on a policy with multiple reports awaiting approval goes to Reports > Approve and approves a report, the navigation carousel (showing "1 of X" arrows to cycle through reports) disappears instead of updating to "1 of X-1" and allowing navigation to the next report.
What is the root cause of that problem?
The root cause is that
approveMoneyRequestdoes not explicitly remove the approved report from the search snapshot, unlikeapproveMoneyRequestOnSearchwhich does.Root Cause Flow:
confirmApprovalinMoneyReportHeader.tsxwhich callsapproveMoneyRequest:App/src/components/MoneyReportHeader.tsx
Lines 601 to 627 in a0bb986
approveMoneyRequestoptimistically updates the report'sstatusNumfrom1(SUBMITTED) to3(APPROVED) in the main report collection:App/src/libs/actions/IOU/index.ts
Lines 9957 to 9973 in a0bb986
Onyx's merge behavior propagates this update to the snapshot's nested
data.report_<id>because the key format${ONYXKEYS.COLLECTION.REPORT}${reportID}matches the snapshot's nested data keys.The filtering logic in
getReportSectionsusesactionFilterMapping['approve']which maps toexpenseStatusActionMapping['outstanding'], requiringstatusNum === 1:App/src/libs/SearchUIUtils.ts
Lines 231 to 234 in a0bb986
statusNum=3, it's filtered out (shouldShow: false):App/src/libs/SearchUIUtils.ts
Lines 1740 to 1755 in a0bb986
allReports.lengthdropping andcurrentIndexbecoming -1, the visibility condition fails:App/src/components/MoneyRequestReportView/MoneyRequestReportNavigation.tsx
Line 69 in a0bb986
Key Difference:
approveMoneyRequestOnSearchexplicitly removes the report from snapshot on success:App/src/libs/actions/Search.ts
Lines 549 to 559 in a0bb986
But
approveMoneyRequestdoes not do this.What changes do you think we should make in order to solve the problem?
Solution: Explicitly remove the approved report from the snapshot in
confirmApproval, matching the pattern used inapproveMoneyRequestOnSearch.Change in
MoneyReportHeader.tsx:App/src/components/MoneyReportHeader.tsx
Lines 601 to 627 in a0bb986
This fix:
nullapproveMoneyRequestOnSearch)TaduJR commentedon Jan 8, 2026
Demo of Proposal
Mac-Chrome.mp4
huult commentedon Jan 8, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
The report carousel is disappearing when report is Approved
What is the root cause of that problem?
This issue was caused by this PR #77957. In that change, we started filtering search data when the action key is present, such as
submit,approve, orpayto fix the issue #76519.App/src/libs/SearchUIUtils.ts
Lines 1748 to 1752 in 727f5f9
What changes do you think we should make in order to solve the problem?
To resolve this issue, we don’t need to apply search-data filtering when an action key is present for
MoneyRequestReportNavigation. We can implement it like this:App/src/libs/SearchUIUtils.ts
Lines 1750 to 1752 in 727f5f9
update to:
if (!shouldSkipActionFiltering && actionFromQuery && isValidActionFilter(actionFromQuery)) { shouldShow = shouldShow && actionFilterMapping[actionFromQuery](reportItem); }App/src/components/MoneyRequestReportView/MoneyRequestReportNavigation.tsx
Line 44 in 62d8893
add:
This is a POC for this ticket:
Screen.Recording.2026-01-09.at.01.22.13.mov
This is a POC for #76519 after we applied my solution:
Screen.Recording.2026-01-09.at.01.22.57.mov
Test branch
What alternative solutions did you explore? (Optional)
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
51 remaining items
[-][$250] The report carousel is disappearing when report is Approved[/-][+][$125] The report carousel is disappearing when report is Approved[/+]melvin-bot commentedon Jan 21, 2026
Upwork job price has been updated to $125
mountiny commentedon Jan 21, 2026
@125 to @mkhutornyi and @huult
huult commentedon Jan 21, 2026
Ah, got it. I understand now. Thank you very much!
mountiny commentedon Jan 24, 2026
Awaiting payment
[-][$125] The report carousel is disappearing when report is Approved[/-][+][Due for payment 2026-01-25] [$125] The report carousel is disappearing when report is Approved[/+]kadiealexander commentedon Jan 27, 2026
Payment Summary
mkhutornyi commentedon Jan 27, 2026
I'll be getting paid via newDot
quinthar commentedon Feb 7, 2026
Approved $125 to @mkhutornyi
melvin-bot commentedon Apr 30, 2026
If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.
If a regression has occurred and you are the assigned CM follow the instructions here.
If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.