Skip to content

[HOLD for payment 2024-08-09] [$250] mWeb - Chat - smaller file preview when opening PDF attachment #42566

Closed

Description

@kbecciv

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

Activity

  1. added
    Daily
    Bug
    on May 23, 2024
  2. melvin-bot commented on May 23, 2024

    @melvin-bot

    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.

  3. kbecciv commented on May 23, 2024

    @kbecciv
    Author

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

  4. kbecciv commented on May 23, 2024

    @kbecciv
    Author

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

  5. bernhardoj commented on May 24, 2024

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

  6. melvin-bot commented on May 27, 2024

    @melvin-bot

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

  7. melvin-bot commented on May 29, 2024

    @melvin-bot

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

  8. melvin-bot commented on May 31, 2024

    @melvin-bot

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

  9. melvin-bot commented on Jun 4, 2024

    @melvin-bot

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

  10. muttmuure commented on Jun 5, 2024

    @muttmuure
    Contributor

    Catching up from OOO

  11. melvin-bot commented on Jun 6, 2024

    @melvin-bot

    @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!

  12. 70 remaining items

  13. mountiny commented on Aug 8, 2024

    @mountiny
    Contributor

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

  14. melvin-bot commented on Aug 12, 2024

    @melvin-bot

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

  15. melvin-bot commented on Aug 14, 2024

    @melvin-bot

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

  16. added
    Bug
    and removed
    Bug
    on Aug 14, 2024
  17. melvin-bot commented on Aug 14, 2024

    @melvin-bot

    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.

  18. mountiny commented on Aug 14, 2024

    @mountiny
    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!

  19. greg-schroeder commented on Aug 15, 2024

    @greg-schroeder
    Contributor

    Yeah sure, doing

  20. greg-schroeder commented on Aug 15, 2024

    @greg-schroeder
    Contributor

    @mkhutornyi paid via Upwork

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentBugDailyExternal

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions