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 2024-05-20] CRITICAL: [P2P Distance] [$500] Enable immediate slide scrolling without tap #40211

Closed
1 of 6 tasks
m-natarajan opened this issue Apr 13, 2024 · 69 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

@m-natarajan
Copy link

m-natarajan commented Apr 13, 2024

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: 1.62-6
Reproducible in staging?: y
Reproducible in production?:
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
Expensify/Expensify Issue URL:
Issue reported by: @quinthar
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1712975397589869

Action Performed:

  1. Tap green FAB button
  2. Select 'track expense'
  3. Tap distance tab
  4. Touch the screen and pause ever so briefly after touching the screen.
  5. Touch the screen and immediately move

Expected Result:

Able to move the map with fingers when touching the screen

Actual Result:

I need to "tap and then slide" (where my finger needs to hold still for maybe 100ms before moving) rather than just "slide" (ie, where my finger can move immediately after touching the map, like in Google Maps).

Workaround:

unknown

Platforms:

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

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

PXL_20240413_022530531.mp4
az_recorder_20240413_153727.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~013a0e30e9fd5243ce
  • Upwork Job ID: 1780282719880835072
  • Last Price Increase: 2024-05-02
  • Automatic offers:
    • ikevin127 | Contributor | 0
    • suneox | Contributor | 0
Issue OwnerCurrent Issue Owner: @zanyrenney
@m-natarajan m-natarajan added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Apr 13, 2024
Copy link

melvin-bot bot commented Apr 13, 2024

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

@zanyrenney
Copy link
Contributor

reviewed, assigining external.

@melvin-bot melvin-bot bot removed the Overdue label Apr 16, 2024
@zanyrenney zanyrenney added the External Added to denote the issue can be worked on by a contributor label Apr 16, 2024
Copy link

melvin-bot bot commented Apr 16, 2024

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

@melvin-bot melvin-bot bot changed the title CRITICAL: [P2P Distance] Enable immediate slide scrolling without tap [$250] CRITICAL: [P2P Distance] Enable immediate slide scrolling without tap Apr 16, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Apr 16, 2024
Copy link

melvin-bot bot commented Apr 16, 2024

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

@suneox
Copy link
Contributor

suneox commented Apr 16, 2024

Proposal

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

MapView conflict event with another component when scrolling on Android

What is the root cause of that problem?

The PanResponder on MapView sometimes has been terminated by DraggableFlatList and another places using PanResponderCapture event at ScreenWrapper and TabNavigator

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

We will add onMoveShouldSetPanResponderCapture and onStartShouldSetPanResponderCapture to MapView to early prevent conflict event with another component, and separate MapView/index.android.tsx, DraggableList/index.android.tsx to specific platform to avoid regression then update ListFooterComponent to bellow DraggableFlatList

Tested branch

What alternative solutions did you explore? (Optional)

@shahinyan11
Copy link

shahinyan11 commented Apr 16, 2024

Proposal

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

[P2P Distance] Enable immediate slide scrolling without tap

What is the root cause of that problem?

Рere we are rendering the DistanceRequestFooter ( It contains MapView inside ) as a ListFooterComponent of the DraggableList, which causes the gestures of the MapView and the DraggableList to conflict.

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

  1. Add a dragHitSlop prop to the DraggableFlatList, where the bottom key equal to the height of MapView in ListFooterComponent, to disable drag gestures on the MapView area. For that we need to measure the height of MapView in DraggableFlatList component. To achieve this we should update DraggableFlatList component as below.
function DraggableList<T>({renderClone, shouldUsePortal, ListFooterComponent, ...viewProps}: DraggableListProps<T>, ref: React.ForwardedRef<FlatList<T>>) {
    const styles = useThemeStyles();
    const [mapViewHeight, setMapViewHeight] = useState(0)

    const EnhancedListFooterComponent = ListFooterComponent && React.cloneElement(ListFooterComponent, {
        onLayout: (event) => {
            const { height } = event.nativeEvent.layout;
            setMapViewHeight(height);
        },
    })

    return (
        <DraggableFlatList
            ref={ref}
            containerStyle={styles.flex1}
            contentContainerStyle={styles.flexGrow1}
            ListFooterComponentStyle={styles.flex1}
            dragHitSlop={{top:0,left:0,right:0, bottom:-mapViewHeight}}
            ListFooterComponent={EnhancedListFooterComponent}
            // eslint-disable-next-line react/jsx-props-no-spreading
            {...viewProps}
        />
    );
}
  1. Step 3 also requires the following changes to work - Add ...props in props of DistanceRequestFooter component and {...props} on container of MapView
function DistanceRequestFooter({waypoints, transaction, mapboxAccessToken, navigateToWaypointEditPage, ...props}
...

<View {...props} style={styles.mapViewContainer} >

What alternative solutions did you explore? (Optional)

Or just use ListFooterComponent out of DraggableFlatList

@mollfpr
Copy link
Contributor

mollfpr commented Apr 16, 2024

@suneox @shahinyan11 Are you able to reproduce the issue in the emulator iOS and Android?

@shahinyan11
Copy link

@suneox @shahinyan11 Are you able to reproduce the issue in the emulator iOS and Android?

I tested on a real Android device and reproduced it. I think this is a case that is better tested on a real device.

@suneox
Copy link
Contributor

suneox commented Apr 17, 2024

@suneox @shahinyan11 Are you able to reproduce the issue in the emulator iOS and Android?

I just tested on real device

@zanyrenney
Copy link
Contributor

zanyrenney commented Apr 19, 2024

@mollfpr please can you review the comments above and see if they work wiht the proposals?

@suneox
Copy link
Contributor

suneox commented Apr 20, 2024

Proposal updated

Add alternative solution and Tested branch

@quinthar quinthar changed the title [$250] CRITICAL: [P2P Distance] Enable immediate slide scrolling without tap CRITICAL: [P2P Distance] [$250] Enable immediate slide scrolling without tap Apr 21, 2024
@melvin-bot melvin-bot bot added the Overdue label Apr 21, 2024
@quinthar
Copy link
Contributor

What are the next steps? Are we waiting on @mollfpr to pick a proposal? What's the ETA on that?

@mollfpr
Copy link
Contributor

mollfpr commented Apr 22, 2024

Sorry for the delay. I just got my phone set up to test the issue.

@shahinyan11 Your solution doesn't look good on the web.

Screenshot 2024-04-22 at 16 19 09

@melvin-bot melvin-bot bot removed the Overdue label Apr 22, 2024
@shahinyan11
Copy link

@shahinyan11 Your solution doesn't look good on the web.

@mollfpr Are you about UI or functionality. Are you talking about the user interface or functionality? If you mean the UI, then there is a question of a slight change in styles

@mollfpr
Copy link
Contributor

mollfpr commented Apr 22, 2024

@suneox I'm testing your branch but the issue is still there.

Screen_Recording_20240422_175841_New.Expensify.Dev.mp4

@shahinyan11 Could you please update your proposal to make it work on all platforms?

@quinthar
Copy link
Contributor

@shahinyan11 Can you please give an ETA? Thanks!

@suneox
Copy link
Contributor

suneox commented May 3, 2024

@suneox @ikevin127 There is no need to add a separate component for Android, just add dragHitSlop prop to the DraggableList component

I don't think config dragHitSlop is fit for all cases with parameters {top: number, left: number, bottom: number, right: number} due to user can add multiple waypoints.

My proposal doesn't break another platform and it's also ready to create PR

Screenshots/Videos

Android: Native
screen-20240503-080800.mp4
Android: mWeb Chrome
screen-20240503-100035.mp4
iOS: Native
Screen.Recording.2024-05-03.at.14.21.15.mov
iOS: mWeb Safari
Screen.Recording.2024-05-03.at.08.38.09.mov
MacOS: Chrome / Safari
Screen.Recording.2024-05-03.at.08.18.10.mov
MacOS: Desktop
Screen.Recording.2024-05-03.at.08.26.10.mov

@ikevin127
Copy link
Contributor

@suneox @ikevin127 There is no need to add a separate component for Android, just add dragHitSlop prop to the DraggableList component

I think it's safe to split index.native.tsx DraggableList into index.ios.tsx and index.android.ts since on Android we're restructuring the component render by adding a View, which on iOS is not needed because the issue is not present.

This is the recommended way for platform specific changes to be safe and avoid breaking the same, working logic on other platforms.

See #34881 (comment) issue for reference.

@suneox
Copy link
Contributor

suneox commented May 3, 2024

I think it's safe to split index.native.tsx DraggableList into index.ios.tsx and index.android.ts since on Android we're restructuring the component render by adding a View, which on iOS is not needed because the issue is not present.

This is the recommended way for platform specific changes to be safe and avoid breaking the same, working logic on other platforms.

The PR is ready to create waiting for assignment

@neil-marcellini
Copy link
Contributor

@suneox's proposal LGTM! The root cause was identified and the proposed solution targets and fixes the issue accordingly.

🎀👀🎀 C+ reviewed

I found the proposal to be a bit unclear and hard to follow, but I trust the thorough testing that was already done, so let's create a PR.

Copy link

melvin-bot bot commented May 3, 2024

📣 @suneox 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels May 3, 2024
@suneox
Copy link
Contributor

suneox commented May 3, 2024

The PR is ready for review

@shahinyan11
Copy link

Proposal

Updated. I updated proposal as I am sure that the changes in approved proposal does not make sense and not necessary to have that behavior

@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, 2024
@melvin-bot melvin-bot bot changed the title CRITICAL: [P2P Distance] [$500] Enable immediate slide scrolling without tap [HOLD for payment 2024-05-20] CRITICAL: [P2P Distance] [$500] Enable immediate slide scrolling without tap May 13, 2024
Copy link

melvin-bot bot commented May 13, 2024

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

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label May 13, 2024
Copy link

melvin-bot bot commented May 13, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.72-1 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 2024-05-20. 🎊

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

Copy link

melvin-bot bot commented May 13, 2024

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:

  • [@ikevin127] The PR that introduced the bug has been identified. Link to the PR:
  • [@ikevin127] 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:
  • [@ikevin127] 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:
  • [@ikevin127] Determine if we should create a regression test for this bug.
  • [@ikevin127] 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.
  • [@zanyrenney] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@ikevin127
Copy link
Contributor

  • [@ikevin127] The PR that introduced the bug has been identified. Link to the PR:

No PR causing this was identified, this was not caused by a recent regression.

  • [@ikevin127] 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:
  • [@ikevin127] 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:

No need, as this was an edge case issue which happened only on Android: Native due to differences in touch handler.

  • [@ikevin127] Determine if we should create a regression test for this bug.

No need for regression test here as as this was an edge case issue which happened only on Android: Native due to differences in touch handler.

  • [@ikevin127] 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.

@melvin-bot melvin-bot bot added Daily KSv2 Overdue and removed Weekly KSv2 labels May 19, 2024
@zanyrenney
Copy link
Contributor

payment summary

paid $500 via upwork to @suneox
paid $500 via upwork to @ikevin127

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
No open projects
Status: CRITICAL
Development

No branches or pull requests

8 participants