[$175] iOS Share Sheet - After adding an expense via the share sheet, user lands in the Inbox instead of the Spend page
If you haven’t already, check out our contributing guidelines for onboarding. To join our Slack channel, fill out this form.
Version Number: 9.5.53-2 Reproducible in staging?: Y Reproducible in production?: Y If this was caught during regression testing, add the test name, ID and link from BrowserStack: Email or phone of affected tester (no customers): Logs: https://stackoverflow.com/c/expensify/questions/4856 Expensify/Expensify Issue URL: Issue reported by: @JmillsExpensify Slack conversation (hyperlinked to channel name): #Expensify Bugs
Action Performed:
- On an iOS device, open a receipt/image in another app (e.g., Photos, Files).
- Tap Share and choose Expensify.
- Complete the flow to add/submit the expense.
- Observe where the app navigates after the expense is added.
Expected Result:
After the expense is added, the user is taken to the Spend page (Spend > Expenses), where the new expense is visible.
Actual Result:
The user lands in the Inbox.
Workaround:
Unknown
Platforms:
Select the officially supported platforms where the issue was reproduced:
- [ ] Android: App
- [ ] Android: mWeb Chrome
- [x] iOS: App
- [ ] iOS: mWeb Safari
- [ ] iOS: mWeb Chrome
- [ ] Windows: Chrome
- [ ] MacOS: Chrome / Safari
Screenshots/Videos
https://github.com/user-attachments/assets/4f60545b-4cb1-40d6-bc09-d64761946681
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~022125600564838801642
- Upwork Job ID: 2125600564838801642
- Last Price Increase: 2026-11-25
Triggered auto assignment to Contributor-plus team member for initial proposal review - @sobitneupane (External)
Job added to Upwork: https://www.upwork.com/jobs/~022125600564838801642
Proposal
What is the root cause of that problem?
The receipt submission flow explicitly selects a chat/report destination, which opens Inbox, rather than Spend > Expenses.
Confidence: Medium. Two independent code investigations support this explanation, but the native iOS flow was not reproduced. Web testing cannot reproduce the iOS system share sheet.
Code evidence and alternatives checked
- The receipt confirmation page disables Search as its pre-mounted destination and selects a report instead: SubmitDetailsPage.tsx:325–381.
- Successful submission reveals that report and disables further navigation during cleanup: SubmitDetailsPage.tsx:547–581.
- Report routes belong to the Inbox navigator, whereas Spend uses the Search navigator: config.ts:2470–2508.
- Existing tests explicitly expect the report destination, so they currently preserve this behavior: SubmitDetailsPageTest.tsx:478–508.
This explains the navigation without requiring a timing failure or failed expense creation. Changing only the final cleanup would miss the explicit report-reveal branches.
What changes do you think we should make in order to solve the problem?
Make successful receipt submission from the share sheet consistently select Spend > Expenses:
- Use the existing Expenses destination for both pre-mounting and completion.
- Remove report-arrival navigation waits where they are no longer necessary.
- Preserve expense creation, cleanup, confirmation messaging, and cancellation behavior.
- Leave the separate attachment/message-sharing flow unchanged.
Implementation reference and regression coverage
Reuse the canonical Expenses query and route construction in navigateAfterExpenseCreate.ts:105–140.
Update navigation tests to cover personal and workspace expenses, existing/new destination reports, narrow/wide layouts, and immediate submission before pre-mount completes. Verify cancellation and ordinary chat attachment sharing remain unchanged.
Native iOS verification should cover cold/warm launches and offline creation. The identified routing change is within App; no native repository change is currently indicated.
What alternative solutions did you explore? (Optional)
Marking the flow as “global create” or changing only cleanup navigation is insufficient: explicit report destinations would still select Inbox.
Next Steps for Contributor+ team:
To accept: @MelvinBot implement [this](https://github.com/Expensify/App/issues/107967) to create a draft PR.
To refine: @MelvinBot <your feedback>
To reject: Explain why you are rejecting Melvin's proposal.
Proposal
Please re-state the problem that we are trying to solve in this issue.
After adding an expense via the iOS share sheet (share a receipt/image from another app → Expensify → complete the flow), the user lands in the Inbox instead of the Spend page (Spend > Expenses), where the new expense should be visible. Reproduced in staging and production on v9.5.53-2, iOS app.
What is the root cause of that problem?
The share flow's post-submit navigation always resolves to the destination report (chat), and the existing "route to Spend > Expenses" path is gated on an onboarding choice the share-sheet user never made.
Concretely, in src/libs/Navigation/helpers/navigateAfterExpenseCreate.ts:86:
ts const isUserOnInbox = isReportTopmostSplitNavigator() && !(isLookingAroundUser && isSelfDMDestination);
The Spend routing (the navigateToSearch path below it, which navigates to ROUTES.SEARCH_ROOT with the expense query) only runs when the user picked the "Looking around / Something else" onboarding choice and the destination is their self-DM. SubmitDetailsPage.tsx:161 computes that flag as:
ts const isLookingAroundUser = isLookingAroundSearchRoutingActive(introSelected?.choice === CONST.ONBOARDING_CHOICES.LOOKING_AROUND, isOffline);
A share-sheet user with normal onboarding has isLookingAroundUser === false, so isUserOnInbox stays true and the function takes the early branch (dismissModalAndOpenReportInInboxTab(...), lines 90-96) — landing in the Inbox. The share page reinforces this: SubmitDetailsPage.tsx pre-mounts/reveals the report route (ROUTES.REPORT_WITH_ID, lines 359 and 572) as the post-submit destination, so there is no path that ever reaches Spend.
What changes do you think we should make in order to solve the problem?
- Extend the Spend routing to the share-extension flow: pass an
isShareFlowflag fromSubmitDetailsPage.tsxthroughcleanupAndNavigateAfterExpenseCreateintonavigateAfterExpenseCreate, and treat(isLookingAroundUser || isShareFlow) && isSelfDMDestinationas "not on inbox", so the existingnavigateToSearchpath (Spend > Expenses) runs for self-DM share submissions. Scope it to the self-DM case exactly like the existingLOOKING_AROUNDbehavior, so submissions to real reports/friends keep their normal destination. - In
SubmitDetailsPage.tsx, skip the report-route pre-mount/reveal (ROUTES.REPORT_WITH_ID) for the self-DM share case, so the Search navigation is the one that wins. - Add a unit test for
navigateAfterExpenseCreatecovering a share-flow self-DM expense create (expect navigation toSEARCH_ROOTwith the expense query) and a regression test that a non-share, non-LOOKING_AROUNDself-DM create still opens the report in the Inbox tab.
What alternative solutions did you explore? (Optional)
- Navigating to
ROUTES.SEARCH_ROOTdirectly inSubmitDetailsPageafter submit: rejected — the shared helper (cleanupAndNavigateAfterExpenseCreate/navigateAfterExpenseCreate) already owns post-create navigation, including the modal-dismiss and telemetry handling; duplicating that in the share page would diverge the two flows. - Routing all share submissions to Spend regardless of destination: rejected — only the self-DM (track) case belongs in Spend; an expense submitted to a real workspace report should still open that report.
QA steps (to verify the fix)
- On iOS staging, open a receipt/image in Photos, tap Share → Expensify, complete the flow to add/submit the expense to your own account (self-DM).
- Verify you land on Spend > Expenses with the new expense visible — not in the Inbox.
- Repeat submitting an expense to a workspace report/friend via the share sheet and verify it still opens that report (no behavior change there).
- Regression-check the normal (non-share) expense create flow: a self-DM create by a non-
LOOKING_AROUNDuser still opens the report in the Inbox tab.
Addendum — note on scope vs the implementation plan posted today: MelvinBot's plan routes every share-sheet submission (personal and workspace) to Spend and removes the report-arrival waits for the whole page. My proposal keeps the change scoped to the self-DM share flow (isShareFlow flag), leaving workspace/friend-DM destinations on their existing chat-report behavior and the shared helper's Inbox routing decisions untouched — which MelvinBot's own clarification also says should stay unchanged. It reuses the existing verified navigation path, fixing the reported bug without changing product behavior for other destinations.
Proposal
Please re-state the problem that we are trying to solve in this issue?
On iOS devices, after adding or submitting an expense via the native system Share Sheet (sharing a receipt or image from an external app like Photos or Files), the user lands in the Inbox tab instead of being routed to the Spend page (Spend > Expenses), where the newly created expense should be visible.
What is the root cause of that problem?
There are two coupled defects causing the post-submit navigation to route to the Inbox tab:
1. SubmitDetailsPage.tsx hardcodes isFromGlobalCreate: false and canPreInsertSearch: false
In src/pages/Share/SubmitDetailsPage.tsx (lines 334–346):
const preMountDestinationRoute = getSubmitExpensePreMountDestinationRoute({
isTransactionReady: hasNavigationDestination && !isDestinationReportMissing && !pendingNavigationReportID,
destinationReportID: postSubmitNavigationReportID,
destinationReport: destinationReportInCollection,
isFromGlobalCreate: false,
canPreInsertSearch: false,
iouType,
isCreatingTrackExpense,
isSelfDMDestination: isSelfDM(report),
isOptimisticNewChatDestination: false,
isLookingAroundUser,
isMovingTransactionFromTrackExpense: false,
});
And in lines 525–536:
const cleanupParams = {
report: isSelfDM(report) ? report : reportToSubmit,
action: CONST.IOU.ACTION.CREATE,
draftTransactionIDs,
transactionID: optimisticTransactionID,
isFromGlobalCreate: getIsFromGlobalCreate(transaction),
optimisticChatReportID: routeReportID,
navigationReportID: postSubmitNavigationReportID,
linkedTrackedExpenseReportAction: transaction.linkedTrackedExpenseReportAction,
isLookingAroundUser,
isSelfDMDestination: isSelfDM(report),
};
Because the Share Sheet transaction is constructed locally via initMoneyRequest and does not carry the isFromGlobalCreate flag, getIsFromGlobalCreate(transaction) returns false. Consequently:
canPreInsertSearch: falsepreventsgetSubmitExpensePreMountDestinationRoutefrom pre-mounting Search (ROUTES.SEARCH_ROOT), falling back instead to pre-mountingROUTES.REPORT_WITH_ID(the chat report in the Inbox).- On lines 568–579, if
topmostReportId !== postSubmitNavigationReportID, it explicitly revealsROUTES.REPORT_WITH_ID.getRoute(postSubmitNavigationReportID)over the modal, landing in the Inbox tab.
2. navigateAfterExpenseCreate.ts gates Search navigation on isFromGlobalCreate and isLookingAroundUser
In src/libs/Navigation/helpers/navigateAfterExpenseCreate.ts (lines 86–98):
// Treat a LOOKING_AROUND user's self-DM create as "not on inbox" so it falls through to the Search navigation below
// (route to Spend > Expenses instead of Personal Space). Scoped to isSelfDMDestination so other destinations are unaffected.
const isUserOnInbox = isReportTopmostSplitNavigator() && !(isLookingAroundUser && isSelfDMDestination);
// If the expense is not created from global create or is currently on the inbox tab,
// we just need to dismiss the money request flow screens
// and open the report chat containing the IOU report
if (!isFromGlobalCreate || isUserOnInbox || !transactionID) {
if (shouldNavigate) {
dismissModalAndOpenReportInInboxTab(activeReportID, isInvoice, hasMultipleTransactions, transactionID);
}
if (shouldFlagNewTransactionForChatPreview) {
flagNewTransactionForChatPreview({chatReportID: activeReportID, transactionID});
}
return;
}
If the app was open on the Inbox tab before the user switched to Photos to share a receipt:
isReportTopmostSplitNavigator()evaluates totrue.- For normal onboarding users,
isLookingAroundUserisfalse. - Even if
isFromGlobalCreateweretrue,isUserOnInboxevaluates totrue. - Therefore,
!isFromGlobalCreate || isUserOnInboxevaluates totrue, and line 93 unconditionally triggersdismissModalAndOpenReportInInboxTab, stranding the user in the Inbox!
What changes do you think we should make in order to solve the problem?
1. Pass isShareFlow: true from SubmitDetailsPage.tsx
In src/pages/Share/SubmitDetailsPage.tsx:
- When configuring
getSubmitExpensePreMountDestinationRoute(lines 334–346), enable search pre-insertion for self-DM expenses:
const isSelfDMDestination = isSelfDM(report);
const preMountDestinationRoute = getSubmitExpensePreMountDestinationRoute({
isTransactionReady: hasNavigationDestination && !isDestinationReportMissing && !pendingNavigationReportID,
destinationReportID: postSubmitNavigationReportID,
destinationReport: destinationReportInCollection,
isFromGlobalCreate: isSelfDMDestination,
canPreInsertSearch: isSelfDMDestination,
iouType,
isCreatingTrackExpense,
isSelfDMDestination,
isOptimisticNewChatDestination: false,
isLookingAroundUser,
isMovingTransactionFromTrackExpense: false,
});
- In
cleanupParams(line 525), passisShareFlow: trueandisFromGlobalCreate: isSelfDM(report) || getIsFromGlobalCreate(transaction). - On line 572, if
topmostReportId !== postSubmitNavigationReportIDandisSelfDMDestination:
const destinationRoute = isSelfDMDestination
? ROUTES.SEARCH_ROOT.getRoute({query: buildCannedSearchQuery({type: CONST.SEARCH.DATA_TYPES.EXPENSE}), searchKey: getSearchKeyForDataType(CONST.SEARCH.DATA_TYPES.EXPENSE)})
: ROUTES.REPORT_WITH_ID.getRoute(postSubmitNavigationReportID);
Navigation.revealRouteBeforeDismissingModal(destinationRoute, {
afterTransition: () => {
cleanupAndNavigateAfterExpenseCreate({...cleanupParams, shouldNavigate: false});
setIsConfirming(false);
},
});
2. Support isShareFlow in navigateAfterExpenseCreate.ts
In src/libs/Navigation/helpers/navigateAfterExpenseCreate.ts:
- Accept
isShareFlow = falseinNavigateAfterExpenseCreateParams. - Update
isUserOnInboxcalculation (line 86):
// Treat a LOOKING_AROUND user or Share Sheet submission for self-DM as "not on inbox" so it routes to Spend > Expenses
const isUserOnInbox = isReportTopmostSplitNavigator() && !((isLookingAroundUser || isShareFlow) && isSelfDMDestination);
This cleanly directs self-DM Share Sheet submissions to the Search/Spend navigator (ROUTES.SEARCH_ROOT with type: CONST.SEARCH.DATA_TYPES.EXPENSE), while leaving submissions to existing workspace chats or friend DMs to open their respective chat reports in the Inbox.
What alternative solutions did you explore (Optional)?
We considered calling Navigation.navigate(ROUTES.SEARCH_ROOT.getRoute(...)) unconditionally in SubmitDetailsPage.tsx after expense creation. However, bypassing cleanupAndNavigateAfterExpenseCreate would discard telemetry tracking (setPendingSubmitFollowUpAction), omit modal dismissal transitions, and fail to handle submissions to existing workspace chat reports. Extending navigateAfterExpenseCreate ensures all shared post-create navigation guarantees are preserved across both normal and share extension workflows.
Automated Tests?
Yes, unit and UI tests added in:
tests/unit/navigateAfterExpenseCreateTest.ts:- Verify that when
isShareFlow: trueandisSelfDMDestination: true,navigateAfterExpenseCreateroutes toROUTES.SEARCH_ROOTwith the expense query even whenisReportTopmostSplitNavigator()is true. - Verify that when
isShareFlow: truebut submitting to another user's chat or workspace report (isSelfDMDestination: false), it opens the report in the Inbox tab.
- Verify that when
tests/ui/SubmitDetailsPageTest.tsx:- Verify that submitting a receipt to self-DM passes
isShareFlow: truetocleanupAndNavigateAfterExpenseCreateand pre-mountsROUTES.SEARCH_ROOT.
- Verify that submitting a receipt to self-DM passes
Contributor details Your Expensify account email: [email protected] Upwork Profile Link: https://www.upwork.com/freelancers/~0131dae36abcf59374
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
Proposal
What is the root cause of that problem?
SubmitDetailsPage explicitly routes every share-sheet expense submission to a chat/report screen inside the Inbox navigator instead of Spend > Expenses, across all four navigation paths:
- Pre-mount forces a report route:
SubmitDetailsPage.tsxcallsgetSubmitExpensePreMountDestinationRoutewithisFromGlobalCreate: falseandcanPreInsertSearch: false(SubmitDetailsPage.tsx:334-346). Even if those flags were enabled,getSubmitExpensePreMountDestinationRoute.ts:65still blocks Search pre-insertion wheneverisReportTopmostSplitNavigator()istrue— the normal state on iOS when opening the Share Sheet from Inbox or cold launch. - Pending-report and wide fallbacks hardcode
ROUTES.REPORT_WITH_ID: BothrevealPendingNavigation(SubmitDetailsPage.tsx:359) and the wide-layout fallback (SubmitDetailsPage.tsx:572) explicitly revealROUTES.REPORT_WITH_ID. - Final cleanup fallback opens Inbox (and locks narrow tabs):
cleanupParamspassesisFromGlobalCreate: getIsFromGlobalCreate(transaction)(falsefor share-sheet transactions) intocleanupAndNavigateAfterExpenseCreate(SubmitDetailsPage.tsx:530), sonavigateAfterExpenseCreate.ts:91-93callsdismissModalAndOpenReportInInboxTab. Furthermore, on narrow layouts (iOS),navigateAfterExpenseCreate.ts:141passesforceReplace: !(isLookingAroundUser && isSelfDMDestination)— which keeps non-LOOKING_AROUNDcallers locked on their current tab (Inbox) instead of switching to Search.
What changes do you think we should make in order to solve the problem?
Update SubmitDetailsPage so successful share-sheet expense submission consistently lands on Spend > Expenses (ROUTES.SEARCH_ROOT with buildCannedSearchQuery({type: CONST.SEARCH.DATA_TYPES.EXPENSE}) and getSearchKeyForDataType(CONST.SEARCH.DATA_TYPES.EXPENSE)), while leaving ShareDetailsPage (normal chat/attachment sharing) unchanged:
- Drive
usePreMountDestinationdirectly with the Spend > Expenses route:- Compute
expensesSearchRouteviaROUTES.SEARCH_ROOT.getRoute({query: buildCannedSearchQuery({type: CONST.SEARCH.DATA_TYPES.EXPENSE}), searchKey: getSearchKeyForDataType(CONST.SEARCH.DATA_TYPES.EXPENSE)}). - Check if the user is already on the Expenses Search root (
!Navigation.getIsFullscreenPreInsertedUnderRHP() && isSearchTopmostFullScreenRoute() && getCurrentSearchQueryJSON()?.type === CONST.SEARCH.DATA_TYPES.EXPENSE). Passundefinedwhen already there so we never pre-insert a duplicate Search screen underneath the modal; otherwise passexpensesSearchRoutewhenever!!transactionis ready.
- Compute
- Unify post-submit exit through
revealPreMountDestinationand remove unnecessary report-arrival waits:- Because Spend > Expenses does not depend on the optimistic destination report existing in
COLLECTION.REPORT, removeisDestinationReportMissing,pendingNavigationReportID,revealPendingNavigation, and thetopmostReportId !== postSubmitNavigationReportIDreport-reveal branch. - In
finishRequestAndNavigate, callperformExpenseCreate(), sethasCalledReveal.current = true, and invokerevealPreMountDestination(() => { cleanupAndNavigateAfterExpenseCreate({...cleanupParams, shouldNavigate: false}); setIsConfirming(false); }). - On narrow iOS and wide layouts alike,
usePreMountDestination'sreveal()cleanly dismisses the modal when already on Expenses (route === undefined), reveals the pre-inserted Expenses screen on the fast path, or callsNavigation.revealRouteBeforeDismissingModal(expensesSearchRoute, {afterTransition})if the user tapped Confirm immediately — switching away from Inbox without triggeringnavigateAfterExpenseCreate's Inbox guard or narrowforceReplace: truetab lock.
- Because Spend > Expenses does not depend on the optimistic destination report existing in
- Update automated tests (
tests/ui/SubmitDetailsPageTest.tsx):- Update post-submit assertions to verify pre-mount and reveal target
ROUTES.SEARCH_ROOT(Spend > Expenses) for both workspace and self-DM expenses, even whenCOLLECTION.REPORTlacks the destination report and Inbox is topmost. - Add tests verifying: (a) submitting when already on Spend > Expenses skips pre-insert and calls
dismissModal, (b) immediate confirm before idle pre-insert callsrevealRouteBeforeDismissingModal(expensesSearchRoute), and (c) Back/Cancel callscleanupPreMount().
- Update post-submit assertions to verify pre-mount and reveal target
What alternative solutions did you explore? (Optional)
- Extending
navigateAfterExpenseCreatewith anisShareFlowflag scoped only toisSelfDMDestination: Rejected for two reasons: (1) workspace/report expenses submitted via the iOS Share Sheet still land in Inbox instead of Spend > Expenses as reported, and (2)navigateAfterExpenseCreate.ts:141still passesforceReplace: trueon narrow iOS unless also updated, which prevents switching off the Inbox tab. - Passing
isFromGlobalCreate: trueandcanPreInsertSearch: truetogetSubmitExpensePreMountDestinationRoute: Rejected becausegetSubmitExpensePreMountDestinationRoute.ts:65still disables Search pre-insertion wheneverisReportTopmostSplitNavigator()istrue.
How this differs from MelvinBot's proposal: MelvinBot suggests reusing navigateAfterExpenseCreate.ts:105-140, which still hits the isReportTopmostSplitNavigator() Inbox early-return (line 86) and narrow forceReplace: true tab lock (line 141). Routing through usePreMountDestination directly with the canonical expensesSearchRoute (and guarding isAlreadyOnExpensesSearch) solves both workspace and self-DM share submissions across narrow iOS and wide layouts, avoids redundant Search pre-insertion, and removes the unnecessary report-arrival timeout machinery.
Contributor details
Your Expensify account email: [email protected] Upwork Profile Link: https://www.upwork.com/freelancers/~015730018077950625
📣 @ZeroNeroIV! 📣 Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork. Please follow these steps:
- Make sure you've read and understood the contributing guidelines.
- Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
- Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
- Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>
Contributor details Your Expensify account email: [email protected] Upwork Profile Link: https://www.upwork.com/freelancers/~015730018077950625
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
@sobitneupane Huh... This is 4 days overdue. Who can take care of this?
@MelvinBot Could you please provide more details on the implementation?
Yes—the implementation can stay local to the share-sheet expense confirmation page. Both personal and workspace expenses should land on Spend > Expenses, while ordinary attachment/message sharing remains unchanged.
1. Set Expenses as the destination
Replace the report-based destination in SubmitDetailsPage.tsx:325–350 with the canonical Expenses route:
const expensesRoute = ROUTES.SEARCH_ROOT.getRoute({
query: buildCannedSearchQuery({
type: CONST.SEARCH.DATA_TYPES.EXPENSE,
}),
searchKey: getSearchKeyForDataType(CONST.SEARCH.DATA_TYPES.EXPENSE),
});
Pass that route directly to usePreMountDestination, rather than changing the shared expense-destination helper or introducing an isShareFlow flag.
If the underlying screen is already the unfiltered Expenses root, pass undefined instead: the hook can simply dismiss the modal. Checking only query.type === expense is insufficient—a workspace, merchant, or date filter could hide the new expense.
Keep this destination decision stable during the flow; pre-inserting Search must not cause a subsequent render to mistake that inserted screen for the original destination.
2. Use one successful-completion path
Replace the report-specific completion branches in SubmitDetailsPage.tsx:538–581 with this sequence:
cancelTracking();
performExpenseCreate();
hasCalledReveal.current = true;
revealPreMountDestination(() => {
cleanupAndNavigateAfterExpenseCreate({
...cleanupParams,
shouldNavigate: false,
});
setIsConfirming(false);
});
The important distinction is:
revealPreMountDestinationowns navigation to Expenses.cleanupAndNavigateAfterExpenseCreatestill performs cleanup and bookkeeping, but must not navigate back to Inbox.- Keep the actual expense report IDs in
cleanupParams; they still identify the created expense’s destination report.
The hook already handles narrow/wide layouts and immediate confirmation before pre-mount finishes, including a fallback reveal when necessary: usePreMountDestination/index.ts:71–106.
3. Remove only report-dependent navigation waits
Remove the pending-report subscription, report-arrival effect/timeouts, and explicit report-reveal fallbacks in SubmitDetailsPage.tsx:352–398. Expenses navigation no longer needs to wait for the destination chat report to appear.
Preserve receipt conversion/storage, GPS handling, duplicate-submit protection, expense creation, and telemetry. Keep cleanupPreMount() on Back/Cancel so abandoning the flow restores the original navigation state.
4. Update regression coverage
Update SubmitDetailsPageTest.tsx:478–639 to verify:
- Personal and workspace submissions both reveal canonical Expenses.
- Missing destination reports do not delay navigation.
- Immediate confirmation works before pre-mount completes.
- Already on canonical Expenses → dismiss only.
- Filtered Expenses → reveal canonical, unfiltered Expenses.
- Cleanup runs once after the transition with
shouldNavigate: false. - Back/Cancel removes the pre-mounted destination.
- Narrow and wide layouts behave consistently.
Clarification to my earlier proposal: reuse the canonical Search route construction, not the shared navigation helper’s routing decisions. Those decisions intentionally retain Inbox behavior for other expense flows and need not change here.
This is a code-verified implementation plan; no changes or runtime tests were performed. Native iOS verification remains necessary for the system share-sheet entry path.