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-03-19]Task - Multi-line task descriptions are not truncated in the LHN #37976

Closed
4 of 6 tasks
kbecciv opened this issue Mar 8, 2024 · 19 comments
Closed
4 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 Engineering

Comments

@kbecciv
Copy link

kbecciv commented Mar 8, 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.49-0
Reproducible in staging?: y
Reproducible in production?: new feature
Issue found when executing PR: #35484
Issue reported by: Applause - Internal Team

Action Performed:

  1. Create and open the task
  2. Change the description to multi line
  3. Notice LHN after changing it

Expected Result:

Task descriptions should be truncated in the LHN for better readability.

Actual Result:

Multi-line task descriptions are not truncated in the LHN

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

Bug6406522_1709874154045.2024-03-08_09-43-05.mp4

View all open jobs on GitHub

@kbecciv kbecciv added the DeployBlockerCash This issue or pull request should block deployment label Mar 8, 2024
Copy link
Contributor

github-actions bot commented Mar 8, 2024

👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

  1. Identify the pull request that introduced this issue and revert it.
  2. Find someone who can quickly fix the issue.
  3. Fix the issue yourself.

Copy link

melvin-bot bot commented Mar 8, 2024

Triggered auto assignment to @marcochavezf (Engineering), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

@kbecciv
Copy link
Author

kbecciv commented Mar 8, 2024

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

@nexarvo
Copy link
Contributor

nexarvo commented Mar 8, 2024

Proposal

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

Multi-line task descriptions are not truncated in the LHN

What is the root cause of that problem?

The alternateText text is not truncated:

<Text
style={alternateTextStyle}
numberOfLines={1}
accessibilityLabel={translate('accessibilityHints.lastChatMessagePreview')}
>
{optionItem.alternateText}
</Text>

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

We can write function to truncate the text:

const truncateMultilineString = (text: string | undefined): string =>  {
    // Remove all line breaks from the string
    return text.replace(/[\r\n]+/gm, ' ');
}

and use it as:

const alternateText = truncateMultilineString(optionItem.alternateText);

What alternative solutions did you explore? (Optional)

Result

Screenshot 2024-03-08 at 8 08 53 PM

@bernhardoj
Copy link
Contributor

Proposal

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

The task description on the LHN last message shows as multi line.

What is the root cause of that problem?

The task description is shown as it is without any modification.

} else if (ReportActionsUtils.isTaskAction(lastAction)) {
result.alternateText = TaskUtils.getTaskReportActionMessage(lastAction).text;

case CONST.REPORT.ACTIONS.TYPE.TASKEDITED:
return {
text: action?.message?.[0].text ?? '',
html: action?.message?.[0].html,
};

So, if it's multi-line, then we will see multi-line too on the LHN.

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

Use ReportUtils.formatReportLastMessageText to break the line into spaces.

result.alternateText = ReportUtils.formatReportLastMessageText(TaskUtils.getTaskReportActionMessage(lastAction).text);

We need to do this for OptionsListUtils too

@marcochavezf
Copy link
Contributor

Thanks for your proposals guys, @bernhardoj's proposal is the more accurate one to solve the issue since it's re-using the existing ReportUtils.formatReportLastMessageText function. Since this is a deploy blocker and a quick change I will raise a PR, but I will assign you @bernhardoj for the compensation.

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Hourly KSv2 labels Mar 8, 2024
@roryabraham roryabraham removed the DeployBlockerCash This issue or pull request should block deployment label Mar 8, 2024
Copy link

melvin-bot bot commented Mar 8, 2024

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

@marcochavezf marcochavezf added the Bug Something is broken. Auto assigns a BugZero manager. label Mar 8, 2024
Copy link

melvin-bot bot commented Mar 8, 2024

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

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Mar 8, 2024
@marcochavezf
Copy link
Contributor

Assigning Bug label to handle the payment for @bernhardoj for the solution and @hungvu193 for C+ review? Once #37991 is deployed to production

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 labels Mar 11, 2024
@melvin-bot melvin-bot bot changed the title Task - Multi-line task descriptions are not truncated in the LHN [HOLD for payment 2024-03-18] Task - Multi-line task descriptions are not truncated in the LHN Mar 11, 2024
Copy link

melvin-bot bot commented Mar 11, 2024

Reviewing label has been removed, please complete the "BugZero Checklist".

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Mar 11, 2024
Copy link

melvin-bot bot commented Mar 11, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.49-4 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 2024-03-18. 🎊

For reference, here are some details about the assignees on this issue:

  • @bernhardoj requires payment (Needs manual offer from BZ)

Copy link

melvin-bot bot commented Mar 11, 2024

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

  • [@marcochavezf] The PR that introduced the bug has been identified. Link to the PR:
  • [@marcochavezf] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
  • [@marcochavezf] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
  • [@bernhardoj] Determine if we should create a regression test for this bug.
  • [@bernhardoj] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
  • [@abekkala] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@abekkala
Copy link
Contributor

abekkala commented Mar 11, 2024

Based on the summary from @marcochavezf above:


PAYMENT SUMMARY FOR MAR 18 19

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Mar 12, 2024
@melvin-bot melvin-bot bot changed the title [HOLD for payment 2024-03-18] Task - Multi-line task descriptions are not truncated in the LHN [HOLD for payment 2024-03-19] [HOLD for payment 2024-03-18] Task - Multi-line task descriptions are not truncated in the LHN Mar 12, 2024
Copy link

melvin-bot bot commented Mar 12, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.50-5 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 2024-03-19. 🎊

For reference, here are some details about the assignees on this issue:

  • @bernhardoj requires payment (Needs manual offer from BZ)

Copy link

melvin-bot bot commented Mar 12, 2024

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

  • [@marcochavezf] The PR that introduced the bug has been identified. Link to the PR:
  • [@marcochavezf] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
  • [@marcochavezf] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
  • [@bernhardoj] Determine if we should create a regression test for this bug.
  • [@bernhardoj] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
  • [@abekkala] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@abekkala
Copy link
Contributor

PAYMENT SUMMARY FOR MAR 18 19

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Mar 17, 2024
@abekkala
Copy link
Contributor

@hungvu193 can you determine if we should create a regression test for this bug.
If so please propose the regression test steps to ensure the same bug will not reach production again.

@abekkala abekkala changed the title [HOLD for payment 2024-03-19] [HOLD for payment 2024-03-18] Task - Multi-line task descriptions are not truncated in the LHN [HOLD for payment 2024-03-19]Task - Multi-line task descriptions are not truncated in the LHN Mar 18, 2024
@hungvu193
Copy link
Contributor

  • The PR that introduced the bug has been identified. Link to the PR: feat: Build optimistic Edit Task actions #36768
  • The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment: https://github.com/Expensify/App/pull/36768/files#r1528791240
  • A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion: N/A
  • Determine if we should create a regression test for this bug.

In the future whenever we develop a feature that relate to display a text, we should also test the text overflow case to make sure we can catch it sooner.

Regression Test Proposal:

  1. Create and open the task.
  2. Change the description to multiple lines.
  3. Verify that last message text in LHN is truncated.

Do we agree 👍 or 👎

@abekkala
Copy link
Contributor

@bernhardoj and @hungvu193 payments sent and contracts ended - thank you! 🎉

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 Engineering
Projects
None yet
Development

No branches or pull requests

7 participants