Skip to content

[Due for Payment 2/12/2026] [$250] Reports - Selection mode is displayed, but report not selected, after creating new report #79636

Closed

Description

@mitarachim

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.2.1
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from BrowserStack: #75261
Email or phone of affected tester (no customers): ibellicotest+2250@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Motorola MotoG60 / Android 12 (Hybrid app)
App Component: Search

Action Performed:

Prerequisite: Account has at least one workspace.

  1. Open the Expensify app.
  2. Open any workspace chat.
  3. Create a manual expense.
  4. Navigate to "Reports" > "Reports"
  5. Select the just created expense.
  6. Tap on "Create" button and create an empty report.
  7. Tap on the back button on the top left corner to return to "Reports"
  8. Long tap and select the report with the expense created on step 3 again.
  9. Note that selection mode is displayed, but expense is not selected.

Expected Result:

After selecting a report while on "Reports", selection mode should be displayed with a "1 selected" message and the report should be seen automatically selected.

Actual Result:

When selecting a report with an expense while on "Reports" section, after adding a new report, selection mode is displayed, but report is not selected and a "0 selected" message can be seen on dropdown menu.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7049621_1768446805134.Not_Selected.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
Issue Owner

Current Issue Owner: @deetergp

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jan 15, 2026
  2. melvin-bot commented on Jan 15, 2026

    @melvin-bot

    Triggered auto assignment to @CortneyOfstad (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

  3. daledah commented on Jan 15, 2026

    @daledah
    Contributor

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    When a user creates an empty report, goes back to the Reports list, and long-presses a report to select it, the selection mode is displayed but shows "0 selected" instead of "1 selected". The report is not actually selected.

    What is the root cause of that problem?

    The root cause is that selectedTransactions is not being cleared when the user navigates away from the Reports list to create a new report.

    currentUserPersonalDetails,
    hasViolations,
    isASAPSubmitBetaEnabled,
    defaultChatEnabledPolicy,
    false,
    shouldDismissEmptyReportsConfirmation,
    );
    Navigation.setNavigationActionToMicrotaskQueue(() => {
    Navigation.navigate(
    isSearchTopmostFullScreenRoute()
    ? ROUTES.SEARCH_MONEY_REQUEST_REPORT.getRoute({reportID: createdReportID, backTo: Navigation.getActiveRoute()})
    : ROUTES.REPORT_WITH_ID.getRoute(createdReportID, undefined, undefined, Navigation.getActiveRoute()),
    {forceReplace: isReportInSearch},
    );
    });
    },
    [currentUserPersonalDetails, hasViolations, defaultChatEnabledPolicy, isASAPSubmitBetaEnabled, isReportInSearch],

    The issue occurs because:

    1. User selects a report → the report is added to selectedTransactions
    2. User taps "Create" button to create a new report → navigates away but selectedTransactions is NOT cleared
    3. User comes back to the Reports list → previous selection is still in selectedTransactions
    4. User long-presses the SAME report → toggleTransaction is called which TOGGLES the selection OFF (because it was already selected)
    5. Result: "0 selected" because the item was toggled off instead of staying selected

    If the user long-presses a DIFFERENT report, it shows "2 selected" (the old selection + new one), which confirms the selections are not being cleared.

    What changes do you think we should make in order to solve the problem?

    Call clearSelectedTransactions() when navigating away to create a new report in FloatingActionButtonAndPopover.tsx:

    // src/pages/home/sidebar/FloatingActionButtonAndPopover.tsx
    
    const handleCreateWorkspaceReport = useCallback(
        (shouldDismissEmptyReportsConfirmation = false) => {
            // ... existing code ...
            clearSelectedTransactions();
            
            Navigation.setNavigationActionToMicrotaskQueue(() => {
                Navigation.navigate(
                    // ... navigation logic ...
                );
            });
        },
        [currentUserPersonalDetails, hasViolations, defaultChatEnabledPolicy, isASAPSubmitBetaEnabled, isReportInSearch, clearSelectedTransactions],
    );

    This ensures that when the user creates a new report and navigates away, any previous selections are cleared, so when they return and long-press a report, it will be properly selected as a fresh selection.

    Note: Alternatively, we can clear the selected transaction elsewhere (for example, within the createNewReport function).

    What alternative solutions did you explore? (Optional)

  4. nkdengineer commented on Jan 15, 2026

    @nkdengineer
    Contributor

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    When selecting a report with an expense while on "Reports" section, after adding a new report, selection mode is displayed, but report is not selected and a "0 selected" message can be seen on dropdown menu.

    What is the root cause of that problem?

    When we navigate to the money request report page, the selection mode is turned off, but the selected transaction isn't cleared. Then it's unselected when we enable the selection mode again.

    turnOffMobileSelectionMode();

    turnOffMobileSelectionMode();

    What changes do you think we should make in order to solve the problem?

    Because the selection can be turned off in other pages, we can define onTurnOffSelectionMode callback in useMobileSelectionMode hook to clear the selected transactions when the selection is turned off. This approach ensures the selected transaction is always cleared whenever the selection mode is off.

    export default function useMobileSelectionMode(onTurnOffSelectionMode = () => {}) {
        const [isSelectionModeEnabled = false] = useOnyx(ONYXKEYS.MOBILE_SELECTION_MODE, {initWithStoredValues: false, canBeMissing: true});
        const initialSelectionModeValueRef = useRef(isSelectionModeEnabled);
        const prevIsSelectionModeEnabled = usePrevious(isSelectionModeEnabled);
        
        useEffect(() => {
            // in case the selection mode is already off at the start, we don't need to turn it off again
            if (!initialSelectionModeValueRef.current) {
                return;
            }
            turnOffMobileSelectionMode();
        }, []);
    
        useEffect(() => {
            if (!prevIsSelectionModeEnabled || isSelectionModeEnabled) {
                return;
            }
            onTurnOffSelectionMode();
        }, [prevIsSelectionModeEnabled, isSelectionModeEnabled, onTurnOffSelectionMode]);
    
        return !!isSelectionModeEnabled;
    }
    

    export default function useMobileSelectionMode() {

    const isMobileSelectionModeEnabled = useMobileSelectionMode(clearSelectedTransactions);
    

    const isMobileSelectionModeEnabled = useMobileSelectionMode();

    What alternative solutions did you explore? (Optional)

    We can create an useEffect on SearchPage to clear the selected transactions when the selection mode is turned off.

    Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

  5. CortneyOfstad commented on Jan 19, 2026

    @CortneyOfstad
    Contributor

    Getting eyes on this!

  6. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Jan 19, 2026
  7. changed the title [-]Reports - Selection mode is displayed, but report not selected, after creating new report[/-] [+][$250] Reports - Selection mode is displayed, but report not selected, after creating new report[/+] on Jan 19, 2026
  8. melvin-bot commented on Jan 19, 2026

    @melvin-bot
  9. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Jan 19, 2026
  10. melvin-bot commented on Jan 19, 2026

    @melvin-bot

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

  11. 13 remaining items

  12. CortneyOfstad commented on Feb 12, 2026

    @CortneyOfstad
    Contributor

    PR went to production, but automation did not run for payment — sorry about that!

  13. added
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed
    ReviewingHas a PR in review
    on Feb 12, 2026
  14. CortneyOfstad commented on Feb 12, 2026

    @CortneyOfstad
    Contributor

    @truph01 can you complete the checklist ASAP? Thank you!

  15. changed the title [-][$250] Reports - Selection mode is displayed, but report not selected, after creating new report[/-] [+][Due for Payment 2/12/2026] [$250] Reports - Selection mode is displayed, but report not selected, after creating new report[/+] on Feb 12, 2026
  16. truph01 commented on Feb 12, 2026

    @truph01
    Contributor

    BugZero Checklist:

    • [Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.

      Link to comment:

    • [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:

    • [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:

    Regression Test Proposal

    Precondition:

    Test:

    Prerequisite: Account has at least one workspace.

    1. Open any workspace chat.
    2. Create a manual expense.
    3. Navigate to "Reports" > "Reports"
    4. Select the just created expense.
    5. Tap on "Create" button and create an empty report.
    6. Tap on the back button on the top left corner to return to "Reports"
    7. Long tap and select the report with the expense created on step 3 again.
    8. Verify that the selection mode is displayed and the expense is selected.

    Do we agree 👍 or 👎

  17. deetergp commented on Feb 12, 2026

    @deetergp
    Contributor

    Checklist looks right to me 👍

  18. CortneyOfstad commented on Feb 13, 2026

    @CortneyOfstad
    Contributor

    Payment Summary

    @nkdengineer — to be paid $250 via NewDot
    @truph01 — to be paid $250 via NewDot

    Regression Test

    https://github.com/Expensify/Expensify/issues/600162

  19. twisterdotcom commented on Feb 25, 2026

    @twisterdotcom
    Contributor

    @nkdengineer has submitted payment for this report on ND here.

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

    Zapier Logs Run ID: 00040eee-34a3-ab46-98e2-303772bd4554
  20. JmillsExpensify commented on Apr 5, 2026

    @JmillsExpensify
    Contributor

    $250 approved for @truph01

  21. deltaexecutor123 commented on May 3, 2026

    @deltaexecutor123
  22. melvin-bot commented on May 3, 2026

    @melvin-bot
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.ExternalAdded to denote the issue can be worked on by a contributorWeeklyKSv2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions