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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
2 of 8 tasks
nlemma opened this issue Apr 24, 2025 · 24 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor

Comments

@nlemma
Copy link

nlemma commented Apr 24, 2025

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] 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): [email protected]
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
@nlemma nlemma added Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 labels Apr 24, 2025
Copy link

melvin-bot bot commented Apr 24, 2025

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.

@bernhardoj
Copy link
Contributor

bernhardoj commented Apr 24, 2025

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

Copy link

melvin-bot bot commented Apr 28, 2025

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

@stephanieelliott stephanieelliott added the External Added to denote the issue can be worked on by a contributor label Apr 29, 2025
Copy link

melvin-bot bot commented Apr 29, 2025

Job added to Upwork: https://www.upwork.com/jobs/~021917072697446104109

@melvin-bot melvin-bot bot 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 Apr 29, 2025
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Apr 29, 2025
Copy link

melvin-bot bot commented Apr 29, 2025

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

@melvin-bot melvin-bot bot removed the Overdue label Apr 29, 2025
@hoangzinh
Copy link
Contributor

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

@bernhardoj
Copy link
Contributor

Updated that section (I copied it from my another proposal which has the same root cause)

@hoangzinh
Copy link
Contributor

@bernhardoj's proposal looks good to me

Link to proposal #60808 (comment)

🎀👀🎀 C+ reviewed

Copy link

melvin-bot bot commented Apr 30, 2025

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

@lakchote
Copy link
Contributor

lakchote commented May 1, 2025

@bernhardoj's proposal LGTM.

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label May 1, 2025
@bernhardoj
Copy link
Contributor

Hmm, I keep getting several errors after merging with main

Image

@lakchote
Copy link
Contributor

lakchote commented May 2, 2025

Hmm, I keep getting several errors after merging with main

Do you still get them after merging latest main @bernhardoj? If so, I'd open up a discussion in #expensify-open-source

@bernhardoj
Copy link
Contributor

Not anymore. Preparing the PR.

@bernhardoj
Copy link
Contributor

PR is ready

cc: @hoangzinh

@melvin-bot melvin-bot bot removed the Daily KSv2 label May 2, 2025
@melvin-bot melvin-bot bot added the Weekly KSv2 label May 2, 2025
@stephanieelliott
Copy link
Contributor

Reapplying the Bug label to get another BZ member on this as I am OOO til May 19. 

Status: The PR hit staging yesterday, not much to do here til we're ready to issue payment!

@stephanieelliott stephanieelliott removed the Bug Something is broken. Auto assigns a BugZero manager. label May 6, 2025
@stephanieelliott stephanieelliott removed their assignment May 6, 2025
@stephanieelliott stephanieelliott added the Bug Something is broken. Auto assigns a BugZero manager. label May 6, 2025
Copy link

melvin-bot bot commented May 6, 2025

Triggered auto assignment to @miljakljajic (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.

@melvin-bot melvin-bot bot added Daily KSv2 Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 Daily KSv2 labels May 6, 2025
@melvin-bot melvin-bot bot changed the title [$250] Expense - Context menu does not open when long pressing on expense preview in self DM [Due for payment 2025-05-14] [$250] Expense - Context menu does not open when long pressing on expense preview in self DM May 7, 2025
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label May 7, 2025
Copy link

melvin-bot bot commented May 7, 2025

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

Copy link

melvin-bot bot commented May 7, 2025

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

Copy link

melvin-bot bot commented May 7, 2025

@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]

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels May 13, 2025
Copy link

melvin-bot bot commented May 14, 2025

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

@hoangzinh
Copy link
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 👎

@hoangzinh
Copy link
Contributor

Requested payment in ND

@bernhardoj
Copy link
Contributor

Requested in ND.

@garrettmknight
Copy link
Contributor

$250 approved for @hoangzinh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

7 participants