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-06-30] [$250] Report title link from Spend > Expenses opens Inbox instead of Spend super-wide modal #91889
Version Number: 9.3.84-0 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:@jamesdeanexpensify Slack conversation (hyperlinked to channel name): #Migrate
Clicking on a report title in the More > View details section of an expense viewed on the Spend page opens the report in the super-wide modal on the Spend page.
Actual Result:
Clicking on a report title in the More > View details section of an expense viewed on the Spend page opens the report on the Inbox page.
Workaround:
Unknown
Platforms:
Select the officially supported platforms where the issue was reproduced:
When an expense is opened from the Spend page, clicking "More > View details" opens DynamicReportDetailsPage inside the Right Modal Navigator. That page renders a ParentNavigationSubtitle component for the report title link, but does not pass the openParentReportInCurrentTab prop — so it defaults to false.
With openParentReportInCurrentTab=false, the entire Search-context-aware navigation logic (which would route to SEARCH_MONEY_REQUEST_REPORT or SEARCH_REPORT) is skipped. The handler falls through to the fallback at line 242, which unconditionally navigates to ROUTES.REPORT_WITH_ID — the Inbox route (/r/{reportID}).
Compare with HeaderView.tsx, which correctly computes openParentReportInCurrentTab based on the current route and passes it to the same component.
What changes do you think we should make in order to solve the problem?
Two changes are needed:
In DynamicReportDetailsPage.tsx: Detect whether we're in the Search context (e.g., using isSearchTopmostFullScreenRoute() or checking currentFullScreenRoute) and pass openParentReportInCurrentTab={true} to ParentNavigationSubtitle when in Search.
In ParentNavigationSubtitle.tsx: The openParentReportInCurrentTab && RIGHT_MODAL_NAVIGATOR block (line 178) currently doesn't handle the case where the current route is REPORT_DETAILS instead of SEARCH_REPORT or SEARCH_MONEY_REQUEST_REPORT. Add a condition that, when currentFullScreenRoute is SEARCH_FULLSCREEN_NAVIGATOR and the report is a money request report, navigates to ROUTES.SEARCH_MONEY_REQUEST_REPORT (for the super-wide modal) instead of falling through to the REPORT_WITH_ID fallback. This mirrors the existing handling at line 146-161 but covers the Report Details entry point.
What alternative solutions did you explore? (Optional)
An alternative would be to make the fallback at line 242 context-aware (checking currentFullScreenRoute before choosing REPORT_WITH_ID vs a Search route). This is simpler but broader in scope — it would change behavior for all callers, not just the Report Details case. The targeted approach above is safer since it follows the established pattern used by HeaderView.tsx.
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.
🚨 Edited by proposal-police: This proposal was edited at 2026-05-28 03:09:46 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
When viewing an expense on the Spend page, opening More > View details and clicking the report-title link (the "from [report]" link) navigates the user to the Inbox tab instead of opening the report in the super-wide modal within the Spend tab.
What is the root cause of that problem?
The report-title link on the details page is the ParentNavigationSubtitle link, rendered by DynamicReportDetailsPage here (note it does not pass openParentReportInCurrentTab, so the prop defaults to false):
Its onPress handler resolves the destination through a series of Search-context guards added in PR #90680, then falls back to the Inbox-anchored REPORT_WITH_ID route:
Every Search-context branch is missed for this flow:
Both openParentReportInCurrentTab && … blocks (lines 144 and 178) are skipped entirely because the details page never passes openParentReportInCurrentTab.
Even if it did, the inner branches key off the current/last RHP route being SEARCH_REPORT / SEARCH_MONEY_REQUEST_REPORT. From View details the current RHP route is REPORT_DETAILS, so isReportInRHP (currentRoute.name === SEARCH_REPORT) is false and none of them match.
So control falls straight through to the REPORT_WITH_ID.getRoute(...) fallback, which is anchored to the Inbox (Reports) split navigator — yanking the user out of Spend. The intent to keep the user in the super-wide Search modal already exists (lines 144-162), it just isn't reachable from the report-details RHP entry point.
What changes do you think we should make in order to solve the problem?
Guard the Inbox fallback in ParentNavigationSubtitle.onPress so that when the report is being viewed inside the Search full-screen navigator (the Spend tab), we route to the Search context instead of REPORT_WITH_ID. This reuses the already-computed currentFullScreenRoute and mirrors the route choices the existing branches make (line 160 → super-wide, line 219 → search RHP):
+ // When the parent link is tapped while the report is shown inside the Search tab+ // (e.g. the report details RHP opened via More > View details on Spend), stay in the+ // Search context. Otherwise the REPORT_WITH_ID fallback below yanks the user to Inbox.+ if (currentFullScreenRoute?.name === NAVIGATORS.SEARCH_FULLSCREEN_NAVIGATOR) {+ if (isMoneyRequestReport(report)) {+ Navigation.navigate(ROUTES.SEARCH_MONEY_REQUEST_REPORT.getRoute({reportID: parentReportID}));+ } else {+ Navigation.navigate(ROUTES.SEARCH_REPORT.getRoute({reportID: parentReportID, reportActionID: isVisibleAction ? parentReportActionID : undefined}));+ }+ return;+ }+
if (isVisibleAction) {
Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(parentReportID, parentReportActionID));
} else {
Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(parentReportID));
}
isMoneyRequestReport, NAVIGATORS, ROUTES.SEARCH_MONEY_REQUEST_REPORT, and ROUTES.SEARCH_REPORT are all already imported and used in this file (lines 146, 160, 181), so no new imports are needed. Inbox behavior is unchanged: on the Inbox details page currentFullScreenRoute?.name is REPORTS_SPLIT_NAVIGATOR, so the guard is skipped and the existing REPORT_WITH_ID fallback still runs.
What alternative solutions did you explore? (Optional)
Pass openParentReportInCurrentTab from DynamicReportDetailsPage and extend the inner branches to recognize REPORT_DETAILS as the current RHP route — rejected because the branches at lines 146-221 are written around SEARCH_REPORT / SEARCH_MONEY_REQUEST_REPORT being the current/last route; covering the details-page case would require new conditions there anyway, spreading the fix across two files with no behavioral benefit over guarding the fallback directly.
Use the existing getReportRouteForCurrentContext helper in the fallback — rejected because it only returns SEARCH_REPORT (regular-width RHP), never SEARCH_MONEY_REQUEST_REPORT (the super-wide modal the issue expects for an expense report), and it drops reportActionID.
🚨 Edited by proposal-police: This proposal was edited at 2026-05-27 21:12:33 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
On Spend > Expenses, opening an expense (transaction) shows the transaction thread in a wide RHP, and clicking More > View details opens the Report Details panel. The "from " hyperlink shown beneath the transaction title in that panel should open the parent expense report inside the Spend super-wide modal, but instead it dismisses the entire Search context and jumps the user to the Inbox-based report screen.
What is the root cause of that problem?
The "report title hyperlink" is rendered by ParentNavigationSubtitle inside DynamicReportDetailsPage. When the user is on REPORT_DETAILS (caseID MONEY_REQUEST — the transaction thread case), the page renders nameSectionFurtherDetailsContent, which embeds ParentNavigationSubtitle with parentReportID={report?.parentReportID} (the parent here is the expense report). Crucially, the openParentReportInCurrentTab prop is omitted — defaulting to false per ParentNavigationSubtitle's destructured default at line 80.
When the user clicks the link, ParentNavigationSubtitle.onPress runs. Every Search-aware branch in onPress is gated behind openParentReportInCurrentTab — the if (openParentReportInCurrentTab && isReportInRHP) block at line 144 (which is where the existing SEARCH_MONEY_REQUEST_REPORT routing for the Search flow lives), and the broader if (openParentReportInCurrentTab && currentFocusedNavigator?.name === NAVIGATORS.RIGHT_MODAL_NAVIGATOR) block at line 178. Because the prop defaults to false from DynamicReportDetailsPage, all of those branches are skipped wholesale. Execution falls through to the unconditional inbox fallback at lines 242–246, which calls Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(parentReportID, ...)) — and REPORT_WITH_ID resolves into SCREENS.REPORT inside the Reports split navigator, which is precisely the Inbox flow. The Search RHP stack [SEARCH_REPORT (transaction thread), REPORT_DETAILS] gets dismissed and the user lands on Inbox.
A secondary gap exists even after we flip the prop on: the existing Search-aware sub-cases inside the currentFocusedNavigator === RIGHT_MODAL_NAVIGATOR block don't model the "REPORT_DETAILS sitting on top of SEARCH_REPORT" stack. lastRoute is REPORT_DETAILS (not SEARCH_MONEY_REQUEST_REPORT), and previousRoute is the SEARCH_REPORT whose reportID is the transaction thread's ID — not the parent expense report's parentReportID. So lines 180 and 189 both miss, the isReportInRHP check at line 218 misses (current route is REPORT_DETAILS, not SEARCH_REPORT), and we still fall through to REPORT_WITH_ID. The same gap explains the symmetric break for clicking the "from " link inside REPORT_DETAILS when it was opened from a SEARCH_MONEY_REQUEST_REPORT super-wide modal.
What changes do you think we should make in order to solve the problem?
Two coordinated changes in src/components/ParentNavigationSubtitle.tsx and src/pages/DynamicReportDetailsPage.tsx.
First, opt DynamicReportDetailsPage into the Search-aware routing by passing openParentReportInCurrentTab to ParentNavigationSubtitle in nameSectionFurtherDetailsContent. This is the analog of what MoneyReportHeader and MoneyRequestHeader already do via HeaderWithBackButton (which forwards the same prop down to AvatarWithDisplayName → ParentNavigationSubtitle). REPORT_DETAILS is the only "expense detail" surface still missing that hookup, and its entryScreens list at ROUTES.REPORT_DETAILS already includes SCREENS.RIGHT_MODAL.SEARCH_REPORT and SCREENS.RIGHT_MODAL.SEARCH_MONEY_REQUEST_REPORT, so it's a first-class Search surface.
Second, inside ParentNavigationSubtitle.onPress, add a new sub-case to the existing if (openParentReportInCurrentTab && currentFocusedNavigator?.name === NAVIGATORS.RIGHT_MODAL_NAVIGATOR) block (line 178) that fires when the topmost full-screen route is the Search navigator. Use currentFullScreenRoute?.name === NAVIGATORS.SEARCH_FULLSCREEN_NAVIGATOR (already computed for the existing branch at line 146) as the Search detector — this is the same idiom that MentionReportRenderer already relies on via isSearchTopmostFullScreenRoute() to decide between ROUTES.REPORT_WITH_ID and ROUTES.SEARCH_REPORT. When the parent we're navigating to is a money request report (use the existing isMoneyRequestReport(report) helper — report in this file is already the parent), route to ROUTES.SEARCH_MONEY_REQUEST_REPORT.getRoute({reportID: parentReportID}) to land in the super-wide modal; otherwise route to ROUTES.SEARCH_REPORT.getRoute({reportID: parentReportID, reportActionID: ...}) to stay in the wide RHP. Place the new check after the existing lastRoute === SEARCH_MONEY_REQUEST_REPORT / previousRoute === SEARCH_REPORT sub-cases so the duplicate-stack short-circuits (which call Navigation.goBack()) keep precedence and we never push a redundant RHP.
This fix preserves the well-tested Inbox path unchanged (the new branch only fires inside the Search full-screen navigator), reuses the existing currentFullScreenRoute and isMoneyRequestReport plumbing, and naturally covers both the transaction-thread case (parent is an expense report → super-wide) and the expense-report case (parent is a policy expense chat → wide). It also avoids the trap in the alternative below of widening isReportInRHP to include SEARCH_MONEY_REQUEST_REPORT, which wouldn't help here because currentRoute.name at click time is REPORT_DETAILS, not the underlying RHP screen.
What alternative solutions did you explore? (Optional)
We considered widening isReportInRHP at line 107 to also match SCREENS.RIGHT_MODAL.SEARCH_MONEY_REQUEST_REPORT and SCREENS.RIGHT_MODAL.EXPENSE_REPORT. That doesn't fix this bug because useRoute() inside ParentNavigationSubtitle rendered from DynamicReportDetailsPage returns the REPORT_DETAILS route, not the RHP screen below it — isReportInRHP stays false regardless. Another option was to swap the unconditional fallback at line 242 to consult isSearchTopmostFullScreenRoute() directly, but that would change behavior for every other caller of ParentNavigationSubtitle (HeaderView, ShareCodePage, etc.) at once, whereas gating the new branch on openParentReportInCurrentTab keeps the opt-in semantics consistent with the existing Search-aware paths.
Please re-state the problem that we are trying to solve in this issue
From Spend > Expenses, opening an expense, choosing More > View details, and then clicking the report title opens the parent report through the normal Inbox report route. It should preserve the Spend/Search context and open the parent expense report in the Spend super-wide modal.
What is the root cause of that problem?
The More > View details action opens the shared report details RHP for the current expense/thread report:
On that details page, the report-title/from link is rendered by ParentNavigationSubtitle, but this call does not pass openParentReportInCurrentTab:
src/pages/DynamicReportDetailsPage.tsx:828-842
That prop defaults to false in ParentNavigationSubtitle:
src/components/ParentNavigationSubtitle.tsx:74-80
So the search-aware parent navigation blocks are skipped. Even if the prop is passed, the current search checks are still too narrow for this flow:
isReportInRHP only checks currentRoute.name === SCREENS.RIGHT_MODAL.SEARCH_REPORT.
From Report Details, the component is rendered inside the report-details nested screen, while the outer right-modal stack contains the Search RHP underneath it.
The later right-modal branch only checks lastRoute and previousRoute, so it misses a stack where REPORT_DETAILS is on top of SEARCH_REPORT or SEARCH_MONEY_REQUEST_REPORT.
After those checks miss, the handler falls through to:
That fallback navigates to ROUTES.REPORT_WITH_ID, which is the Inbox report route instead of the Spend/Search report route.
What changes do you think we should make in order to solve the problem?
Make the details-page parent title opt into current-tab navigation, then make ParentNavigationSubtitle recognize Search context from the outer right-modal stack instead of only from the leaf route returned by useRoute().
Concretely:
In DynamicReportDetailsPage, pass openParentReportInCurrentTab to the ParentNavigationSubtitle used by nameSectionFurtherDetailsContent when the details page is shown over the Search fullscreen navigator. This mirrors the existing header behavior where parent links from Search RHPs preserve the current tab.
In ParentNavigationSubtitle, add a small helper around the existing root navigation state that treats the link as search-aware when:
the right-modal stack contains a Search report route underneath the active details route, such as SEARCH_REPORT or SEARCH_MONEY_REQUEST_REPORT.
For that search-aware details case:
If the parent report is a money request / expense report and the matching SEARCH_MONEY_REQUEST_REPORT super-wide RHP is already in the right-modal stack, call Navigation.dismissToSuperWideRHP().
If the parent report is a money request / expense report and it is not already in the stack, navigate with ROUTES.SEARCH_MONEY_REQUEST_REPORT.getRoute({reportID: parentReportID}).
For non-money-request parent reports in Search, keep using ROUTES.SEARCH_REPORT.getRoute({reportID: parentReportID, reportActionID: ...}), while preserving the existing go-back short-circuit when the matching wide RHP is already underneath.
Leave the existing ROUTES.REPORT_WITH_ID fallback unchanged for Inbox and other non-Search contexts.
This keeps the fix in the shared parent-link navigation path, covers Report Details stacked over Spend/Search, and avoids changing normal Inbox report links.
What specific scenarios should we cover in automated tests?
Add focused coverage in tests/ui/ParentNavigationSubtitleTest.tsx for a Search fullscreen plus right-modal stack where Report Details is above a Search expense RHP.
The key cases:
Stack: SearchFullscreenNavigator -> RightModalNavigator -> SEARCH_REPORT -> REPORT_DETAILS. With a money-request parent report, pressing parent-navigation-subtitle-link should call Navigation.navigate(ROUTES.SEARCH_MONEY_REQUEST_REPORT.getRoute({reportID: parentReportID})) and must not navigate to ROUTES.REPORT_WITH_ID.
Stack: SearchFullscreenNavigator -> RightModalNavigator -> SEARCH_MONEY_REQUEST_REPORT(parentReportID) -> SEARCH_REPORT -> REPORT_DETAILS. Pressing the link should call Navigation.dismissToSuperWideRHP() instead of pushing an Inbox route.
A non-Search Report Details context should keep the current ROUTES.REPORT_WITH_ID behavior so the change does not redirect normal Inbox parent links into Search.
What alternative solutions did you explore? (Optional)
Only passing openParentReportInCurrentTab from DynamicReportDetailsPage is not enough because the current ParentNavigationSubtitle checks still do not recognize a details screen stacked on top of Search RHPs.
Changing getReportURLForCurrentContext would not address this link path because this title click is handled by ParentNavigationSubtitle.onPress, not by prebuilt report URLs. Making the final REPORT_WITH_ID fallback globally context-aware would be broader than necessary and could change callers that intentionally do not opt into current-tab parent navigation.
changed the title [-]Report title link from Spend > Expenses opens Inbox instead of Spend super-wide modal[/-][+][$250] Report title link from Spend > Expenses opens Inbox instead of Spend super-wide modal[/+]on May 27, 2026
Please re-state the problem that we are trying to solve in this issue.
On Web, when viewing an expense from Spend > Expenses and opening More > View details, clicking the report title/parent-report hyperlink opens the report on the Inbox page instead of in the super-wide modal on the Spend page. Expected: the link should keep the user in the Search/Spend context and open the report in the super-wide RHP.
What is the root cause of that problem?
The hyperlink is rendered by ParentNavigationSubtitle. Its Search-context-preserving navigation branches (ParentNavigationSubtitle.tsx:144, :178) are gated on the openParentReportInCurrentTab prop, which defaults to false (ParentNavigationSubtitle.tsx:80). The report-details "from" subtitle in DynamicReportDetailsPage.tsx (the nameSectionFurtherDetailsContent block, DynamicReportDetailsPage.tsx:828) renders ParentNavigationSubtitle without passing openParentReportInCurrentTab, so it stays false.
However, even fixing the prop omission alone is not sufficient. When the user opens More > View details from the SEARCH_MONEY_REQUEST_REPORT super-wide RHP, that "View details" screen is pushed on top of SEARCH_MONEY_REQUEST_REPORT in the right-modal navigator stack. Inside ParentNavigationSubtitle.onPress, two guards must both pass:
isReportInRHP (currentRoute.name === SCREENS.RIGHT_MODAL.SEARCH_REPORT) — this is false on the details screen, so the first block at line 144 is skipped entirely.
The second block (line 178) checks currentFocusedNavigator?.name === NAVIGATORS.RIGHT_MODAL_NAVIGATOR and then lastRoute?.name === SCREENS.RIGHT_MODAL.SEARCH_MONEY_REQUEST_REPORT. Because the details screen is itself the last route, lastRoute is not SEARCH_MONEY_REQUEST_REPORT — the check fails and execution falls through to the Inbox fallback Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(...)) at ParentNavigationSubtitle.tsx:242-245.
The combined root cause is: (a) DynamicReportDetailsPage never passes openParentReportInCurrentTab, and (b) ParentNavigationSubtitle's SEARCH_MONEY_REQUEST_REPORT branch only inspects lastRoute rather than scanning the full RHP stack, so a details screen pushed on top of SEARCH_MONEY_REQUEST_REPORT breaks the check.
What changes do you think we should make in order to solve the problem?
Change 1 — DynamicReportDetailsPage.tsx (around line 828–847): Pass openParentReportInCurrentTab to ParentNavigationSubtitle, computed from the current navigator context, mirroring how MoneyRequestHeader.tsx:95/172 and HeaderView.tsx:107/349 already supply it:
Change 2 — ParentNavigationSubtitle.tsx (around line 178): The SEARCH_MONEY_REQUEST_REPORT guard currently checks only lastRoute. When the user drills deeper (e.g. into a details screen), the last route is no longer SEARCH_MONEY_REQUEST_REPORT. The guard should scan the full RHP stack to detect whether SEARCH_MONEY_REQUEST_REPORT is anywhere in the stack:
// ParentNavigationSubtitle.tsx ~line 178// Before (only checks last route):constlastRoute=currentFocusedNavigator?.state?.routes.at(-1);if(lastRoute?.name===SCREENS.RIGHT_MODAL.SEARCH_MONEY_REQUEST_REPORT){Navigation.navigate(ROUTES.SEARCH_REPORT.getRoute({reportID: parentReportID,reportActionID: parentReportActionID}));return;}// After (scan full RHP stack):constrhpRoutes=currentFocusedNavigator?.state?.routes??[];consthasMoneyRequestReportInStack=rhpRoutes.some((r)=>r.name===SCREENS.RIGHT_MODAL.SEARCH_MONEY_REQUEST_REPORT);if(hasMoneyRequestReportInStack){Navigation.navigate(ROUTES.SEARCH_REPORT.getRoute({reportID: parentReportID,reportActionID: parentReportActionID}));return;}
Change 3 — ReportDetailsPage.tsx (non-dynamic twin): Verify the same openParentReportInCurrentTab omission isn't present in ReportDetailsPage and patch it identically so both report-details surfaces behave consistently on Web and native.
Change 4 — Verify the end-to-end path for this repro: With both changes in place, the flow for this bug becomes: (a) DynamicReportDetailsPage computes isInSearchContext = true (because the details screen sits inside the SEARCH_MONEY_REQUEST_REPORT RHP), (b) openParentReportInCurrentTab is now true, (c) inside ParentNavigationSubtitle.onPress, the stack scan finds SEARCH_MONEY_REQUEST_REPORT in rhpRoutes and navigates to ROUTES.SEARCH_REPORT, keeping the user in the Spend tab.
What alternative solutions did you explore? (Optional)
Make the ParentNavigationSubtitleonPress fallback itself context-aware via getReportRouteForCurrentContext instead of relying on each caller to pass the prop; rejected as broader/riskier since several callers intentionally default it to false.
⚠️@yusufdeveloper2903 Thanks for your proposal. Please update it to follow the proposal template, as proposals are only reviewed if they follow that format (note the mandatory sections).
[Contributor] The offending PR and associated issue have been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
Link to the comment on the PR: N/A. No offending PR found
Link to the comment on the Issue: N/A
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion: N/A
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Activity
MelvinBot commentedon May 27, 2026
Proposal
What is the root cause of that problem?
When an expense is opened from the Spend page, clicking "More > View details" opens
DynamicReportDetailsPageinside the Right Modal Navigator. That page renders aParentNavigationSubtitlecomponent for the report title link, but does not pass theopenParentReportInCurrentTabprop — so it defaults tofalse.With
openParentReportInCurrentTab=false, the entire Search-context-aware navigation logic (which would route toSEARCH_MONEY_REQUEST_REPORTorSEARCH_REPORT) is skipped. The handler falls through to the fallback at line 242, which unconditionally navigates toROUTES.REPORT_WITH_ID— the Inbox route (/r/{reportID}).Compare with
HeaderView.tsx, which correctly computesopenParentReportInCurrentTabbased on the current route and passes it to the same component.What changes do you think we should make in order to solve the problem?
Two changes are needed:
In
DynamicReportDetailsPage.tsx: Detect whether we're in the Search context (e.g., usingisSearchTopmostFullScreenRoute()or checkingcurrentFullScreenRoute) and passopenParentReportInCurrentTab={true}toParentNavigationSubtitlewhen in Search.In
ParentNavigationSubtitle.tsx: TheopenParentReportInCurrentTab && RIGHT_MODAL_NAVIGATORblock (line 178) currently doesn't handle the case where the current route isREPORT_DETAILSinstead ofSEARCH_REPORTorSEARCH_MONEY_REQUEST_REPORT. Add a condition that, whencurrentFullScreenRouteisSEARCH_FULLSCREEN_NAVIGATORand the report is a money request report, navigates toROUTES.SEARCH_MONEY_REQUEST_REPORT(for the super-wide modal) instead of falling through to theREPORT_WITH_IDfallback. This mirrors the existing handling at line 146-161 but covers the Report Details entry point.What alternative solutions did you explore? (Optional)
An alternative would be to make the fallback at line 242 context-aware (checking
currentFullScreenRoutebefore choosingREPORT_WITH_IDvs a Search route). This is simpler but broader in scope — it would change behavior for all callers, not just the Report Details case. The targeted approach above is safer since it follows the established pattern used byHeaderView.tsx.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.yusufdeveloper2903 commentedon May 27, 2026
🚨 Edited by proposal-police: This proposal was edited at 2026-05-28 03:09:46 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
When viewing an expense on the Spend page, opening More > View details and clicking the report-title link (the "from [report]" link) navigates the user to the Inbox tab instead of opening the report in the super-wide modal within the Spend tab.
What is the root cause of that problem?
The report-title link on the details page is the
ParentNavigationSubtitlelink, rendered byDynamicReportDetailsPagehere (note it does not passopenParentReportInCurrentTab, so the prop defaults tofalse):App/src/pages/DynamicReportDetailsPage.tsx
Lines 832 to 842 in 377d37b
Its
onPresshandler resolves the destination through a series of Search-context guards added in PR #90680, then falls back to the Inbox-anchoredREPORT_WITH_IDroute:App/src/components/ParentNavigationSubtitle.tsx
Lines 242 to 246 in 377d37b
Every Search-context branch is missed for this flow:
openParentReportInCurrentTab && …blocks (lines 144 and 178) are skipped entirely because the details page never passesopenParentReportInCurrentTab.SEARCH_REPORT/SEARCH_MONEY_REQUEST_REPORT. From View details the current RHP route isREPORT_DETAILS, soisReportInRHP(currentRoute.name === SEARCH_REPORT) isfalseand none of them match.So control falls straight through to the
REPORT_WITH_ID.getRoute(...)fallback, which is anchored to the Inbox (Reports) split navigator — yanking the user out of Spend. The intent to keep the user in the super-wide Search modal already exists (lines 144-162), it just isn't reachable from the report-details RHP entry point.What changes do you think we should make in order to solve the problem?
Guard the Inbox fallback in
ParentNavigationSubtitle.onPressso that when the report is being viewed inside the Search full-screen navigator (the Spend tab), we route to the Search context instead ofREPORT_WITH_ID. This reuses the already-computedcurrentFullScreenRouteand mirrors the route choices the existing branches make (line 160 → super-wide, line 219 → search RHP):isMoneyRequestReport,NAVIGATORS,ROUTES.SEARCH_MONEY_REQUEST_REPORT, andROUTES.SEARCH_REPORTare all already imported and used in this file (lines 146, 160, 181), so no new imports are needed. Inbox behavior is unchanged: on the Inbox details pagecurrentFullScreenRoute?.nameisREPORTS_SPLIT_NAVIGATOR, so the guard is skipped and the existingREPORT_WITH_IDfallback still runs.What alternative solutions did you explore? (Optional)
openParentReportInCurrentTabfromDynamicReportDetailsPageand extend the inner branches to recognizeREPORT_DETAILSas the current RHP route — rejected because the branches at lines 146-221 are written aroundSEARCH_REPORT/SEARCH_MONEY_REQUEST_REPORTbeing the current/last route; covering the details-page case would require new conditions there anyway, spreading the fix across two files with no behavioral benefit over guarding the fallback directly.getReportRouteForCurrentContexthelper in the fallback — rejected because it only returnsSEARCH_REPORT(regular-width RHP), neverSEARCH_MONEY_REQUEST_REPORT(the super-wide modal the issue expects for an expense report), and it dropsreportActionID.MobileMage commentedon May 27, 2026
🚨 Edited by proposal-police: This proposal was edited at 2026-05-27 21:12:33 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
On Spend > Expenses, opening an expense (transaction) shows the transaction thread in a wide RHP, and clicking More > View details opens the Report Details panel. The "from " hyperlink shown beneath the transaction title in that panel should open the parent expense report inside the Spend super-wide modal, but instead it dismisses the entire Search context and jumps the user to the Inbox-based report screen.
What is the root cause of that problem?
The "report title hyperlink" is rendered by
ParentNavigationSubtitleinsideDynamicReportDetailsPage. When the user is onREPORT_DETAILS(caseIDMONEY_REQUEST— the transaction thread case), the page rendersnameSectionFurtherDetailsContent, which embedsParentNavigationSubtitlewithparentReportID={report?.parentReportID}(the parent here is the expense report). Crucially, theopenParentReportInCurrentTabprop is omitted — defaulting tofalseperParentNavigationSubtitle's destructured default at line 80.App/src/pages/DynamicReportDetailsPage.tsx
Lines 828 to 848 in 7001b0d
When the user clicks the link,
ParentNavigationSubtitle.onPressruns. Every Search-aware branch inonPressis gated behindopenParentReportInCurrentTab— theif (openParentReportInCurrentTab && isReportInRHP)block at line 144 (which is where the existingSEARCH_MONEY_REQUEST_REPORTrouting for the Search flow lives), and the broaderif (openParentReportInCurrentTab && currentFocusedNavigator?.name === NAVIGATORS.RIGHT_MODAL_NAVIGATOR)block at line 178. Because the prop defaults tofalsefromDynamicReportDetailsPage, all of those branches are skipped wholesale. Execution falls through to the unconditional inbox fallback at lines 242–246, which callsNavigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(parentReportID, ...))— andREPORT_WITH_IDresolves intoSCREENS.REPORTinside the Reports split navigator, which is precisely the Inbox flow. The Search RHP stack[SEARCH_REPORT (transaction thread), REPORT_DETAILS]gets dismissed and the user lands on Inbox.App/src/components/ParentNavigationSubtitle.tsx
Lines 242 to 246 in 7001b0d
A secondary gap exists even after we flip the prop on: the existing Search-aware sub-cases inside the
currentFocusedNavigator === RIGHT_MODAL_NAVIGATORblock don't model the "REPORT_DETAILS sitting on top of SEARCH_REPORT" stack.lastRouteisREPORT_DETAILS(notSEARCH_MONEY_REQUEST_REPORT), andpreviousRouteis theSEARCH_REPORTwhosereportIDis the transaction thread's ID — not the parent expense report'sparentReportID. So lines 180 and 189 both miss, theisReportInRHPcheck at line 218 misses (current route isREPORT_DETAILS, notSEARCH_REPORT), and we still fall through toREPORT_WITH_ID. The same gap explains the symmetric break for clicking the "from " link inside REPORT_DETAILS when it was opened from aSEARCH_MONEY_REQUEST_REPORTsuper-wide modal.What changes do you think we should make in order to solve the problem?
Two coordinated changes in
src/components/ParentNavigationSubtitle.tsxandsrc/pages/DynamicReportDetailsPage.tsx.First, opt
DynamicReportDetailsPageinto the Search-aware routing by passingopenParentReportInCurrentTabtoParentNavigationSubtitleinnameSectionFurtherDetailsContent. This is the analog of whatMoneyReportHeaderandMoneyRequestHeaderalready do viaHeaderWithBackButton(which forwards the same prop down toAvatarWithDisplayName→ParentNavigationSubtitle). REPORT_DETAILS is the only "expense detail" surface still missing that hookup, and itsentryScreenslist atROUTES.REPORT_DETAILSalready includesSCREENS.RIGHT_MODAL.SEARCH_REPORTandSCREENS.RIGHT_MODAL.SEARCH_MONEY_REQUEST_REPORT, so it's a first-class Search surface.Second, inside
ParentNavigationSubtitle.onPress, add a new sub-case to the existingif (openParentReportInCurrentTab && currentFocusedNavigator?.name === NAVIGATORS.RIGHT_MODAL_NAVIGATOR)block (line 178) that fires when the topmost full-screen route is the Search navigator. UsecurrentFullScreenRoute?.name === NAVIGATORS.SEARCH_FULLSCREEN_NAVIGATOR(already computed for the existing branch at line 146) as the Search detector — this is the same idiom thatMentionReportRendereralready relies on viaisSearchTopmostFullScreenRoute()to decide betweenROUTES.REPORT_WITH_IDandROUTES.SEARCH_REPORT. When the parent we're navigating to is a money request report (use the existingisMoneyRequestReport(report)helper —reportin this file is already the parent), route toROUTES.SEARCH_MONEY_REQUEST_REPORT.getRoute({reportID: parentReportID})to land in the super-wide modal; otherwise route toROUTES.SEARCH_REPORT.getRoute({reportID: parentReportID, reportActionID: ...})to stay in the wide RHP. Place the new check after the existinglastRoute === SEARCH_MONEY_REQUEST_REPORT/previousRoute === SEARCH_REPORTsub-cases so the duplicate-stack short-circuits (which callNavigation.goBack()) keep precedence and we never push a redundant RHP.App/src/components/ParentNavigationSubtitle.tsx
Lines 178 to 222 in 7001b0d
This fix preserves the well-tested Inbox path unchanged (the new branch only fires inside the Search full-screen navigator), reuses the existing
currentFullScreenRouteandisMoneyRequestReportplumbing, and naturally covers both the transaction-thread case (parent is an expense report → super-wide) and the expense-report case (parent is a policy expense chat → wide). It also avoids the trap in the alternative below of wideningisReportInRHPto includeSEARCH_MONEY_REQUEST_REPORT, which wouldn't help here becausecurrentRoute.nameat click time isREPORT_DETAILS, not the underlying RHP screen.What alternative solutions did you explore? (Optional)
We considered widening
isReportInRHPat line 107 to also matchSCREENS.RIGHT_MODAL.SEARCH_MONEY_REQUEST_REPORTandSCREENS.RIGHT_MODAL.EXPENSE_REPORT. That doesn't fix this bug becauseuseRoute()insideParentNavigationSubtitlerendered fromDynamicReportDetailsPagereturns theREPORT_DETAILSroute, not the RHP screen below it —isReportInRHPstaysfalseregardless. Another option was to swap the unconditional fallback at line 242 to consultisSearchTopmostFullScreenRoute()directly, but that would change behavior for every other caller ofParentNavigationSubtitle(HeaderView, ShareCodePage, etc.) at once, whereas gating the new branch onopenParentReportInCurrentTabkeeps the opt-in semantics consistent with the existing Search-aware paths.KJ21-ENG commentedon May 27, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue
From Spend > Expenses, opening an expense, choosing More > View details, and then clicking the report title opens the parent report through the normal Inbox report route. It should preserve the Spend/Search context and open the parent expense report in the Spend super-wide modal.
What is the root cause of that problem?
The More > View details action opens the shared report details RHP for the current expense/thread report:
src/components/MoneyRequestHeaderSecondaryActions.tsx:410-416src/components/MoneyReportHeaderActions/MoneyReportHeaderSecondaryActions.tsx:342-348src/libs/ReportUtils.ts:6144-6156On that details page, the report-title/from link is rendered by
ParentNavigationSubtitle, but this call does not passopenParentReportInCurrentTab:src/pages/DynamicReportDetailsPage.tsx:828-842That prop defaults to
falseinParentNavigationSubtitle:src/components/ParentNavigationSubtitle.tsx:74-80So the search-aware parent navigation blocks are skipped. Even if the prop is passed, the current search checks are still too narrow for this flow:
isReportInRHPonly checkscurrentRoute.name === SCREENS.RIGHT_MODAL.SEARCH_REPORT.lastRouteandpreviousRoute, so it misses a stack whereREPORT_DETAILSis on top ofSEARCH_REPORTorSEARCH_MONEY_REQUEST_REPORT.After those checks miss, the handler falls through to:
src/components/ParentNavigationSubtitle.tsx:242-245That fallback navigates to
ROUTES.REPORT_WITH_ID, which is the Inbox report route instead of the Spend/Search report route.What changes do you think we should make in order to solve the problem?
Make the details-page parent title opt into current-tab navigation, then make
ParentNavigationSubtitlerecognize Search context from the outer right-modal stack instead of only from the leaf route returned byuseRoute().Concretely:
In
DynamicReportDetailsPage, passopenParentReportInCurrentTabto theParentNavigationSubtitleused bynameSectionFurtherDetailsContentwhen the details page is shown over the Search fullscreen navigator. This mirrors the existing header behavior where parent links from Search RHPs preserve the current tab.In
ParentNavigationSubtitle, add a small helper around the existing root navigation state that treats the link as search-aware when:currentFullScreenRoute?.name === NAVIGATORS.SEARCH_FULLSCREEN_NAVIGATORcurrentFocusedNavigator?.name === NAVIGATORS.RIGHT_MODAL_NAVIGATORSEARCH_REPORTorSEARCH_MONEY_REQUEST_REPORT.For that search-aware details case:
SEARCH_MONEY_REQUEST_REPORTsuper-wide RHP is already in the right-modal stack, callNavigation.dismissToSuperWideRHP().ROUTES.SEARCH_MONEY_REQUEST_REPORT.getRoute({reportID: parentReportID}).ROUTES.SEARCH_REPORT.getRoute({reportID: parentReportID, reportActionID: ...}), while preserving the existing go-back short-circuit when the matching wide RHP is already underneath.ROUTES.REPORT_WITH_IDfallback unchanged for Inbox and other non-Search contexts.This keeps the fix in the shared parent-link navigation path, covers Report Details stacked over Spend/Search, and avoids changing normal Inbox report links.
What specific scenarios should we cover in automated tests?
Add focused coverage in
tests/ui/ParentNavigationSubtitleTest.tsxfor a Search fullscreen plus right-modal stack where Report Details is above a Search expense RHP.The key cases:
Stack:
SearchFullscreenNavigator -> RightModalNavigator -> SEARCH_REPORT -> REPORT_DETAILS. With a money-request parent report, pressingparent-navigation-subtitle-linkshould callNavigation.navigate(ROUTES.SEARCH_MONEY_REQUEST_REPORT.getRoute({reportID: parentReportID}))and must not navigate toROUTES.REPORT_WITH_ID.Stack:
SearchFullscreenNavigator -> RightModalNavigator -> SEARCH_MONEY_REQUEST_REPORT(parentReportID) -> SEARCH_REPORT -> REPORT_DETAILS. Pressing the link should callNavigation.dismissToSuperWideRHP()instead of pushing an Inbox route.A non-Search Report Details context should keep the current
ROUTES.REPORT_WITH_IDbehavior so the change does not redirect normal Inbox parent links into Search.What alternative solutions did you explore? (Optional)
Only passing
openParentReportInCurrentTabfromDynamicReportDetailsPageis not enough because the currentParentNavigationSubtitlechecks still do not recognize a details screen stacked on top of Search RHPs.Changing
getReportURLForCurrentContextwould not address this link path because this title click is handled byParentNavigationSubtitle.onPress, not by prebuilt report URLs. Making the finalREPORT_WITH_IDfallback globally context-aware would be broader than necessary and could change callers that intentionally do not opt into current-tab parent navigation.melvin-bot commentedon May 27, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @nyomanjyotisa (
External)[-]Report title link from Spend > Expenses opens Inbox instead of Spend super-wide modal[/-][+][$250] Report title link from Spend > Expenses opens Inbox instead of Spend super-wide modal[/+]melvin-bot commentedon May 27, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022059743597888896084
aswin-s commentedon May 27, 2026
Please re-state the problem that we are trying to solve in this issue.
On Web, when viewing an expense from Spend > Expenses and opening More > View details, clicking the report title/parent-report hyperlink opens the report on the Inbox page instead of in the super-wide modal on the Spend page. Expected: the link should keep the user in the Search/Spend context and open the report in the super-wide RHP.
What is the root cause of that problem?
The hyperlink is rendered by
ParentNavigationSubtitle. Its Search-context-preserving navigation branches (ParentNavigationSubtitle.tsx:144,:178) are gated on theopenParentReportInCurrentTabprop, which defaults tofalse(ParentNavigationSubtitle.tsx:80). The report-details "from" subtitle inDynamicReportDetailsPage.tsx(thenameSectionFurtherDetailsContentblock,DynamicReportDetailsPage.tsx:828) rendersParentNavigationSubtitlewithout passingopenParentReportInCurrentTab, so it staysfalse.However, even fixing the prop omission alone is not sufficient. When the user opens More > View details from the
SEARCH_MONEY_REQUEST_REPORTsuper-wide RHP, that "View details" screen is pushed on top ofSEARCH_MONEY_REQUEST_REPORTin the right-modal navigator stack. InsideParentNavigationSubtitle.onPress, two guards must both pass:isReportInRHP(currentRoute.name === SCREENS.RIGHT_MODAL.SEARCH_REPORT) — this isfalseon the details screen, so the first block at line 144 is skipped entirely.currentFocusedNavigator?.name === NAVIGATORS.RIGHT_MODAL_NAVIGATORand thenlastRoute?.name === SCREENS.RIGHT_MODAL.SEARCH_MONEY_REQUEST_REPORT. Because the details screen is itself the last route,lastRouteis notSEARCH_MONEY_REQUEST_REPORT— the check fails and execution falls through to the Inbox fallbackNavigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(...))atParentNavigationSubtitle.tsx:242-245.The combined root cause is: (a)
DynamicReportDetailsPagenever passesopenParentReportInCurrentTab, and (b)ParentNavigationSubtitle'sSEARCH_MONEY_REQUEST_REPORTbranch only inspectslastRouterather than scanning the full RHP stack, so a details screen pushed on top ofSEARCH_MONEY_REQUEST_REPORTbreaks the check.What changes do you think we should make in order to solve the problem?
Change 1 —
DynamicReportDetailsPage.tsx(around line 828–847): PassopenParentReportInCurrentTabtoParentNavigationSubtitle, computed from the current navigator context, mirroring howMoneyRequestHeader.tsx:95/172andHeaderView.tsx:107/349already supply it:Change 2 —
ParentNavigationSubtitle.tsx(around line 178): TheSEARCH_MONEY_REQUEST_REPORTguard currently checks onlylastRoute. When the user drills deeper (e.g. into a details screen), the last route is no longerSEARCH_MONEY_REQUEST_REPORT. The guard should scan the full RHP stack to detect whetherSEARCH_MONEY_REQUEST_REPORTis anywhere in the stack:Change 3 —
ReportDetailsPage.tsx(non-dynamic twin): Verify the sameopenParentReportInCurrentTabomission isn't present inReportDetailsPageand patch it identically so both report-details surfaces behave consistently on Web and native.Change 4 — Verify the end-to-end path for this repro: With both changes in place, the flow for this bug becomes: (a)
DynamicReportDetailsPagecomputesisInSearchContext = true(because the details screen sits inside theSEARCH_MONEY_REQUEST_REPORTRHP), (b)openParentReportInCurrentTabis nowtrue, (c) insideParentNavigationSubtitle.onPress, the stack scan findsSEARCH_MONEY_REQUEST_REPORTinrhpRoutesand navigates toROUTES.SEARCH_REPORT, keeping the user in the Spend tab.What alternative solutions did you explore? (Optional)
Make the
ParentNavigationSubtitleonPressfallback itself context-aware viagetReportRouteForCurrentContextinstead of relying on each caller to pass the prop; rejected as broader/riskier since several callers intentionally default it tofalse.github-actions commentedon May 27, 2026
52 remaining items
melvin-bot commentedon Jun 29, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)melvin-bot commentedon Jun 29, 2026
Payment Summary
Upwork Job
BugZero Checklist (@mallenexpensify)
nyomanjyotisa commentedon Jun 30, 2026
BugZero Checklist:
[Contributor] The offending PR and associated issue have been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
Link to the comment on the PR: N/A. No offending PR found
Link to the comment on the Issue: N/A
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion: N/A
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue: https://github.com/Expensify/Expensify/issues/655591
Regression Test Proposal
Precondition:
Test:
Do we agree 👍 or 👎
Zapier Logs
Run ID: 00040eee-273c-ad6a-9960-9564b034d6f4mallenexpensify commentedon Jul 2, 2026
Payment Summary
Contributor: @nkdengineer due $250 via NewDot
Contributor+: @nyomanjyotisa due $250 via NewDot
^ Test case created. Thx
trjExpensify commentedon Jul 6, 2026
approved $250 for @nyomanjyotisa
twisterdotcom commentedon Jul 15, 2026
$250 approved for @nkdengineer in Report ID: R00JRhw1xXfR.
Zapier Logs
Run ID: 00040eee-e87c-ad47-9591-8fd20d79d704SO: https://stackoverflowteams.com/c/expensify/questions/7582