Skip to content

[Due for payment 2026-06-30] [$250] Report title link from Spend > Expenses opens Inbox instead of Spend super-wide modal #91889

Closed

Description

@m-natarajan

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


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

Action Performed:

  1. Login to Expensify
  2. Navigate to Spend > Expenses
  3. Open any expense
  4. Click More > View details
  5. Click the report title hyperlink

Expected Result:

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:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari

Screenshots/Videos

Recording.2902.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
Issue OwnerCurrent Issue Owner: @mallenexpensify

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on May 27, 2026
  2. MelvinBot commented on May 27, 2026

    @MelvinBot
    Contributor

    Proposal

    What is the root cause of that problem?

    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:

    1. 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.

    2. 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.

  3. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on May 27, 2026
  4. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on May 27, 2026
  5. yusufdeveloper2903 commented on May 27, 2026

    @yusufdeveloper2903
    Contributor

    🚨 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):

    titleComponent={
    <ParentNavigationSubtitle
    parentNavigationSubtitleData={parentNavigationSubtitleData}
    reportID={report?.reportID}
    parentReportID={report?.parentReportID}
    parentReportActionID={report?.parentReportActionID}
    pressableStyles={[styles.mt1, styles.mw100]}
    textStyles={[styles.popoverMenuText, styles.flexShrink1, styles.preWrap, styles.mw100]}
    subtitleNumberOfLines={2}
    shouldShowFromPrefix={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:

    if (isVisibleAction) {
    Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(parentReportID, parentReportActionID));
    } else {
    Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(parentReportID));
    }

    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.
  6. MobileMage commented on May 27, 2026

    @MobileMage
    Contributor

    🚨 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.

    const nameSectionFurtherDetailsContent = (
    <MenuItemWithTopDescription
    shouldShowRightIcon={false}
    interactive={false}
    titleComponent={
    <ParentNavigationSubtitle
    parentNavigationSubtitleData={parentNavigationSubtitleData}
    reportID={report?.reportID}
    parentReportID={report?.parentReportID}
    parentReportActionID={report?.parentReportActionID}
    pressableStyles={[styles.mt1, styles.mw100]}
    textStyles={[styles.popoverMenuText, styles.flexShrink1, styles.preWrap, styles.mw100]}
    subtitleNumberOfLines={2}
    shouldShowFromPrefix={false}
    />
    }
    description={translate('threads.from')}
    descriptionTextStyle={[styles.mutedNormalTextLabel, styles.mb1]}
    shouldCheckActionAllowedOnPress={false}
    />
    );

    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.

    if (isVisibleAction) {
    Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(parentReportID, parentReportActionID));
    } else {
    Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(parentReportID));
    }

    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.

    if (openParentReportInCurrentTab && currentFocusedNavigator?.name === NAVIGATORS.RIGHT_MODAL_NAVIGATOR) {
    const lastRoute = 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;
    }
    // Specific case: when opening expense report from search report (chat RHP),
    // avoid stacking RHPs by going back to the search report if it's already there
    const previousRoute = currentFocusedNavigator?.state?.routes.at(-2);
    if (previousRoute?.name === SCREENS.RIGHT_MODAL.SEARCH_REPORT && previousRoute.params && 'reportID' in previousRoute.params) {
    const reportIDFromParams = previousRoute.params.reportID;
    if (reportIDFromParams === parentReportID) {
    Navigation.goBack();
    return;
    }
    }
    // When the parent report is already the topmost route in the tab underneath the RHP,
    // update its reportActionID and dismiss the modal instead of pushing a new instance
    // on top of the tab navigator.
    if (currentFullScreenRoute?.name === NAVIGATORS.REPORTS_SPLIT_NAVIGATOR) {
    const fullScreenState = currentFullScreenRoute.state;
    const topRoute = fullScreenState?.routes?.[fullScreenState.index ?? 0];
    const topRouteReportID = topRoute?.params && 'reportID' in topRoute.params ? String(topRoute.params.reportID) : undefined;
    if (topRouteReportID === parentReportID && topRoute?.key && fullScreenState?.key) {
    if (isVisibleAction && parentReportActionID) {
    Navigation.setParams({reportActionID: parentReportActionID}, topRoute.key, fullScreenState.key);
    }
    Navigation.dismissModal();
    return;
    }
    }
    // Stay in the Search tab when the parent link is tapped from a SEARCH_REPORT RHP
    // and the parent isn't already in the stack — otherwise the REPORT_WITH_ID fallback
    // would yank the user to Inbox.
    if (isReportInRHP) {
    Navigation.navigate(ROUTES.SEARCH_REPORT.getRoute({reportID: parentReportID, reportActionID: isVisibleAction ? parentReportActionID : undefined}));
    return;
    }
    }

    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.

  7. KJ21-ENG commented on May 27, 2026

    @KJ21-ENG
    Contributor

    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-416
    • src/components/MoneyReportHeaderActions/MoneyReportHeaderSecondaryActions.tsx:342-348
    • src/libs/ReportUtils.ts:6144-6156

    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:

    • src/components/ParentNavigationSubtitle.tsx:242-245

    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:

    1. 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.

    2. 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_NAVIGATOR
      • currentFocusedNavigator?.name === NAVIGATORS.RIGHT_MODAL_NAVIGATOR
      • the right-modal stack contains a Search report route underneath the active details route, such as SEARCH_REPORT or SEARCH_MONEY_REQUEST_REPORT.
    3. 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:

    1. 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.

    2. 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.

    3. 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.

  8. melvin-bot commented on May 27, 2026

    @melvin-bot

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @nyomanjyotisa (External)

  9. 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
  10. melvin-bot commented on May 27, 2026

    @melvin-bot
  11. aswin-s commented on May 27, 2026

    @aswin-s
    Contributor

    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:

    1. 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.
    2. 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:

    // DynamicReportDetailsPage.tsx  ~line 828
    const currentRoute = useRoute();
    const isInSearchContext =
        isSearchTopmostFullScreenRoute() ||
        currentRoute.name === SCREENS.RIGHT_MODAL.SEARCH_REPORT ||
        currentRoute.name === SCREENS.RIGHT_MODAL.SEARCH_MONEY_REQUEST_REPORT;
    
    // ...in nameSectionFurtherDetailsContent:
    <ParentNavigationSubtitle
        openParentReportInCurrentTab={isInSearchContext}
        // ...other existing props
    />

    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):
    const lastRoute = 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):
    const rhpRoutes = currentFocusedNavigator?.state?.routes ?? [];
    const hasMoneyRequestReportInStack = 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 ParentNavigationSubtitle onPress 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.

  12. github-actions commented on May 27, 2026

    @github-actions
    Contributor

    ⚠️ @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).

  13. 52 remaining items

  14. melvin-bot commented on Jun 29, 2026

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  15. melvin-bot commented on Jun 29, 2026

    @melvin-bot

    Payment Summary

    Upwork Job

    BugZero Checklist (@mallenexpensify)

    • I have verified the correct assignees and roles are listed above and updated the necessary manual offers
    • I have verified that there are no duplicate or incorrect contracts on Upwork for this job (https://www.upwork.com/ab/applicants/2059743597888896084/hired)
    • I have verified the PR was not reverted
    • I have applied any discounts due to bugs/regressions introduced by this PR
    • I have paid out the Upwork contracts or cancelled the ones that are incorrect
    • I have verified the payment summary above is correct
  16. nyomanjyotisa commented on Jun 30, 2026

    @nyomanjyotisa
    Member

    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:

    • Create an expense report with some expenses

    Test:

    1. Navigate to Spend > Expenses
    2. Open any expense in the report created above
    3. Click More > View details
    4. Click the report title hyperlink
    5. Verify that we go back to the super wider RHP expense report

    Do we agree 👍 or 👎

    Zapier Logs Run ID: 00040eee-273c-ad6a-9960-9564b034d6f4
  17. mallenexpensify commented on Jul 2, 2026

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor: @nkdengineer due $250 via NewDot
    Contributor+: @nyomanjyotisa due $250 via NewDot

    ^ Test case created. Thx

  18. moved this from MEDIUM or LOW to Done in [#whatsnext] #migrateon Jul 2, 2026
  19. trjExpensify commented on Jul 6, 2026

    @trjExpensify
    Contributor

    approved $250 for @nyomanjyotisa

  20. twisterdotcom commented on Jul 15, 2026

    @twisterdotcom
    Contributor

    $250 approved for @nkdengineer in Report ID: R00JRhw1xXfR.

    Zapier Logs Run ID: 00040eee-e87c-ad47-9591-8fd20d79d704

    SO: https://stackoverflowteams.com/c/expensify/questions/7582

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions