Skip to content

[HOLD for payment 2023-11-13] [$500] Composer height is not resized when resizing browser #28660

Closed

Description

@kavimuru

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. Type anything long on the first line of composer
  2. Resize the browser window to be smaller

Expected Result:

The composer's height should increased to show all the text

Actual Result:

The composer's height (number of lines) stays the same

Workaround:

Can the user still use Expensify without this being fixed? Have you informed them of the workaround?

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: 1.3.76-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
Notes/Photos/Videos: Any additional supporting documentation

Screen.Recording.2023-09-19.at.01.46.16.mov
Recording.1617.mp4

Expensify/Expensify Issue URL:
Issue reported by: @c3024
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1695059166660979

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01b81aeded72e6d5a7
  • Upwork Job ID: 1708968328042897408
  • Last Price Increase: 2023-10-02
  • Automatic offers:
    • bernhardoj | Contributor | 27244536
    • c3024 | Reporter | 27244540

Activity

  1. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Oct 2, 2023
  2. changed the title [-] Composer height is not resized when resizing browser[/-] [+][$500] Composer height is not resized when resizing browser[/+] on Oct 2, 2023
  3. melvin-bot commented on Oct 2, 2023

    @melvin-bot
  4. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Oct 2, 2023
  5. melvin-bot commented on Oct 2, 2023

    @melvin-bot

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

  6. kavimuru commented on Oct 2, 2023

    @kavimuru
    Author

    Proposal by @bernhardoj

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

    Resizing the browser window does not adjust the composer height/number of lines.

    What is the root cause of that problem?

    We don't recalculate the composer number of lines when the browser width changes. This issue was previously fixed in #15020 by recalculating the composer number of lines when window width changes but a recent functional component migration accidentally removes this behavior.

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

    Recalculate the number of lines when the window width changes by adding windowWidth to updateNumberOfLines deps array.

    }, [value, maxLines, numberOfLinesProp, onNumberOfLinesChange, isFullComposerAvailable, setIsFullComposerAvailable]);

  7. astrohunter62 commented on Oct 2, 2023

    @astrohunter62
    Contributor

    Proposal

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

    The composer's height doesn't adjust when the browser width is changed.

    What is the root cause of that problem?

    In Composer, updateNumberOfLines is enclosed within a useCallback, and it is not configured to update when the browser width changes.

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

    We can include windowWidth as a dependency for updateNumberOfLines.

    const {windowWidth} = useWindowDimensions();
    const updateNumberOfLines = useCallback(() => {
      .....
    }, [value, maxLines, numberOfLinesProp, onNumberOfLinesChange, isFullComposerAvailable, setIsFullComposerAvailable, windowWidth]);

    Result:

    28660.webm
  8. vernu commented on Oct 3, 2023

    @vernu

    Proposal

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

    The composer textarea height doesn't update when the browser width is resized.

    What is the root cause of the problem

    updateNumberOfLines is wrapped in a callback that doesn't have windowWidth in the dependency array, thus It doesn't reflect the current width.

    const updateNumberOfLines = useCallback(() => { ... }, [value, maxLines, numberOfLinesProp, onNumberOfLinesChange, isFullComposerAvailable, setIsFullComposerAvailable]);

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

    adding windowWidth from useWindowDimensions() hook into updateNumberOfLines's useCallback dependency array should address the issue.

    What alternative solutions did you explore? (Optional)

    N/A

  9. robertKozik commented on Oct 3, 2023

    @robertKozik
    Contributor

    Hi all! Thank you all for your proposals. All of you propose the same solution for this issue so let's proceed with the first published one - @bernhardoj

    🎀 👀 🎀 C+ reviewed

  10. melvin-bot commented on Oct 3, 2023

    @melvin-bot

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

  11. c3024 commented on Oct 5, 2023

    @c3024
    Contributor
  12. 30 remaining items

  13. melvin-bot commented on Nov 20, 2023

    @melvin-bot
  14. grgia commented on Nov 20, 2023

    @grgia
    Contributor

    Hey @garrettmknight could you help ensure that the payments were processed for this one?

  15. garrettmknight commented on Nov 21, 2023

    @garrettmknight
    Contributor

    Summary of payments:

    • Reporter: @c3024 $50 paid via upwork
    • Contributor: @bernhardoj $500 paid via upwork
    • Reviewer: N/A

    Upwork Job: https://www.upwork.com/en-gb/ab/applicants/1708968328042897408/job-details

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

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionDailyKSv2ExternalAdded to denote the issue can be worked on by a contributorNewFeatureSomething to build that is a new item.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions