-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[$250] IOS - Avatar doesn't get back to its original center position after zooming in and out #53471
Comments
Triggered auto assignment to @greg-schroeder ( |
Job added to Upwork: https://www.upwork.com/jobs/~021863989062279850488 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @abdulrahuman5196 ( |
Upwork job price has been updated to $125 |
Hi! I came across your job posting on Upwork regarding the avatar centering issue in your iOS app. After analyzing the problem where the avatar doesn't return to center after zoom gestures, I believe this can be fixed effectively through iterative solutions. I am a full time full stack iOS developer, designer and game developer at MagicHabits. This can be fixed in max 1-2 days. Based on my experience with iOS gesture handling and UI animations, I've identified 5 potential approaches that could solve this: Spring Animation Reset swiftCopyUIView.animate(withSpringDamping: 0.8) { Velocity-Based Repositioning swiftCopylet velocity = gesture.velocity(in: view) Smart Edge Detection swiftCopyif !safeBounds.contains(avatar.frame) { Progressive Center Force swiftCopylet centerForce = 1 - currentScale Physics-Based Boundaries swiftCopylet behavior = UIAttachmentBehavior(item: avatarImageView) I suggest implementing Solution #1 (Spring Animation Reset) first, then enhancing it with elements of Solution #4 (Progressive Center Force). This combination would: Provide immediate improvement in UX Let me know if you like it so I can submit a proposal on upwork! |
📣 @ahmedkhan28! 📣
|
Contributor details |
✅ Contributor details stored successfully. Thank you for contributing to Expensify! |
Edited by proposal-police: This proposal was edited at 2024-12-20 10:33:27 UTC. ProposalPlease re-state the problem that we are trying to solve in this issue.Avatar doesn't get back to its original center position after zooming in and out What is the root cause of that problem?The root cause of this problem is that recentering the avatar is only done if the zoom scale is less than the minimum zoom scale or more than the maximum zoom scale. When zoomed past the minimum zoom, it recenters and adjusts the zoom: overzoomed.mp4When zoomed past the maximum zoom, it does the same (may be difficult to see here) output.mp4If it's not a maximum or minimum zoom, there is no recenter, this allows the user move the avatar in any direction without it recentering Recording.at.2024-12-20.11.06.43.mp4The line of code that helps the zoom recenter after minimum or maximum zoom can be found here: App/src/components/MultiGestureCanvas/usePinchGesture.ts Lines 164 to 168 in 207622d
What changes do you think we should make in order to solve the problem?We should modify the The logic should be added in the zoom scale, we need to set the zoom scale to the maximum
pinchScale.set(zoomRange.max);
zoomScale.set(withSpring(zoomRange.max, SPRING_CONFIG, triggerScaleChangedEvent));
} else {
+ // Ensure image is centered
+ offsetX.set(withSpring(0, SPRING_CONFIG));
+ offsetY.set(withSpring(0, SPRING_CONFIG));
// Otherwise, we just update the pinch scale offset
pinchScale.set(zoomScale.get());
triggerScaleChangedEvent();
}
}); What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?N/A, It's a UI issue What alternative solutions did you explore? (Optional)N/A Resultcompressednormalxoom.mp4 |
📣 @JoshIri360! 📣
|
Contributor details |
✅ Contributor details stored successfully. Thank you for contributing to Expensify! |
Submitted the proposal just now, thank you! |
Next up is proposal review |
@greg-schroeder, @abdulrahuman5196 Huh... This is 4 days overdue. Who can take care of this? |
We had to have a contract before me solving it, right?
…On Mon, 9 Dec 2024 at 2:42 PM, melvin-bot[bot] ***@***.***> wrote:
@greg-schroeder <https://github.com/greg-schroeder>, @abdulrahuman5196
<https://github.com/abdulrahuman5196> Huh... This is 4 days overdue. Who
can take care of this?
—
Reply to this email directly, view it on GitHub
<#53471 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BACMSUPE6HB5SRTCJIZO6OL2EVQXXAVCNFSM6AAAAABS54WRMOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKMRXGQYTKMZZG4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Hi, will review today |
Thanks @abdulrahuman5196 |
@ahmedkhan28 / @JoshIri360 Kindly follow the proposal template for suggesting solutions as mentioned here https://github.com/Expensify/App/blob/main/contributingGuides/CONTRIBUTING.md#propose-a-solution-for-the-job And on another not @JoshIri360 I tried your solution and its not fixing the issue. I am still able to repro the issue with your solution. |
No pending proposal to review or approve yet |
@greg-schroeder, @abdulrahuman5196 Huh... This is 4 days overdue. Who can take care of this? |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
bump @abdulrahuman5196 on proposal review! |
|
Proposal |
|
@abdulrahuman5196 @greg-schroeder , I have updated the proposal, the issue mentioned in the comment #53471 (comment) is acctually a different issue, but also related to the pinch gesture. |
To reproduce the issue:
the image will move back to the same position when the image transition from original scale, to a small scale ("underzoom") does not need to " position your fingers to the corner" as described in the action performed. @abdulrahuman5196 please let me know if you still need more detail on the RCA. |
@greg-schroeder my proposal covers 4 additional fixes on the |
@greg-schroeder, @abdulrahuman5196 Uh oh! This issue is overdue by 2 days. Don't forget to update your issues! |
What do you think of the proposal @abdulrahuman5196? |
Hi, @greg-schroeder I would be unavailable for couple of days. Could you kindly add the appropriate labels for another random C+ to take over? Unassigning myself to avoid delays. |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
@greg-schroeder I'm low on issues and can take this over. |
Nice, thanks @dominictb |
📣 @dominictb 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app! Offer link |
@greg-schroeder @dominictb how about my proposal? Wasn't that supposed to get a review? |
Catching up with the ongoing progress. Will leave my review soon. |
ProposalPlease re-state the problem that we are trying to solve in this issue.Avatar doesn't snap back to the edge of the screen after zoom in and out. What is the root cause of that problem?When we zoom out, there are 2 callbacks called. First is the pinch gesture App/src/components/MultiGestureCanvas/usePinchGesture.ts Lines 156 to 163 in d687284
and the second one is the pan gesture App/src/components/MultiGestureCanvas/usePanGesture.ts Lines 237 to 254 in d687284
Pinch gesture end callback is always called first before the pan gesture. The one that is responsible for snapping the image back to the edge of the screen (boundary) is the pan gesture end callback, specifically the App/src/components/MultiGestureCanvas/usePanGesture.ts Lines 134 to 137 in d687284
However, the problem we currently face is that even though the pinch gesture end callback is called first, the offset shared value is updated first from the pan gesture end callback. order of calls:
order of shared value updates:
If we log the offset value (specifically And that's true, somehow the pinch gesture end callback runs on the JS thread. We can prove this by printing the _WORKLET value inside the
This all happens after #52825 where we migrate the way we access and update the shared value to satisfy the react-compiler. Now the hook is successfully optimized by react-compiler, it broke the automatic workletized by the reanimated. We can prove this by disabling react-compiler for What changes do you think we should make in order to solve the problem?We can either disable the react-compiler for OR we can manually add App/src/components/MultiGestureCanvas/usePinchGesture.ts Lines 106 to 108 in 33a03bf
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?N/A |
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.0.70-2
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/5291133
Email or phone of affected tester (no customers): nathanmulugetatesting+2272@gmail.com
Issue reported by: Applause - Internal Team
Action Performed:
Expected Result:
The position of the avatar gets back to its original center position
Actual Result:
The avatar stays at the position it was released on and doesn't get back to the center
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
Bug6683084_1733231204767.ScreenRecording_12-03-2024_15-58-36_1.1.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: