Skip to content

[HOLD for payment 2024-09-11] ][$500] Lack of maximum height for the description field for room hides other options on the page #37357

Closed

Description

@m-natarajan

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: 1.4.44-2
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: @JmillsExpensify
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1709046310280799

Action Performed:

  1. Create a room in the workspace with lengthy description
  2. Open the room and view the details of the room

Expected Result:

All the option in the details page should be visible restricting the max height of the description field

Actual Result:

Lack of a max height for the description field obscures other options

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

CleanShot 2024-02-27 at 13 38 38@2x

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01b55a4d576f4c3f8a
  • Upwork Job ID: 1762602581669859328
  • Last Price Increase: 2024-03-26
  • Automatic offers:
    • shubham1206agra | Reviewer | 0
    • brandonhenry | Contributor | 0
Issue OwnerCurrent Issue Owner: @greg-schroeder

Activity

  1. added
    ExternalAdded to denote the issue can be worked on by a contributor
    BugSomething is broken. Auto assigns a BugZero manager.
    on Feb 27, 2024
  2. changed the title [-]Lack of maximum height for the `description` field for room hides other options on the page[/-] [+][$500] Lack of maximum height for the `description` field for room hides other options on the page[/+] on Feb 27, 2024
  3. melvin-bot commented on Feb 27, 2024

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

    @melvin-bot

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

  6. melvin-bot commented on Feb 27, 2024

    @melvin-bot

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

  7. rayane-d commented on Feb 28, 2024

    @rayane-d
    Contributor

    Proposal

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

    Lack of maximum height for the description field for room hides other options on the page.

    What is the root cause of that problem?

    Here:

    <MenuItemWithTopDescription
    shouldShowRightIcon={canEditReportDescription}
    interactive={canEditReportDescription}
    title={report.description}
    shouldRenderAsHTML
    shouldCheckActionAllowedOnPress={false}
    description={translate('reportDescriptionPage.roomDescription')}
    onPress={() => Navigation.navigate(ROUTES.REPORT_DESCRIPTION.getRoute(report.reportID))}
    />

    We are rendering full description with shouldRenderAsHTML

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

    we should remove shouldRenderAsHTML prop and add numberOfLinesTitle={4} prop with appropriate maximum number of lines.
    We can use windowWidth to define dynamic maximum number of lines.

  8. ShridharGoel commented on Feb 28, 2024

    @ShridharGoel
    Contributor

    Proposal

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

    For lengthy descriptions, other options go out of the screen.

    What is the root cause of that problem?

    There is no height limit or lines limit in the below code in MenuItem

    {!!title && (shouldRenderAsHTML || (shouldParseTitle && !!html.length)) && (
                                                    <View style={styles.renderHTMLTitle}>
                                                        <RenderHTML html={getProcessedTitle} />
                                                    </View>
                                                )}
    

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

    We can pass a prop from details page, which can be set as a max height limit in the above code to ensure that description height is limited.

  9. jeremy-croff commented on Feb 28, 2024

    @jeremy-croff
    Contributor

    It's not gonna be that easy guys :P
    context #34150 (comment)
    Seems we want a solve here for truncating html

  10. jeremy-croff commented on Feb 28, 2024

    @jeremy-croff
    Contributor

    Proposal

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

    We want to limit the number of lines for html content

    What is the root cause of that problem?

    Our migration from #34150 (comment) is anticipating markdown support. A choice was made during PR to go with no max lines for this HTML we are rendering as we do not have this feature yet.

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

    I think as we start supporting more markdown/html we need more tooling to parse over this.
    We can leverage a library such as https://github.com/arendjr/text-clipper or implement our own to clip html

    What alternative solutions did you explore? (Optional)

    I also tried to solve it in a hackish way, setting a max height, overflowing, and adding ellipses with a pseudo element. It's ugly.

  11. bernhardoj commented on Feb 28, 2024

    @bernhardoj
    Contributor

    Proposal

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

    There is no maximum line for the report description.

    What is the root cause of that problem?

    Simply we don't limit the maximum line. The report description is rendered with a RenderHTML component and there is no straightforward way to set the number of lines props to the text.

    {!!title && (shouldRenderAsHTML || (shouldParseTitle && !!html.length)) && (
    <View style={styles.renderHTMLTitle}>
    <RenderHTML html={getProcessedTitle} />
    </View>
    )}

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

    One way is to wrap the description with a new custom tag that will have a custom renderer that can receive a number of lines attribute.

    1. Create a new TextRenderer
    function TextRenderer({TDefaultRenderer, textProps, ...props}) {
        return <TDefaultRenderer {...props} textProps={{...textProps, numberOfLines: props.tnode.attributes.line}} />
    }
    
    1. Register it to the custom renderer in HTMLRenderers/index.ts
    text: TextRenderer,
    

    and in BaseHTMLEngineProvider

    text: HTMLElementModel.fromCustomModel({tagName: 'text', contentModel: HTMLContentModel.textual}),
    
    1. In MenuItem, wrap the HTML with <text> tag.
    return processedTitle ? `<comment><text line="${numberOfLinesTitle}">${processedTitle}</text></comment>` : '';
    
    1. In ReportDetailsPage, pass numberOfLinesTitle with the agreed value
    numberOfLinesTitle={3}
    

    Why we can't create a custom renderer for <comment> tag? That's because comment is a block model, not textual which won't receive textProps

  12. 161 remaining items

  13. changed the title [-][$500] Lack of maximum height for the `description` field for room hides other options on the page[/-] [+][Pay meow][$500] Lack of maximum height for the `description` field for room hides other options on the page[/+] on Sep 10, 2024
  14. changed the title [-][Pay meow][$500] Lack of maximum height for the `description` field for room hides other options on the page[/-] [+][HOLD for payment 2024-09-11] ][$500] Lack of maximum height for the `description` field for room hides other options on the page[/+] on Sep 11, 2024
  15. greg-schroeder commented on Sep 11, 2024

    @greg-schroeder
    Contributor

    Payment summary:

    Contributor: @brandonhenry - $500 - Offer sent via Upwork
    C+: @shubham1206agra - $500 - Offer sent via Upwork

  16. puneetlath commented on Sep 11, 2024

    @puneetlath
    Contributor

    @greg-schroeder I discussed with both Brandon and Shubham and re-checked the PRs. We had multiple scope increases, so I think we should update the payout to be $1250.

  17. brandonhenry commented on Sep 12, 2024

    @brandonhenry
    Contributor

    @greg-schroeder @puneetlath thanks, let me know if I need to do anything here

  18. greg-schroeder commented on Sep 12, 2024

    @greg-schroeder
    Contributor

    Oh, word. All right - I didn't realize as the issue title still shows $500. I can update the offers.

  19. shubham1206agra commented on Sep 16, 2024

    @shubham1206agra
    Contributor

    @greg-schroeder Bump here

  20. greg-schroeder commented on Sep 16, 2024

    @greg-schroeder
    Contributor

    Hmm - I updated it - did it not go through? I can try again

  21. greg-schroeder commented on Sep 17, 2024

    @greg-schroeder
    Contributor

    Tried again. Modified offer for @shubham1206agra - added bonus payment for @brandonhenry

  22. shubham1206agra commented on Sep 18, 2024

    @shubham1206agra
    Contributor

    @greg-schroeder I accepted the offer.

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 productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2EngineeringExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions