Closed IuliiaHerets closed 1 week ago
Triggered auto assignment to @bfitzexpensify (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.
@bfitzexpensify FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors
Edited by proposal-police: This proposal was edited at 2023-10-02 12:00:00.
Carousel is scrollable when PDF is zoomed in.
We have a shared value to determine whether the carousel is scrollable or not. https://github.com/Expensify/App/blob/b655040afb3d5a482fd0c295dda4a6d8802c3df6/src/components/Attachments/AttachmentCarousel/useCarouselContextEvents.ts#L7
And we will disable it when the attachment is zoomed in. https://github.com/Expensify/App/blob/b655040afb3d5a482fd0c295dda4a6d8802c3df6/src/components/Attachments/AttachmentCarousel/useCarouselContextEvents.ts#L29-L45
However, in the PDF attachment (android file only), we have a Pan gesture that enable the scroll when lifting our finger after panning. https://github.com/Expensify/App/blob/b655040afb3d5a482fd0c295dda4a6d8802c3df6/src/components/Attachments/AttachmentView/AttachmentViewPdf/index.android.tsx#L55-L61
In https://github.com/Expensify/App/pull/30050, we add the Pan gesture to disable the carousel scrolling when scrolling the PDF. Then, https://github.com/Expensify/App/pull/33756 added the onTouchesUp
code to re-enable it after we are done panning.
The problem is, we don't always want to re-enable the scroll after panning, especially when we are already zoomed in.
The problem that https://github.com/Expensify/App/pull/30050 solves is that the carousel/pager scroll conflicted with the PDF scroll, so we disable the carousel scroll when scrolling the PDF. But in our case, the PDF is zoomed in, which means the carousel/pager scroll is already disabled, so we don't need the logic to disable/re-enable it again.
To solve this, only execute the logic if the zoom scale is 1 (not zoomed in). https://github.com/Expensify/App/blob/b655040afb3d5a482fd0c295dda4a6d8802c3df6/src/components/Attachments/AttachmentView/AttachmentViewPdf/index.android.tsx#L35
if (offsetX.value !== 0 && offsetY.value !== 0 && isScrollEnabled && scale.value === 1) {
if (!isScrollEnabled || scale.value !== 1) {
return;
}
OR
isScrollEnabled.value = scale.value === 1;
Job added to Upwork: https://www.upwork.com/jobs/~021839226463966939125
Triggered auto assignment to Contributor-plus team member for initial proposal review - @akinwale (External
)
To address the issue of navigating attachments while a PDF is zoomed in, several key solutions are proposed. First, the app should disable navigation when the PDF viewer is in a zoomed state, preventing users from accidentally switching attachments. Visual feedback, like a message or overlay, should indicate this restriction to help manage user expectations. Additionally, gesture handling needs to be modified to ignore swipes while in zoom mode, allowing only pinch gestures for zooming.
Implementing a state management system will track whether the PDF is zoomed in, controlling navigation functions accordingly. Comprehensive testing is essential to ensure that the changes work across various scenarios and devices. A user settings option could also be considered, allowing users to toggle navigation while zoomed in for added flexibility. Finally, after deployment, monitoring user feedback will be crucial to assess how effective the solution is and to make further adjustments as needed. These steps aim to enhance the overall user experience when interacting with PDF attachments.
π£ @SecretDev776! π£ 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>
@akinwale, @bfitzexpensify Huh... This is 4 days overdue. Who can take care of this?
We can move forward with @bernhardoj's proposal here.
πππ C+ reviewed.
Triggered auto assignment to @youssef-lr, see https://stackoverflow.com/c/expensify/questions/7972 for more details.
π£ It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? πΈ
π£ @akinwale π An offer has been automatically sent to your Upwork account for the Reviewer role π Thanks for contributing to the Expensify app!
PR is ready
cc: @akinwale
This issue has not been updated in over 15 days. @akinwale, @youssef-lr, @bfitzexpensify, @bernhardoj eroding to Monthly issue.
P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!
Reviewing
label has been removed, please complete the "BugZero Checklist".
The solution for this issue has been :rocket: deployed to production :rocket: in version 9.0.54-11 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2024-11-05. :confetti_ball:
For reference, here are some details about the assignees on this issue:
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:
- [x] [@akinwale] The PR that introduced the bug has been identified. Link to the PR:
- [x] [@akinwale] 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:
- [x] [@akinwale] 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:
Regression identified in https://github.com/Expensify/App/pull/33756.
- [x] [@akinwale] Determine if we should create a regression test for this bug.
- [x] [@akinwale] 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.
Regression Test Steps
Do we agree π or π?
I think this was caused by https://github.com/Expensify/App/pull/33756 => by this change to be exact not by #30050 @akinwale. Could you please update it? Thanks.
I think this was caused by #33756 => by this change to be exact not by #30050 @akinwale. Could you please update it? Thanks.
You're right. I'll update the comments.
Payment summary:
@bernhardoj due $250 for contributor work - to be paid via manual request @akinwale due $250 for C+ work - paid via Upwork β
Requested in ND.
$250 approved for @bernhardoj
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.40-0 Reproducible in staging?: Y Reproducible in production?: 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/5010669&group_by=cases:section_id&group_id=292107&group_order=asc Issue reported by: Applause Internal Team
Action Performed:
Expected Result:
I shouldn't be able to to switch to another attachment in PDF zoomed state.
Actual Result:
I can to switch to another attachment in PDF zoomed state.
Workaround:
Unknown
Platforms:
Screenshots/Videos
https://github.com/user-attachments/assets/1bdf1a25-bc75-47ac-9f15-558d26c2b8fe
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @bfitzexpensify