Closed isagoico closed 10 months ago
Had a look at this today and this is definitely a regression, at least on iOS, on the Android emulator the pinch-zoom didn't work even on an old version without the recent changes. The main issue is that the event/gestureState being passed into the onStartShouldSetPanResponder
callback is showing 1 touch, rather than 2 touches. On the simulator this works fine, and when testing on a physical device the pinch to zoom works about 50% of the time, so I believe this is related to the PanResponder trying to prevent multiple taps as stated in the docs.
PanResponder reconciles several touches into a single gesture. It makes single-touch gestures resilient to extra touches, and can be used to recognize basic multi-touch gestures.
The reason this was working before was that in the library code, the zoom functionality was happening inside the onPanResponderMove function even after 1 tap, however, with the recent changes the override of onStartShouldSetPanResponder now prevents that logic from being hit. For context, the reason for this change was to enable the swipe event to be passed to the Attachment Modal if the tap event was just one touchpoint or we were zoomed in.
I tried a couple of things here to enable the zoom to work consistently but ultimately couldn't retain both behaviors
onMove
and onMoveShouldSetPanResponder
functions never get hitonStartShouldSetPanResponder
to return true, passing down a function as a prop to close the AttachmentModal, and calling that function inside the onMove/responderRelease which works, but with two issues; the animation for dismissing the modal is not the same as the other modals (it doesn't animate as you swipe), and the library does not pass any data letting us determine the direction/distance the user swiped which means the modal dismisses regardless of the direction you swipe in. We'd need to update the library to pass the event data to the callbacks to make this work.Some potential solutions, from easiest to more complicated:
onPanResponderRelease
event where the scale is set to 1 (not zoomed), sacrificing the consistent modal animationcc @marcaaron since you are familiar w/ this feature
Had another look at this today but didn't find any valid solutions, and it doesn't seem like there's a way to make the PanResponder event more accurate for multi-touch. I also tried using https://github.com/aMarCruz/react-native-photo-view-ex and https://github.com/ascoders/react-native-image-viewer#readme but nothing super helpful in those either. I've pushed this branch with my testing diff, I'll get more eyes on this in #expensify-open-source.
Issue reproducible during today's KI retests
Issue reproducible during today's KI retests
Issue reproducible during today's KI retests
Issue reproducible today during KI retests
Issue reproducible today during KI retests
Issue reproducible today during KI retests
Issue reproducible today during KI retests.
Issue reproducible during KI retests.
Issue reproducible during KI retests.
Issue reproducible during KI retests
Issue reproducible during KI retests
Issue reproducible during KI retests
Issue reproducible during KI retests
Missed this one! PR in review
Issue reproducible during KI retests
Issue is still reproducible and failing https://github.com/Expensify/App/pull/4440 CC @Jag96
:wave: Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open StagingDeployCash
deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
Issue reproducible during KI retests
Removing the blocker label since it's the same behavior on production
When retesting this. I noticed that if you zoom in the picture first, then you're able to use the pinch gesture to zoom in and out, but when you return the picture to the original size the pinch gesture won't work
PD: Enjoy the pic of my chair stealing cats, I just have to leave the chair to get some water for them to take over like this.
Haven't gotten a chance to look at this yet due to other priorities
Issue reproducible during KI retests
Had another look at this and it's the same issue as https://github.com/Expensify/App/issues/2499#issuecomment-827228825, the same problem exists for the invisible view where numberActiveTouches
is only set to 2 if both fingers hit the view at the same exact time, which isn't realistic.
The next steps here would be to look into a couple of libraries to see if there's any other way to get this working, otherwise, we'll need to look into a custom solution which will likely involve replacing ImageZoom (and possibly react-native-modal) with our own implementation that handles both the modal animation swipe and all zoom/pan functionality.
Issue reproducible during KI retests
Issue reproducible during KI retests.
Haven't gotten to this, not a priority atm
Issue reproducible during KI retests.
Still low priority
Issue reproducible during KI retests.
Issue reproducible during KI retests.
Issue not reproducible during KI retests. (First Week)
Issue reproducible during KI retests.
Issue reproducible during KI retests.
This one hasn't been a priority for quite some time, and likely won't be a priority soon. Unassigning myself.
Issue not reproducible during KI retests. (Second Week)
Issue not reproducible during KI retests. (Third week) Keeping open for another check due to this https://expensify.slack.com/archives/C01GTK53T8Q/p1639445152215200
Team was able to reproduce again this week.
Issue not reproducible during KI retests. (Fourth week). It seems very inconsistent. Should we close this?
@mvtglobally I believe it will only work properly if both fingers hit the screen at exactly the same time. If you put one finger on the screen and then add the second and pinch to zoom, I believe it will be reproducible every time.
@isagoico, this Monthly task hasn't been acted upon in 6 weeks; closing.
If you disagree, feel encouraged to reopen it -- but pick your least important issue to close instead.
@Jag96 Issue is reproduced during Regression.
@isagoico, this Monthly task hasn't been acted upon in 6 weeks; closing.
If you disagree, feel encouraged to reopen it -- but pick your least important issue to close instead.
The issue is reproducible. Can we reopen this?
cc: @Jag96 @kadiealexander
Issue is reproductible on build 1.2.62.0
@isagoico, this Monthly task hasn't been acted upon in 6 weeks; closing.
If you disagree, feel encouraged to reopen it -- but pick your least important issue to close instead.
Issue is reproduced in build 1.3.47.3
https://github.com/Expensify/App/assets/93399543/76c63dfb-2b87-4070-b521-6cee819d9cc1
I would like to contribute please
📣 @Astronomy74! 📣 Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork. Please follow these steps:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Expected Result
Confirm the image zooms in
Actual Result
Image does not zoom in
Action Performed
Platform
iOS ✔️ Android ✔️ mWeb/Chrome ✔️
Workaround:
User can zoom with double tap
Platform:
Where is this issue occurring?
Web iOS ✔️ Android ✔️ Desktop App Mobile Web
Version Number: 1.0.27-0
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Images/Videos Issue is reproducible in production but it's failing step 5 of this PR https://github.com/Expensify/Expensify.cash/pull/2442#issuecomment-823623629.
https://user-images.githubusercontent.com/44479856/115468224-c4c6e180-a200-11eb-8a4e-9e751b56a07f.mp4
Expensify/Expensify Issue URL:
View all open jobs on Upwork