Skip to content

[Due for payment 2026-09-22] Navigating to the expense of a single-expense report should redirect to the single-expense report view #99356

Closed

Description

@melvin-bot

Problem
When navigating to the expense of a single-expense report, the user should be redirected to the single-expense report view instead of the standalone expense view.

Expected Result
Navigating to the expense of a single-expense report redirects to the single-expense report view.

Actual Result
The user lands on the standalone expense view rather than the single-expense report view.

Platform: All

Reported in Slack.

Issue OwnerCurrent Issue Owner: @mallenexpensify

Activity

  1. aimane-chnaif commented on Aug 29, 2026

    @aimane-chnaif
    Contributor

    @MelvinBot implement this

  2. MelvinBot commented on Aug 29, 2026

    @MelvinBot
    Contributor

    🤖 Draft PR created: #99811

    Please mark it as "Ready for review" when it is ready for review.

    What I changed: a report holding exactly one expense already renders that expense inline, so the expense's own transaction thread is a duplicate of the report. I added OneTransactionThreadRedirectHandler, a render-nothing handler mounted in ReportScreen, that replaces the route with the report whenever a route lands on that thread. Search already applied this rule at its own call sites; this is the route-level backstop for deep links, notifications, stale history entries, and any other navigation that resolved the IOU action's childReportID without checking the transaction count.

    Details and deliberate carve-outs

    The redirect does not fire when:

    • a reportActionID is in the route — that deep link points at a specific message, and replacing the route would drop its anchor;
    • the parent action is a "send money" action — isOneTransactionThread excludes those too;
    • the parent report's transactionCount is not 1 — the action-based derivation reads whatever report actions are in Onyx, so a multi-expense report still paginating in could otherwise look like a single-expense one for a moment.

    It uses forceReplace rather than a push so back navigation doesn't return to the thread, and reuses the route's own backTo for the same reason. In the Search RHP it rebuilds the SEARCH_REPORT route so the report stays in the RHP.

    Files:

    AI tests run locally:

    Check Result
    npm run typecheck pass
    npm run lint-changed pass
    npm run spell-changed pass
    npm run react-compiler-compliance-check pass
    npm test tests/navigation tests/ui/MoneyReportViewTest tests/ui/PaginationTest pass (557 tests)
    npm test tests/navigation/OneTransactionThreadRedirectHandlerTest.tsx pass (8 tests)

    Browser verification did not run. The prestarted web session handed to the tester was already dead — a blank page with zero accessibility nodes and no network activity, and the prestart screenshot shows sign-in never got past the "Join" screen. The dev server itself built cleanly, including both changed files, so this is a session/infra failure rather than a problem with the change. The four manual steps I wanted to confirm are written out in the PR's Tests section for you to run.


    view run

  3. melvin-bot commented on Sep 13, 2026

    @melvin-bot
    Author

    Unable to auto-create job on Upwork. The BZ team member should create it manually for this issue.

  4. melvin-bot commented on Sep 13, 2026

    @melvin-bot
    Author

    Triggered auto assignment to @blimpich, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

  5. melvin-bot commented on Sep 13, 2026

    @melvin-bot
    Author

    Unable to auto-create job on Upwork. The BZ team member should create it manually for this issue.

  6. changed the title [-]Navigating to the expense of a single-expense report should redirect to the single-expense report view[/-] [+][Due for payment 2026-09-22] Navigating to the expense of a single-expense report should redirect to the single-expense report view[/+] on Sep 15, 2026
  7. 4 remaining items

  8. added
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed on Sep 17, 2026
  9. melvin-bot commented on Sep 21, 2026

    @melvin-bot
    Author

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  10. melvin-bot commented on Sep 21, 2026

    @melvin-bot
    Author

    Payment Summary

    Resolving PRs:

    BugZero Checklist (@mallenexpensify)

    • I have confirmed assignees, roles, and Upwork contracts look correct
    • I have paid out Upwork contracts / manual NewDot requests
    • [BugZero Assignee] I have created a GH issue for creating/updating the regression test once above steps have been agreed upon
  11. mallenexpensify commented on Sep 24, 2026

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor+: @aimane-chnaif due $250 via NewDot

  12. garrettmknight commented on Oct 12, 2026

    @garrettmknight
    Contributor

    $250 approved for @aimane-chnaif

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 productionDailyKSv2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions