Skip to content
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

[HOLD for payment 2023-07-21] [$1000] Long Pressing on reply opens the context menu for the ReportPreview action. #21292

Closed
1 of 6 tasks
kavimuru opened this issue Jun 22, 2023 · 43 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 Engineering External Added to denote the issue can be worked on by a contributor

Comments

@kavimuru
Copy link

kavimuru commented Jun 22, 2023

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


Action Performed:

  1. Open a DM with any user.
  2. Send a Money request.
  3. Long Press on the reply 1 on the preview of money request in the DM.
  4. Observe the behaviour.

Expected Result:

It should not open the context menu on the IOU Preview like other platforms.

Actual Result:

It opens the context menu on Android chrome but other platforms does not open it.

Workaround:

Can the user still use Expensify without this being fixed? Have you informed them of the workaround?

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: 1.3.30-5
Reproducible in staging?: y
Reproducible in production?: y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation

Screen.Recording.2023-06-15.at.6.37.45.PM.mov
az_recorder_20230621_223902.1.mp4

Expensify/Expensify Issue URL:
Issue reported by: @parasharrajat
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1686834876030139

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0164ddcb49f1eae0da
  • Upwork Job ID: 1672146114797383680
  • Last Price Increase: 2023-07-07
@kavimuru kavimuru added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jun 22, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 22, 2023

Triggered auto assignment to @bfitzexpensify (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@melvin-bot
Copy link

melvin-bot bot commented Jun 22, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

@hungvu193
Copy link
Contributor

hungvu193 commented Jun 22, 2023

Proposal

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

Long Pressing on reply opens the context menu for the ReportPreview action.

What is the root cause of that problem?

Problem came from here:

<PressableWithoutFeedback
onPress={() => {
Report.navigateToAndOpenChildReport(props.childReportID);
}}
accessibilityRole="button"
accessibilityLabel={`${props.numberOfReplies} ${replyText}`}
>

We didn't implement the onLongPress for PressableWithoutFeedback yet, so when we long pressed, it will open the ContextMenu.

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

We should add the onLongPress={() => {}} here.

            <PressableWithoutFeedback
                onLongPress={() => {}}
                onPress={() => {
                    Report.navigateToAndOpenChildReport(props.childReportID);
                }}
                accessibilityRole="button"
                accessibilityLabel={`${props.numberOfReplies} ${replyText}`}
            >

What alternative solutions did you explore? (Optional)

Add onLongPress default props our GenericPressable.

@bfitzexpensify bfitzexpensify added the External Added to denote the issue can be worked on by a contributor label Jun 23, 2023
@melvin-bot melvin-bot bot changed the title Long Pressing on reply opens the context menu for the ReportPreview action. [$1000] Long Pressing on reply opens the context menu for the ReportPreview action. Jun 23, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 23, 2023

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jun 23, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 23, 2023

Current assignee @bfitzexpensify is eligible for the External assigner, not assigning anyone new.

@melvin-bot
Copy link

melvin-bot bot commented Jun 23, 2023

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

@ShogunFire
Copy link
Contributor

I don't think this is a bug, it acts this way for any comment and long pressing on mobile is the equivalent of right clicking on other platforms which also open the context menu. @eVoloshchak am I missing something ?

@melvin-bot melvin-bot bot added the Overdue label Jun 25, 2023
@bfitzexpensify
Copy link
Contributor

@ShogunFire is right, I didn't realise that was the way to right-click on an Android. The behaviour is the same, and I don't think it opening the context menu the same way as right-clicking elsewhere on the message does is unexpected. I agree this isn't a bug and I'm going to close this out.

@parasharrajat
Copy link
Member

parasharrajat commented Jun 26, 2023

Sorry, I didn't understand this comment @bfitzexpensify. Can you please rephrase? Right-click and long-press are two different gestures. We can also have a long press on the web if we want.

long pressing on mobile is the equivalent of right-clicking on other platforms

This is wrong. This is merely a conjecture.

I disagree with @ShogunFire. Can you right-click on Android or iOS? No, Right. So long pressing on the Android and iOS does not open the context menu on the reply. But is opening on Mobile web Chrome which is the bug. Did you really test it on Android or iOS and is it opening the context menu for you there?

There are five platforms that we mainly focus on.

  1. Android
  2. iOS
  3. Desktop
  4. web
  5. Android Chrome / iOS Safari

long-pressing does not apply to Desktops and Web. Similarly, Right-click does not apply to the rest of the list.

Because Android mobile web has the same gesture as Android and iOS. It should behave the same which is this bug.

@bfitzexpensify Let me know if you need more clarification here.

@bfitzexpensify
Copy link
Contributor

Right-click and long-press are two different gestures. We can also have a long press on the web if we want.

Huh, I didn't know this! I thought they were the same thing. Appreciate the clarification. Given that, I agree that this is in fact a bug. Let's reopen.

@ShogunFire
Copy link
Contributor

ShogunFire commented Jun 26, 2023

Proposal

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

On android and ios the context menu doesn't show when we long press a reportpreview action

What is the root cause of that problem?

For android and ios we don't handle the long press event here:

<PressableWithoutFeedback
onPress={() => {
Report.navigateToAndOpenChildReport(props.childReportID);
}}
accessibilityRole="button"
accessibilityLabel={`${props.numberOfReplies} ${replyText}`}
>

So when we long press nothing happens because this Pressable doesn't propagate the longPress event

The reason the context menu still shows when we long press on mobile web is because here:

this.pressableRef.addEventListener('contextmenu', this.executeSecondaryInteractionOnContextMenu);

We add a listener on the contextmenu event and this contextmenu event fires on long press on mobile web. For web it is called when we right click. For ios and android it is never called.

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

Ia haven't found a solution to propagate the long press event from one pressable to his parent pressable so I think what we can do is pass a new prop onSecondaryInteraction to ReportActionItemThread like this:
onSecondaryInteraction ={showPopover}
Then in ReportActionItemThread replace the PressableWithoutFeedback by a PressableWithSecondaryInteraction and pass it the function like this
onSecondaryInteraction ={props.onSecondaryInteraction }

Result:

2023-07-02.15-45-59.mp4

What alternative solutions did you explore? (Optional)

  1. If we don't want to show the contextmenu on long press on mobile web we have to remove the listener on contextmenu in PressableWithoutFeedback if we are on touchscreen

  2. If we want we can also change the condition here

    preventDefaultContextMenu={!props.draftMessage && !hasErrors}

    to prevent the contextMenu when the item has a thread and we are on touchscreen but this will prevent the context menu on the whole item and not just the "x replies" line.

@melvin-bot melvin-bot bot added the Overdue label Jun 28, 2023
@bfitzexpensify
Copy link
Contributor

@eVoloshchak proposal from @ShogunFire ready for review when you get a chance

@melvin-bot melvin-bot bot removed the Overdue label Jun 29, 2023
@ShogunFire
Copy link
Contributor

@eVoloshchak To be honest I haven't tried my proposals, I think we should know exactly what is the expected behaviour because I am not sure the behaviour on android and ios was intentional.

@melvin-bot
Copy link

melvin-bot bot commented Jun 30, 2023

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@eVoloshchak
Copy link
Contributor

@ShogunFire, expected result - is the same behavior on all platforms (i.e. it should show context menu on long press, as it does on mWeb Chrome)

If we want to show the contextmenu when we long press on android and ios what we could do is add a boolean props to BaseGenericPressable that says that we should propagate the longclick event, because right now it doesn't propagate the event if we don't have a prop onLongPress (we could also pass an empty onLongPress but that's a little weird)

Could you elaborate on that more please? Why is working fine on mWeb Chrome?

@ShogunFire
Copy link
Contributor

Proposal

Updated

@ShogunFire
Copy link
Contributor

ShogunFire commented Jul 2, 2023

@eVoloshchak

Could you elaborate on that more please? Why is working fine on mWeb Chrome?

On mWeb chrome it doesn't use the long press event to execute the secondaryinteraction it uses the context menu event that is fired by browsers.

And sorry my first proposal was wrong I haven't found a way to propagate the long press event between pressable

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Jul 11, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 11, 2023

📣 @eVoloshchak Please request via NewDot manual requests for the Reviewer role ($1000)

@melvin-bot

This comment was marked as off-topic.

@melvin-bot
Copy link

melvin-bot bot commented Jul 11, 2023

📣 @ShogunFire You have been assigned to this job!
Please apply to the Upwork job and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Once you apply to this job, your Upwork ID will be stored and you will be automatically hired for future jobs!
Keep in mind: Code of Conduct | Contributing 📖

@melvin-bot
Copy link

melvin-bot bot commented Jul 11, 2023

📣 @parasharrajat Please request via NewDot manual requests for the Reporter role ($250)

@melvin-bot

This comment was marked as off-topic.

@ShogunFire
Copy link
Contributor

Ready for review

@melvin-bot
Copy link

melvin-bot bot commented Jul 12, 2023

🎯 ⚡️ Woah @eVoloshchak / @ShogunFire, great job pushing this forwards! ⚡️

The pull request got merged within 3 working days of assignment, so this job is eligible for a 50% #urgency bonus 🎉

  • when @ShogunFire got assigned: 2023-07-11 17:53:58 Z
  • when the PR got merged: 2023-07-12 23:26:54 UTC

On to the next one 🚀

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 labels Jul 14, 2023
@melvin-bot melvin-bot bot changed the title [$1000] Long Pressing on reply opens the context menu for the ReportPreview action. [HOLD for payment 2023-07-21] [$1000] Long Pressing on reply opens the context menu for the ReportPreview action. Jul 14, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jul 14, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 14, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jul 14, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.40-5 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 2023-07-21. 🎊

After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

  • External issue reporter
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

As a reminder, here are the bonuses/penalties that should be applied for any External issue:

  • Merged PR within 3 business days of assignment - 50% bonus
  • Merged PR more than 9 business days after assignment - 50% penalty

@melvin-bot
Copy link

melvin-bot bot commented Jul 14, 2023

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

  • [@eVoloshchak] The PR that introduced the bug has been identified. Link to the PR:
  • [@eVoloshchak] 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:
  • [@eVoloshchak] A discussion in #expensify-bugs 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:
  • [@eVoloshchak] Determine if we should create a regression test for this bug.
  • [@eVoloshchak] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
  • [@bfitzexpensify] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Jul 20, 2023
@ShogunFire
Copy link
Contributor

Hello @kavimuru I have accepted the job on upwork, can you make the final paiement ? Thanks

@bfitzexpensify
Copy link
Contributor

Payment made. @parasharrajat and @eVoloshchak are both receiving payments via New Dot. @eVoloshchak a reminder to complete the BZ checklist when you get a chance

@eVoloshchak
Copy link
Contributor

  • The PR that introduced the bug has been identified. Link to the PR: while this was technically caused by Add ReportActionItemThread and Thread Replies UI  #18274 (the PR in which thread component was created), it just surfaced the limitation of Pressable, not caused the bug in the first place

  • 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: N/A

  • A discussion in #expensify-bugs 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: this is a fairly simple bug, not sure if an additional discussion is needed here

  • Determine if we should create a regression test for this bug
    Is it easy to test for this bug? Yes
    Is the bug related to an important user flow? No
    Is it an impactful bug? No
    The bug has a very low impact, doesn't break the usage of the app, I don't think we should add a regression test

@parasharrajat
Copy link
Member

Requested reporting bonus 250.

@JmillsExpensify
Copy link

@bfitzexpensify Can you please summarize the appropriate individual payments for all parties involved in this issue? This is holding up @eVoloshchak's and @parasharrajat's NewDot payments. More information on this compliance process in Slack.

@bfitzexpensify
Copy link
Contributor

Sure, @JmillsExpensify these are the payments due:

@parasharrajat - $250 reporting payment
@eVoloshchak - $1500 for C+ and #urgency bonus
@ShogunFire - $1500 for contributor and #urgency bonus (paid via upwork ✅)

@bfitzexpensify
Copy link
Contributor

Agreed with your reasoning re: not needing a regression test @eVoloshchak. We're good to close this out - thanks for the work everyone!

@JmillsExpensify
Copy link

Reviewed details for @parasharrajat and @eVoloshchak. This is accurate based on summary from Business Reviewer and approved for payment in NewDot.

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 Engineering External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

8 participants