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 OCT 08] [$250] [Search v2.3] - Default name is not displayed correctly for multiline system message thread #49330

Closed
3 of 6 tasks
IuliiaHerets opened this issue Sep 17, 2024 · 37 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2

Comments

@IuliiaHerets
Copy link

IuliiaHerets commented Sep 17, 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: 9.0.36-0
Reproducible in staging?: Y
Reproducible in production?: Y
Email or phone of affected tester (no customers): applausetester+kh010901@applause.expensifail.com
Issue reported by: Applause Internal Team

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to DM.
  3. Submit an expense with a multiline description.
  4. Go to transaction thread.
  5. Click Description.
  6. Edit the description while maintaining the multiline format and save it.
  7. Right click on the system message > Reply in thread.
  8. Send a reply in thread.
  9. Go to Search > Chats.
  10. Click Filters > Select "In".
  11. Select the thread in Step 8 > Save.
  12. Click Save search.

Expected Result:

The title of the saved search should only have one line.

Actual Result:

The title of the saved search has multiple lines and it is not displayed correctly.

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

Bug6606270_1726554285396.20240917_141656.mp4
Bug6606270_1726554285396!Screenshot_2024-09-17_at_14 22 04

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021836683698134866207
  • Upwork Job ID: 1836683698134866207
  • Last Price Increase: 2024-09-19
  • Automatic offers:
    • paultsimura | Reviewer | 104047003
    • Krishna2323 | Contributor | 104047004
Issue OwnerCurrent Issue Owner: @paultsimura
@IuliiaHerets IuliiaHerets added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Sep 17, 2024
Copy link

melvin-bot bot commented Sep 17, 2024

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

@IuliiaHerets
Copy link
Author

We think that this bug might be related to #wave-control

@IuliiaHerets
Copy link
Author

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

@CyberAndrii
Copy link
Contributor

Proposal

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

Saved search - Default name is not displayed correctly for multiline system message thread

What is the root cause of that problem?

The title text is not wrapped correctly.

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

Add titleStyle: styles.textNoWrap, here

@drminh2807
Copy link
Contributor

Proposal

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

Saved search - Default name is not displayed correctly for multiline system message thread

What is the root cause of that problem?

The title text is not wrapped correctly.

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

add numberOfLinesTitle: 2, in

const baseMenuItem: SavedSearchMenuItem = {
key,
title,
hash: key,
query: item.query,
shouldShowRightComponent: true,
focused: Number(key) === hash,
onPress: () => {
SearchActions.clearAllFilters();
Navigation.navigate(ROUTES.SEARCH_CENTRAL_PANE.getRoute({query: item?.query ?? ''}));

What alternative solutions did you explore? (Optional)

add noWrap style
titleStyle: styles.textNoWrap,

@Krishna2323
Copy link
Contributor

Proposal


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

Saved search - Default name is not displayed correctly for multiline system message thread

What is the root cause of that problem?

The default value for numberOfLinesTitle is 1 but the text overflows because we are applying styles.pre instead of styles.noWrap.

numberOfLinesTitle = 1,

const combinedTitleTextStyle = StyleUtils.combineStyles(
[
styles.flexShrink1,
styles.popoverMenuText,
// eslint-disable-next-line no-nested-ternary
shouldPutLeftPaddingWhenNoIcon || (icon && !Array.isArray(icon)) ? (avatarSize === CONST.AVATAR_SIZE.SMALL ? styles.ml2 : styles.ml3) : {},
shouldShowBasicTitle ? {} : styles.textStrong,
numberOfLinesTitle !== 1 ? styles.preWrap : styles.pre,
interactive && disabled ? {...styles.userSelectNone} : {},
styles.ltr,
isDeleted ? styles.offlineFeedback.deleted : {},
],
titleStyle ?? {},
);

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


We should update the condition below to numberOfLinesTitle !== 1 ? styles.preWrap : styles.noWrap,.

numberOfLinesTitle !== 1 ? styles.preWrap : styles.pre,

What alternative solutions did you explore? (Optional)

  • Add numberOfLinesTitle: 2 in createSavedSearchMenuItem..
  • Same should be applied in SearchTypeMenuNarrow.

Result

@truph01
Copy link
Contributor

truph01 commented Sep 18, 2024

Proposal

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

  • The title of the saved search has multiple lines and it is not displayed correctly.

What is the root cause of that problem?

  • We return the raw report name in this:
    return ReportUtils.getReportName(reports?.[`${ONYXKEYS.COLLECTION.REPORT}${filter}`]);

so the saved search name can contain multiple lines.

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

  • We can fix the issue by fixing the Text style, but with that approach, we need to apply the fix on all platforms. So I suggest that we can format this:

return ReportUtils.getReportName(reports?.[`${ONYXKEYS.COLLECTION.REPORT}${filter}`]);

so it can be:

        return ReportUtils.formatReportLastMessageText(ReportUtils.getReportName(reports?.[`${ONYXKEYS.COLLECTION.REPORT}${filter}`]));

like we did in this:

? ReportUtils.formatReportLastMessageText(fullTitle)

What alternative solutions did you explore? (Optional)

@luacmartins luacmartins changed the title Saved search - Default name is not displayed correctly for multiline system message thread [Search v2.3] - Default name is not displayed correctly for multiline system message thread Sep 19, 2024
@lakchote lakchote added External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors labels Sep 19, 2024
Copy link

melvin-bot bot commented Sep 19, 2024

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

@melvin-bot melvin-bot bot changed the title [Search v2.3] - Default name is not displayed correctly for multiline system message thread [$250] [Search v2.3] - Default name is not displayed correctly for multiline system message thread Sep 19, 2024
Copy link

melvin-bot bot commented Sep 19, 2024

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

@paultsimura
Copy link
Contributor

Reviewing now 👀

@paultsimura

This comment was marked as outdated.

Copy link

melvin-bot bot commented Sep 19, 2024

Current assignees @luacmartins and @lakchote are eligible for the choreEngineerContributorManagement assigner, not assigning anyone new.

@Krishna2323
Copy link
Contributor

@paultsimura, my proposal here solves the root cause. Could you please check again?

@paultsimura
Copy link
Contributor

On a side note, @Krishna2323 please focus on finishing your open PRs instead of posting new proposals as the contribution guideline requires.

@paultsimura
Copy link
Contributor

@paultsimura, my proposal here solves the root cause. Could you please check again?

Your proposal is very invasive, it suggests replacing the formatting for all the MenuItem components, which can cause regressions.

@CyberAndrii any chance you could find an example where using this proposal breaks styling in other places>

@truph01
Copy link
Contributor

truph01 commented Sep 19, 2024

@paultsimura What do you think about my solution, which just needs to use ReportUtils.formatReportLastMessageText without any style changes? Thank you.

@truph01
Copy link
Contributor

truph01 commented Sep 19, 2024

I tried to test your solution but It does not fix in case of IOS safari. Can you help confirm if I was wrong? @CyberAndrii

@Krishna2323
Copy link
Contributor

@paultsimura, I don't think it will cause any regression because we will be only applying styles.noWrap when numberOfLines is 1.

@paultsimura
Copy link
Contributor

Valid point @truph01. Taking another look at the proposals now...

@paultsimura
Copy link
Contributor

Ok, after another look, I tend to agree with @Krishna2323's proposal.

It makes sense to have noWrap where numberOfLines: 1.
However, to be on the safe side, we'll have to go through the places that use MenuItem component with numberOfLines: 1 (or no value provided, meaning it uses the default – still 1), and check if they really are meant to have numberOfLines: 1 or if we should update them by specifying the correct numberOfLines.

🎀👀🎀 C+ reviewed

Copy link

melvin-bot bot commented Sep 19, 2024

Current assignees @luacmartins and @lakchote are eligible for the choreEngineerContributorManagement assigner, not assigning anyone new.

@truph01
Copy link
Contributor

truph01 commented Sep 19, 2024

@paultsimura Please note we need to fix the search header page with that solution as well:

image

@paultsimura
Copy link
Contributor

@paultsimura Please note we need to fix the search header page with that solution as well:

image

There is no such requirement. From what I see, the search header is explicitly set to have numberOfLines: 2. If the design team requests so, we can change it to numberOfLines: 1.

subtitle={
<Text
numberOfLines={2}
style={[styles.textLarge, subtitleStyles]}
>
{subtitle}
</Text>
}

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Sep 19, 2024
Copy link

melvin-bot bot commented Sep 19, 2024

📣 @paultsimura 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job

Copy link

melvin-bot bot commented Sep 19, 2024

📣 @Krishna2323 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@paultsimura
Copy link
Contributor

@Expensify/design should we make the search header subtitle 1-lined with no wrap, or keep it as is (currently it's 2 lines)?
image

image

@shawnborton
Copy link
Contributor

It should only be 1 line and then truncated but why is it not occupying more horizontal space? There's a lot more space over on the right that it could be using.

@paultsimura
Copy link
Contributor

why is it not occupying more horizontal space?

That's because the text contains line breaks that are preserved. Changing numberOfLines to 1 resolves it:

image

@Krishna2323 please consider this in your PR.

@shawnborton
Copy link
Contributor

Ah nice, that's much better

@Krishna2323
Copy link
Contributor

@Krishna2323 please consider this in your PR.

Yeah, sure.

@Krishna2323
Copy link
Contributor

@paultsimura, PR ready for review ^

@luacmartins luacmartins moved this from Polish to Done in [#whatsnext] #expense Sep 26, 2024
@luacmartins
Copy link
Contributor

PR merged

@paultsimura
Copy link
Contributor

Deployed to production on Oct 1. Payment is due on 2024-10-08

@abekkala
Copy link
Contributor

abekkala commented Oct 2, 2024

PAYMENT SUMMARY FOR OCT 08

@abekkala
Copy link
Contributor

abekkala commented Oct 2, 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:

  • [@paultsimura] The PR that introduced the bug has been identified. Link to the PR:
  • [@paultsimura] 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:
  • [@paultsimura] 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.
  • [@paultsimura] Determine if we should create a regression test for this bug.
  • [@paultsimura] 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 abekkala changed the title [$250] [Search v2.3] - Default name is not displayed correctly for multiline system message thread [HOLD for Payment OCT 08] [$250] [Search v2.3] - Default name is not displayed correctly for multiline system message thread Oct 2, 2024
@paultsimura
Copy link
Contributor

  • The PR that introduced the bug has been identified. Link to the PR: note: It's not an offending PR as such, just a PR that tried to solve an existing problem, but didn't do it fully: Fix/37448: Incorrect title thread #38267
  • 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/38267/files#r1791506146
  • 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: Yes
  • 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.

Regression Test Proposal

  1. Go to DM.
  2. Submit an expense with a multiline description.
  3. Go to the transaction thread.
  4. Click Description.
  5. Edit the description while maintaining the multiline format and save it.
  6. Right-click on the system message > Reply in thread.
  7. Send a reply in the thread.
  8. Go to Search > Chats.
  9. Click Filters > Select "In".
  10. Select the thread in Step 7 > Save.
  11. Click "Save search".
  12. Verify the title of the saved search is only shown in one line.

Do we agree 👍 or 👎

@abekkala
Copy link
Contributor

abekkala commented Oct 8, 2024

@Krishna2323 @paultsimura payments sent and contracts ended - thank you! 🎉

@abekkala abekkala closed this as completed Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2
Projects
Archived in project
Development

No branches or pull requests

10 participants