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 2022-02-09] Attachment modal ui freeze/unfreeze when long height image displayed - reported by @PrashantMangukiya #7012

Closed
mvtglobally opened this issue Jan 4, 2022 · 26 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Engineering External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors Weekly KSv2

Comments

@mvtglobally
Copy link

mvtglobally commented Jan 4, 2022

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Action Performed:

  1. Open app
  2. Upload long image
  3. Try to zoom, move image around, etc.

Expected Result:

User should be able to zoom, move image around

Actual Result:

Can not move image up/down without minor zoom. (sometime unfreeze and works, but again freeze) This happen when image height larger than screen height etc. Attached is the sample image used.

Workaround:

Unknown

Platform:

Where is this issue occurring?

  • iOS
  • Android
  • Mobile Web

Version Number:
Reproducible in staging?:
Reproducible in production?:
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation

Similar issues logged in the past
#6518
#5870
#4867

AttachmentModal.mov

Expensify/Expensify Issue URL:
Issue reported by: @PrashantMangukiya
Slack conversation: https://expensify.slack.com/archives/C01GTK53T8Q/p1640265916049300

View all open jobs on GitHub

@MelvinBot
Copy link

Triggered auto assignment to @alex-mechler (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

@alex-mechler
Copy link
Contributor

This doesnt look frozen, it looks more like we cannot move the image unless it is zoomed, like mentioned in the report

Can not move image up/down without minor zoom

This is purely on the client side, so this should be able to go external.

@alex-mechler alex-mechler removed their assignment Jan 4, 2022
@alex-mechler alex-mechler added the External Added to denote the issue can be worked on by a contributor label Jan 4, 2022
@MelvinBot
Copy link

Triggered auto assignment to @JmillsExpensify (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.

@sobitneupane
Copy link
Contributor

sobitneupane commented Jan 7, 2022

Reason
While setting image height and width, we have only checked whether imageWidth is greater than windowWidth or not in

ImageSize.getSize(this.props.url).then(({width, height}) => {
let imageWidth = width;
let imageHeight = height;
const aspectRatio = (imageHeight / imageWidth);
if (imageWidth > this.props.windowWidth) {
imageWidth = Math.round(this.props.windowWidth);
imageHeight = Math.round(imageWidth * aspectRatio);
}
this.setState({imageHeight, imageWidth});
});

To solve this issue, we must also check whether imageHeight is greather than windowHeight or not.

Proposal
We should replace

ImageSize.getSize(this.props.url).then(({width, height}) => {
            let imageWidth = width;
            let imageHeight = height;
            const aspectRatio = (imageHeight / imageWidth);
            if (imageWidth > this.props.windowWidth) {
                imageWidth = Math.round(this.props.windowWidth);
                imageHeight = Math.round(imageWidth * aspectRatio);
            }
+           if(imageHeight>this.props.windowHeight - variables.contentHeaderHeight) {
+               imageHeight = Math.round(this.props.windowHeight - variables.contentHeaderHeight)
+               imageWidth = Math.round(1/aspectRatio * imageHeight)
+           }
            this.setState({imageHeight, imageWidth});
        });

@JmillsExpensify
Copy link

Thanks for the video! Super helpful. Posting to Upwork now and we'll get a reviewer on this as well!

@MelvinBot MelvinBot removed the Overdue label Jan 7, 2022
@JmillsExpensify
Copy link

Upwork is here: https://www.upwork.com/jobs/~0139e45ab43993899b.

@botify botify removed the Daily KSv2 label Jan 7, 2022
@MelvinBot MelvinBot added the Weekly KSv2 label Jan 7, 2022
@MelvinBot
Copy link

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

@MelvinBot MelvinBot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jan 7, 2022
@MelvinBot
Copy link

Triggered auto assignment to @deetergp (Exported), see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@parasharrajat
Copy link
Member

Nice catch @sobitneupane. The proposal looks good.

cc: @deetergp

🎀 👀 🎀 C+ reviewed

@deetergp
Copy link
Contributor

@sobitneupane's proposal looks good. Let's make sure we add some comments explaining why this bit of code is necessary.

@MelvinBot MelvinBot removed the Overdue label Jan 17, 2022
@sobitneupane
Copy link
Contributor

@sobitneupane's proposal looks good. Let's make sure we add some comments explaining why this bit of code is necessary.

Okay.

@sobitneupane
Copy link
Contributor

Should I wait until the issue is assigned to me? Or Should I proceed my PR?

@parasharrajat
Copy link
Member

You can proceed to create the PR. @deetergp can assign you later

@deetergp
Copy link
Contributor

Thanks for the PR, @sobitneupane! Did we end up hiring you for the job in Upwork?

@MelvinBot MelvinBot removed the Overdue label Jan 28, 2022
@sobitneupane
Copy link
Contributor

sobitneupane commented Jan 28, 2022

@deetergp No. Not yet. I have applied for the job.

@deetergp
Copy link
Contributor

@JmillsExpensify let's hire & pay @sobitneupane for the work 👍

@JmillsExpensify
Copy link

Jumping in now!

@JmillsExpensify
Copy link

I took a look at the associated PR and it's still in the process of getting to staging.

In the meantime, I've hired all contributors for this issue and we'll wait for the PR to go through the process of hitting production and waiting for no regressions.

@botify botify added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Feb 2, 2022
@botify
Copy link

botify commented Feb 2, 2022

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.1.34-0 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 2022-02-09. 🎊

@botify botify changed the title Attachment modal ui freeze/unfreeze when long height image displayed - reported by @PrashantMangukiya [HOLD for payment 2022-02-09] Attachment modal ui freeze/unfreeze when long height image displayed - reported by @PrashantMangukiya Feb 2, 2022
@JmillsExpensify
Copy link

Will hold on this issue pending regressions, per the message above. Circle back then.

@PrashantMangukiya
Copy link
Contributor

@JmillsExpensify Should I also apply on Upwork job for issue reporting bonus?

@JmillsExpensify
Copy link

Yes, please!

@PrashantMangukiya
Copy link
Contributor

Applied on Upwork job. Thank you.

@JmillsExpensify
Copy link

JmillsExpensify commented Feb 10, 2022

Payments processed for PR contributor and contributor plus. Will pay out for reporting as soon as the offer is accepted. :)

@PrashantMangukiya
Copy link
Contributor

Offer accepted.

@JmillsExpensify
Copy link

Thanks everyone. Closing the issue, though don't hesitate to reach out if I can help with any questions or comments.

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 Engineering External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors Weekly KSv2
Projects
None yet
Development

No branches or pull requests

9 participants