Skip to content

[Due for payment 2025-05-14] [$250] Expense - Context menu does not open when long pressing on expense preview in self DM #60808

Closed

Description

@nlemma

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.1.32-0
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: No, reproducible on hybrid only
If this was caught during regression testing, add the test name, ID and link from TestRail: Exp
Email or phone of affected tester (no customers): applausetester+240413kh@applause.expensifail.com
Issue reported by: Applause Internal Team
Device used: Samsung Galaxy Z Fold 4 / Android 14
App Component: Money Requests

Action Performed:

Precondition:

  • Log in with Expensifail account.
  1. Launch Expensify app.
  2. Go to self DM.
  3. Submit a manual expense in self DM.
  4. Long press on the expense preview.
  5. Long press outside the expense preview on the same message row.

Expected Result:

When long pressing on the expense preview (Step 4), context menu will open.

Actual Result:

When long pressing on the expense preview (Step 4), context menu does not open.
When long pressing outside the expense preview on the same message row (Step 5), context menu opens.

Workaround:

Unknown

Platforms:

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6811462_1745486878344.Screen_Recording_20250424_172037_Expensify.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021917072697446104109
  • Upwork Job ID: 1917072697446104109
  • Last Price Increase: 2025-04-29
Issue OwnerCurrent Issue Owner: @miljakljajic

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Apr 24, 2025
  2. melvin-bot commented on Apr 24, 2025

    @melvin-bot

    Triggered auto assignment to @stephanieelliott (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. bernhardoj commented on Apr 24, 2025

    @bernhardoj
    Contributor

    🚨 Edited by proposal-police: This proposal was edited at 2025-04-30 14:18:20 UTC.

    Proposal

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

    Context menu doesn't show when long press self DM track expense.

    What is the root cause of that problem?

    It's a common problem on native where a nested pressable onLongPress is not propagated properly. That's why we attach the long-press callback to the preview.

    However, shouldDisplayContextMenu is undefined, so the context menu never shows.

    const showContextMenu = (event: GestureResponderEvent) => {
    if (!shouldDisplayContextMenu) {
    return;
    }
    showContextMenuForReport(event, contextMenuAnchor, reportID, action, checkIfContextMenuActive);
    };

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

    Pass the shouldDisplayContextMenu props.

    <TransactionPreview
    iouReportID={getIOUReportIDFromReportActionPreview(action)}
    chatReportID={reportID}
    reportID={reportID}
    action={action}
    isBillSplit={isSplitBillActionReportActionsUtils(action)}
    transactionID={isSplitInGroupChat ? moneyRequestOriginalMessage?.IOUTransactionID : undefined}
    containerStyles={[shouldUseNarrowLayout ? {...styles.w100, ...styles.mw100} : reportPreviewStyles.transactionPreviewStyle, styles.mt1]}
    transactionPreviewWidth={shouldUseNarrowLayout ? styles.w100.width : reportPreviewStyles.transactionPreviewStyle.width}
    onPreviewPressed={() => {
    if (isSplitInGroupChat) {
    Navigation.navigate(ROUTES.SPLIT_BILL_DETAILS.getRoute(chatReportID, action.reportActionID, Navigation.getReportRHPActiveRoute()));
    return;
    }
    if (!action.childReportID) {
    return;
    }
    Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(action.childReportID));
    }}
    isTrackExpense={isTrackExpenseActionReportActionsUtils(action)}
    />

    shouldDisplayContextMenu={shouldDisplayContextMenu}
    

    What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

    When creating the test for this, I found that it behaves differently when running on the test environment. The issue we have here is basically if we have nested pressable, then only the inner pressable will receive the press/long-press event (which was observed first in this #12987).

    But when I recreate this on the test environment as simple as this:

    render(
    <Pressable onLongPress={() => console.log('outer')}>

        </Pressable>
    </Pressable>
    

    )
    fireEvent(await screen.findByTestId('test'), 'longPress');
    the outer pressable long press is triggered just fine. So, the unit test can't cover this case.

  4. melvin-bot commented on Apr 28, 2025

    @melvin-bot

    @stephanieelliott Whoops! This issue is 2 days overdue. Let's get this updated quick!

  5. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Apr 29, 2025
  6. melvin-bot commented on Apr 29, 2025

    @melvin-bot
  7. changed the title [-]Expense - Context menu does not open when long pressing on expense preview in self DM[/-] [+][$250] Expense - Context menu does not open when long pressing on expense preview in self DM[/+] on Apr 29, 2025
  8. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Apr 29, 2025
  9. melvin-bot commented on Apr 29, 2025

    @melvin-bot

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

  10. hoangzinh commented on Apr 30, 2025

    @hoangzinh
    Contributor

    @bernhardoj, your proposal looks good. Btw, can you update the automation test section please? Please avoid "N/A"

  11. 26 remaining items

  12. melvin-bot commented on May 7, 2025

    @melvin-bot

    Reviewing label has been removed, please complete the "BugZero Checklist".

  13. melvin-bot commented on May 7, 2025

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.40-7 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

    If no regressions arise, payment will be issued on 2025-05-14. 🎊

    For reference, here are some details about the assignees on this issue:

    • @hoangzinh requires payment through NewDot Manual Requests
    • @bernhardoj requires payment through NewDot Manual Requests
  14. melvin-bot commented on May 7, 2025

    @melvin-bot

    @hoangzinh @miljakljajic @hoangzinh The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

  15. melvin-bot commented on May 14, 2025

    @melvin-bot

    Payment Summary

    Upwork Job

    BugZero Checklist (@miljakljajic)

    • 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/1917072697446104109/hired)
    • I have paid out the Upwork contracts or cancelled the ones that are incorrect
    • I have verified the payment summary above is correct
  16. hoangzinh commented on May 14, 2025

    @hoangzinh
    Contributor

    BugZero Checklist:

    • [Contributor] Classify the bug:
    Bug classification

    Source of bug:

    • 1a. Result of the original design (eg. a case wasn't considered)
    • 1b. Mistake during implementation
    • 1c. Backend bug
    • 1z. Other:

    Where bug was reported:

    • 2a. Reported on production (eg. bug slipped through the normal regression and PR testing process on staging)
    • 2b. Reported on staging (eg. found during regression or PR testing)
    • 2d. Reported on a PR
    • 2z. Other:

    Who reported the bug:

    • 3a. Expensify user
    • 3b. Expensify employee
    • 3c. Contributor
    • 3d. QA
    • 3z. Other:
    • [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: https://github.com/Expensify/App/pull/59811/files#r2089757312

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

    Regression Test Proposal

    Precondition:

    • Sign in to an account having self DM

    Test:

    1. Go to self DM.
    2. Submit a manual expense in self DM.
    3. Right-click or long-press on the expense preview.
    4. Verify a context menu will show

    Do we agree 👍 or 👎

  17. hoangzinh commented on May 14, 2025

    @hoangzinh
    Contributor

    Requested payment in ND

  18. bernhardoj commented on May 15, 2025

    @bernhardoj
    Contributor

    Requested in ND.

  19. garrettmknight commented on May 19, 2025

    @garrettmknight
    Contributor

    $250 approved for @hoangzinh

  20. JmillsExpensify commented on May 29, 2025

    @JmillsExpensify
    Contributor

    $250 approved for @bernhardoj

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

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions