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-07-22] [HOLD for payment 2024-07-17] [$1000] mWeb - Chat – Unable to zoom the image with pinching #36597

Closed
1 of 6 tasks
kbecciv opened this issue Feb 15, 2024 · 146 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

@kbecciv
Copy link

kbecciv commented Feb 15, 2024

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: v1.4.42-1
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
Expensify/Expensify Issue URL:
Issue reported by: Applause - Interna; Team
Slack conversation:

Issue found when executing PR #34080

Action Performed:

  1. Go to https://staging.new.expensify.com/
  2. Login
  3. Go to a report with attachments
  4. Open an (image) attachment
  5. Check that image gestures/transformations are working (pinching)

Expected Result:

Able to zoom the image with pinching

Actual Result:

Unable to zoom the image with pinching

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

Bug6380765_1708008491410.Screenrecorder-2024-02-15-14-08-47-83.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~016170309acaa20014
  • Upwork Job ID: 1758158238713884672
  • Last Price Increase: 2024-06-04
  • Automatic offers:
    • situchan | Contributor | 0
    • dukenv0307 | Reviewer | 102684851
    • ZhenjaHorbach | Contributor | 102711497
Issue OwnerCurrent Issue Owner: @dukenv0307
@kbecciv kbecciv added External Added to denote the issue can be worked on by a contributor Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Feb 15, 2024
Copy link

melvin-bot bot commented Feb 15, 2024

Job added to Upwork: https://www.upwork.com/jobs/~016170309acaa20014

@melvin-bot melvin-bot bot changed the title mWeb - Chat – Unable to zoom the image with pinching [$500] mWeb - Chat – Unable to zoom the image with pinching Feb 15, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Feb 15, 2024
Copy link

melvin-bot bot commented Feb 15, 2024

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

Copy link

melvin-bot bot commented Feb 15, 2024

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

@kbecciv
Copy link
Author

kbecciv commented Feb 15, 2024

We think that this bug might be related #vip-vsb
CC @quinthar

@andreasnw
Copy link
Contributor

andreasnw commented Feb 16, 2024

Proposal

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

gestures won't work when viewing image attachments on the web app

What is the root cause of that problem?

new feature

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

on web ImageView component, if the device has a touch screen (canUseTouchScreen is true),

if (canUseTouchScreen) {
return (
<View
style={[styles.imageViewContainer, styles.overflowHidden]}
onLayout={onContainerLayoutChanged}
>
<Image
source={{uri: url}}
isAuthTokenRequired={isAuthTokenRequired}
// Hide image until finished loading to prevent showing preview with wrong dimensions.
style={isLoading || zoomScale === 0 ? undefined : [styles.w100, styles.h100]}
// When Image dimensions are lower than the container boundary(zoomscale <= 1), use `contain` to render the image with natural dimensions.
// Both `center` and `contain` keeps the image centered on both x and y axis.
resizeMode={zoomScale > 1 ? RESIZE_MODES.center : RESIZE_MODES.contain}
onLoadStart={imageLoadingStart}
onLoad={imageLoad}
onError={onError}
/>
{(isLoading || zoomScale === 0) && <FullscreenLoadingIndicator style={[styles.opacity1, styles.bgTransparent]} />}
</View>
);
}

we display images using the Lightbox component instead of regular images. This will allow users to interact with the images using touch gestures.

 if (canUseTouchScreen) {
        return (
            <Lightbox
                uri={url}
                zoomRange={zoomRange}
                isAuthTokenRequired={isAuthTokenRequired}
                onError={onError}
                style={style}
            />
        );
    }

Lightbox component also requires additional zoomScale to define how images are resized.

const zoomScale = Math.min((canvasSize?.width ?? 0) / (contentSize?.width ?? 0), (canvasSize?.height?? 0) / (contentSize?.height ?? 0));

this controls how the image fits within the frame when its original size differs from the frame's dimensions.

 <MultiGestureCanvas
                                isActive={isActive}
                                canvasSize={canvasSize}
                                contentSize={contentSize}
                                zoomRange={zoomRange}
                                pagerRef={pagerRef}
                                shouldDisableTransformationGestures={isPagerScrolling}
                                onTap={onTap}
                                onScaleChanged={scaleChange}
                            >
                                <Image
                                    source={{uri}}
                                    style={contentSize ?? DEFAULT_IMAGE_DIMENSION}
                                    isAuthTokenRequired={isAuthTokenRequired}
                                    onError={onError}
                                    onLoad={updateContentSize}
                                    onLoadEnd={() => {
                                        setLightboxImageLoaded(true);
                                    }}
                                    resizeMode={zoomScale > 1 ? RESIZE_MODES.center : RESIZE_MODES.contain}
                                />
                            </MultiGestureCanvas>

result:

Simulator.Screen.Recording.-.iPhone.14.-.2024-02-26.at.00.03.37.mp4
untitled.mp4

What alternative solutions did you explore? (Optional)

@thesahindia
Copy link
Member

Please reassign. I can't take it!

@thesahindia thesahindia removed their assignment Feb 16, 2024
@situchan
Copy link
Contributor

I can take over.

We are not yet supporting zoom image in mobile web.
Is it right time to implement this new feature?

@melvin-bot melvin-bot bot added the Overdue label Feb 19, 2024
@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Feb 19, 2024
Copy link

melvin-bot bot commented Feb 19, 2024

📣 @situchan 🎉 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 removed the Overdue label Feb 19, 2024
@laurenreidexpensify
Copy link
Contributor

Asking internally here https://expensify.slack.com/archives/C066HJM2CAZ/p1708364190263029 whether we need to fix this

@laurenreidexpensify
Copy link
Contributor

Still chatting internally

@melvin-bot melvin-bot bot added the Overdue label Feb 22, 2024
Copy link

melvin-bot bot commented Feb 23, 2024

@laurenreidexpensify, @situchan Whoops! This issue is 2 days overdue. Let's get this updated quick!

@laurenreidexpensify
Copy link
Contributor

Bumped thread internally for further clarity

@melvin-bot melvin-bot bot removed the Overdue label Feb 23, 2024
@laurenreidexpensify laurenreidexpensify added the Help Wanted Apply this label when an issue is open to proposals by contributors label Feb 23, 2024
@laurenreidexpensify
Copy link
Contributor

@situchan confirmed internally - let's do it!

@situchan
Copy link
Contributor

@laurenreidexpensify thanks

Copy link

melvin-bot bot commented Jun 12, 2024

📣 @ZhenjaHorbach 🎉 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 📖

@ZhenjaHorbach
Copy link
Contributor

@mallenexpensify
Thank you 😀

PR will be ready today or tomorrow
If you don't mind
I want to spend some time investigating the issue and the chosen proposal.

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Weekly KSv2 labels Jun 12, 2024
@dukenv0307
Copy link
Contributor

@badeggg In the PR phase, the author used LightBox as you suggested before. I also test your mention here

Unable to make FlatList to be part of react-native-gesture-handler's gesture system.
That's why we can't swipe to switch after change Image to Lightbox, like this
I have tried every possible way I can imagine.
So we have to do scrolling by self

I still can swipe

Screen.Recording.2024-06-18.at.10.15.51.mov

manualActivation(true) of Gesture.Pan() not working on mWeb

how can we verify that?

double tap .numberOfTaps(2) not working on chrome for iOS, does work on safari on iOS

@ZhenjaHorbach Can you check the bug on chrome iOS?

react-native-gesture-handler@2.14.1 may not reporting 'allTouches' when onTouchesMove correctly
on mWeb, stale touch may exist.

Can you elaborate more?

@badeggg
Copy link
Contributor

badeggg commented Jun 18, 2024

If the bug I noticed does not exist any more, maybe it's because dependency version updating.

And, just curious, why the assigned contributor is not the one who proposed the c+ accepted proposal.

@ZhenjaHorbach
Copy link
Contributor

ZhenjaHorbach commented Jun 18, 2024

@badeggg In the PR phase, the author used LightBox as you suggested before. I also test your mention here

Unable to make FlatList to be part of react-native-gesture-handler's gesture system.
That's why we can't swipe to switch after change Image to Lightbox, like this
I have tried every possible way I can imagine.
So we have to do scrolling by self

I still can swipe

Screen.Recording.2024-06-18.at.10.15.51.mov

manualActivation(true) of Gesture.Pan() not working on mWeb

how can we verify that?

double tap .numberOfTaps(2) not working on chrome for iOS, does work on safari on iOS

@ZhenjaHorbach Can you check the bug on chrome iOS?

react-native-gesture-handler@2.14.1 may not reporting 'allTouches' when onTouchesMove correctly
on mWeb, stale touch may exist.

Can you elaborate more?

Actually yes, the bug exists
double tap.numberOfTaps(2) is working on chrome for iOS but very strange and unexpectedly
For the zoom to work we need to click 3 or 4 times
So I will update the PR today or tomorrow

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Jul 10, 2024
@melvin-bot melvin-bot bot changed the title [$1000] mWeb - Chat – Unable to zoom the image with pinching [HOLD for payment 2024-07-17] [$1000] mWeb - Chat – Unable to zoom the image with pinching Jul 10, 2024
Copy link

melvin-bot bot commented Jul 10, 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 Jul 10, 2024
Copy link

melvin-bot bot commented Jul 10, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.5-13 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-07-17. 🎊

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

Copy link

melvin-bot bot commented Jul 10, 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:

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

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Jul 15, 2024
@melvin-bot melvin-bot bot changed the title [HOLD for payment 2024-07-17] [$1000] mWeb - Chat – Unable to zoom the image with pinching [HOLD for payment 2024-07-22] [HOLD for payment 2024-07-17] [$1000] mWeb - Chat – Unable to zoom the image with pinching Jul 15, 2024
Copy link

melvin-bot bot commented Jul 15, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.6-8 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-07-22. 🎊

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

Copy link

melvin-bot bot commented Jul 15, 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:

  • [@ZhenjaHorbach / @dukenv0307] The PR that introduced the bug has been identified. Link to the PR:
  • [@ZhenjaHorbach / @dukenv0307] 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:
  • [@ZhenjaHorbach / @dukenv0307] 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:
  • [@ZhenjaHorbach / @dukenv0307] Determine if we should create a regression test for this bug.
  • [@ZhenjaHorbach / @dukenv0307] 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.
  • [@mallenexpensify] 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 16, 2024
@mallenexpensify
Copy link
Contributor

Contributor: @ZhenjaHorbach paid $1000 via Upwork
Contributor+: @dukenv0307 paid $1000 via Upwork.

@dukenv0307 plz complete the BZ checklist above.

@dukenv0307
Copy link
Contributor

BugZero Checklist:

  • The PR that introduced the bug has been identified. Link to the PR: N/A
  • 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: N/A
  • Determine if we should create a regression test for this bug. Yes
  • 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 tests:

  1. Open reports with attachments on mobile web.
  2. Open image attachment.
  3. Verify image can be dragged and zoomed using pan and pinch gestures.

Do we 👍 or 👎

@mallenexpensify
Copy link
Contributor

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
No open projects
Archived in project
Development

No branches or pull requests