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-08-09] [$250] mWeb - Chat - smaller file preview when opening PDF attachment #42566

Closed
1 of 6 tasks
kbecciv opened this issue May 23, 2024 · 52 comments
Closed
1 of 6 tasks
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor

Comments

@kbecciv
Copy link

kbecciv commented May 23, 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.75-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/4569525
Issue reported by: Applause - Internal Team

Action Performed:

  1. Log in to New Expensify
  2. Navigate to any chat
  3. Upload a PDF attachment
  4. Open the PDF attachment

Expected Result:

Attachment preview should be of the usual height.

Actual Result:

Preview of the opened attachment is much smaller in height in comparison to the other PDFs in conversation.
Issue is reproducible 8 out of 10 times.

Workaround:

n/a

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

Bug6489933_1716500883851.Record_2024-05-23-18-15-32.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~011542ccd37628748a
  • Upwork Job ID: 1800587084111022941
  • Last Price Increase: 2024-08-08
  • Automatic offers:
    • mkhutornyi | Reviewer | 102885617
    • bernhardoj | Contributor | 102885619
Issue OwnerCurrent Issue Owner: @greg-schroeder
@kbecciv kbecciv added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels May 23, 2024
Copy link

melvin-bot bot commented May 23, 2024

Triggered auto assignment to @muttmuure (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.

@kbecciv
Copy link
Author

kbecciv commented May 23, 2024

@muttmuure 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.

@kbecciv
Copy link
Author

kbecciv commented May 23, 2024

We think that this bug might be related to #vip-vsb

@bernhardoj
Copy link
Contributor

Proposal

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

The PDF has a smaller height. This happens when we open the PDF while a keyboard is shown.

What is the root cause of that problem?

The PDF container height is set based on the div height as can be seen in this code.

It's set in a useLayoutEffect and only happens once. When a keyboard is shown, the whole page height is reduced and if the calculation is happening while the keyboard isn't fully closed yet, the height it will receive is the reduced height, thus the PDF has a smaller height.

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

Instead of getting the height once, we should get the height whenever the div height is updated. We can use ResizeObserver for that.

const resizeObserver = new ResizeObserver(() => {
    if (!containerRef.current) {
        return;
    }
    setContainerWidth(containerRef.current.clientWidth);
    setContainerHeight(containerRef.current.clientHeight);
});
resizeObserver.observe(containerRef.current);

return () => {
    resizeObserver.disconnect();
}

We can optionally debounce it to optimize if we want.

@melvin-bot melvin-bot bot added the Overdue label May 27, 2024
Copy link

melvin-bot bot commented May 27, 2024

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

Copy link

melvin-bot bot commented May 29, 2024

@muttmuure Eep! 4 days overdue now. Issues have feelings too...

Copy link

melvin-bot bot commented May 31, 2024

@muttmuure Still overdue 6 days?! Let's take care of this!

Copy link

melvin-bot bot commented Jun 4, 2024

@muttmuure 10 days overdue. I'm getting more depressed than Marvin.

@muttmuure
Copy link
Contributor

Catching up from OOO

@melvin-bot melvin-bot bot removed the Overdue label Jun 5, 2024
Copy link

melvin-bot bot commented Jun 6, 2024

@muttmuure this issue was created 2 weeks ago. Are we close to a solution? Let's make sure we're treating this as a top priority. Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

@melvin-bot melvin-bot bot added the Overdue label Jun 7, 2024
Copy link

melvin-bot bot commented Jun 10, 2024

@muttmuure Huh... This is 4 days overdue. Who can take care of this?

@muttmuure muttmuure added the External Added to denote the issue can be worked on by a contributor label Jun 11, 2024
Copy link

melvin-bot bot commented Jun 11, 2024

Job added to Upwork: https://www.upwork.com/jobs/~011542ccd37628748a

@melvin-bot melvin-bot bot changed the title mWeb - Chat - smaller file preview when opening PDF attachment [$250] mWeb - Chat - smaller file preview when opening PDF attachment Jun 11, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jun 11, 2024
Copy link

melvin-bot bot commented Jun 11, 2024

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

@mkhutornyi
Copy link
Contributor

@bernhardoj do you have example pdf file? I am not able to reproduce with my pdf.

@bernhardoj
Copy link
Contributor

I use this PDF but any PDF should work

dummy.pdf

Copy link

melvin-bot bot commented Jun 17, 2024

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

@melvin-bot melvin-bot bot added the Overdue label Jun 17, 2024
@mountiny mountiny added Daily KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Reviewing Has a PR in review Monthly KSv2 labels Jul 29, 2024
@bernhardoj
Copy link
Contributor

I've requested in ND.

@JmillsExpensify
Copy link

$250 approved for @bernhardoj

Copy link

melvin-bot bot commented Aug 2, 2024

@mountiny, @muttmuure, @bernhardoj, @mkhutornyi Whoops! This issue is 2 days overdue. Let's get this updated quick!

@melvin-bot melvin-bot bot added Overdue Daily KSv2 and removed Daily KSv2 Overdue labels Aug 2, 2024
Copy link

melvin-bot bot commented Aug 8, 2024

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@melvin-bot melvin-bot bot added the Overdue label Aug 8, 2024
Copy link

melvin-bot bot commented Aug 8, 2024

@mountiny, @muttmuure, @bernhardoj, @mkhutornyi Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@mountiny mountiny changed the title [$250] mWeb - Chat - smaller file preview when opening PDF attachment [HOLD for payment 2024-08-09] [$250] mWeb - Chat - smaller file preview when opening PDF attachment Aug 8, 2024
@mountiny
Copy link
Contributor

mountiny commented Aug 8, 2024

$250 to @mkhutornyi still pending and we can close this I think

Copy link

melvin-bot bot commented Aug 12, 2024

@mountiny, @muttmuure, @bernhardoj, @mkhutornyi 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

Copy link

melvin-bot bot commented Aug 14, 2024

@mountiny, @muttmuure, @bernhardoj, @mkhutornyi Now this issue is 8 days overdue. Are you sure this should be a Daily? Feel free to change it!

@melvin-bot melvin-bot bot removed the Overdue label Aug 14, 2024
@mountiny mountiny added Overdue Bug Something is broken. Auto assigns a BugZero manager. and removed Bug Something is broken. Auto assigns a BugZero manager. labels Aug 14, 2024
Copy link

melvin-bot bot commented Aug 14, 2024

Triggered auto assignment to @greg-schroeder (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.

@melvin-bot melvin-bot bot removed the Overdue label Aug 14, 2024
@mountiny
Copy link
Contributor

Matt is ooo so going to ask someone else for help paying out the $250 to @mkhutornyi, @bernhardoj has already been handled.

@greg-schroeder can you please help? Thanks!

@greg-schroeder
Copy link
Contributor

Yeah sure, doing

@greg-schroeder
Copy link
Contributor

@mkhutornyi paid via Upwork

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 External Added to denote the issue can be worked on by a contributor
Projects
No open projects
Development

No branches or pull requests

7 participants