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

[Due for payment 2025-02-27] [$250] Group - Hover profile of group 6+ members, the tooltip displays five members without ellipsis #56582

Closed
2 of 8 tasks
IuliiaHerets opened this issue Feb 8, 2025 · 34 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor

Comments

@IuliiaHerets
Copy link

IuliiaHerets commented Feb 8, 2025

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number: v9.0.95-1
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from TestRail: Exp
Issue reported by: Applause Internal Team
Device used: Win 11/Chrome
App Component: Chat Report View

Action Performed:

  1. Open https://staging.new.expensify.com/
  2. Click on group chat having 6+ members
  3. Hover over profile

Expected Result:

Hover over profile, the tooltip should display five members and ellipsis

Actual Result:

Hover over profile, the tooltip is displaying five members as this group only having 5 members

Workaround:

Unknown

Platforms:

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6736754_1738976735798.Recording__900.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021889709690861886156
  • Upwork Job ID: 1889709690861886156
  • Last Price Increase: 2025-02-12
  • Automatic offers:
    • daledah | Contributor | 106130113
Issue OwnerCurrent Issue Owner: @CortneyOfstad
@IuliiaHerets IuliiaHerets added Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 labels Feb 8, 2025
Copy link

melvin-bot bot commented Feb 8, 2025

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

@Shahidullah-Muffakir
Copy link
Contributor

Shahidullah-Muffakir commented Feb 8, 2025

🚨 Edited by proposal-police: This proposal was edited at 2025-02-08 19:21:33 UTC.

Proposal

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

we are only showing 5 users names in the group chat when user hovers over the avatar, but we are not adding the ellipsis for the rest of the names

What is the root cause of that problem?

  1. we are not considering ellipsis here if the the length is more than 5:
    participantAccountIDs = participantAccountIDs.slice(0, 5);

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

  1. we can create a variable like
let shouldUseEllipsis = false;
  1. and here when the length is more than 5 then show ellipsis:

    App/src/libs/ReportUtils.ts

    Lines 2583 to 2585 in 631006e

    if (shouldApplyLimit) {
    participantAccountIDs = participantAccountIDs.slice(0, 5);
    }

    as:
    if (shouldApplyLimit) {
        if(participantAccountIDs.length > 5) {
            shouldUseEllipsis = true;
        }
        participantAccountIDs = participantAccountIDs.slice(0, 5);
    }
  1. add the ... in the end here:

    App/src/libs/ReportUtils.ts

    Lines 2588 to 2597 in 631006e

    if (isMultipleParticipantReport) {
    return participantAccountIDs
    .map(
    (participantAccountID, index) =>
    getDisplayNameForParticipant({accountID: participantAccountID, shouldUseShortForm: isMultipleParticipantReport}) || formatPhoneNumber(participants?.[index]?.login ?? ''),
    )
    .sort((first, second) => localeCompare(first ?? '', second ?? ''))
    .filter(Boolean)
    .join(', ');
    }

    as:
               .join(', ') + (shouldUseEllipsis ? '...' : '');

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

NA

What alternative solutions did you explore? (Optional)

If we want the ellipsis to be added only in the HeaderView, then:

  1. we can pass a new param like showEllipsis to the getIcons here:
    const icons = getIcons(reportHeaderData, personalDetails, null, '', -1, policy, invoiceReceiverPolicy);
  2. Then pass it here to the getGroupChatName:

    App/src/libs/ReportUtils.ts

    Lines 2764 to 2772 in 631006e

    if (isGroupChat(report)) {
    const groupChatIcon = {
    // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
    source: report.avatarUrl || getDefaultGroupAvatar(report.reportID),
    id: -1,
    type: CONST.ICON_TYPE_AVATAR,
    name: getGroupChatName(undefined, true, report),
    };
    return [groupChatIcon];
  3. and then only add the ellipsis based on this new param
Screen.Recording.2025-02-09.at.12.39.14.AM.mov

The alternative approach will work if we don't want the ellipsis in the details page as shown:

Image

@daledah
Copy link
Contributor

daledah commented Feb 9, 2025

Proposal

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

Group - Hover profile of group 6+ members, the tooltip displays five members without ellipsis

What is the root cause of that problem?

If the report has multiple participants we're get the first 5 first participants, then concat them in a single report name

App/src/libs/ReportUtils.ts

Lines 2583 to 2597 in 631006e

if (shouldApplyLimit) {
participantAccountIDs = participantAccountIDs.slice(0, 5);
}
const isMultipleParticipantReport = participantAccountIDs.length > 1;
if (isMultipleParticipantReport) {
return participantAccountIDs
.map(
(participantAccountID, index) =>
getDisplayNameForParticipant({accountID: participantAccountID, shouldUseShortForm: isMultipleParticipantReport}) || formatPhoneNumber(participants?.[index]?.login ?? ''),
)
.sort((first, second) => localeCompare(first ?? '', second ?? ''))
.filter(Boolean)
.join(', ');
}

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

We have 2 issues here:

  1. The group name doesn't have the ellipsis style
  2. If the participant's display name/login name is too long, then when the user opens the group name settings, this may cause an error without any changes as we limit the maximum name length to 100 characters
Image

We should truncate the group name in

.join(', ');

.join(', ').slice(0, 100)

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

Test the getGroupChatName function to verify the output length is less than or equal 100 characters

What alternative solutions did you explore? (Optional)

We can also add the flag to enable/disable this feature in the specific page

Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

@melvin-bot melvin-bot bot added the Overdue label Feb 11, 2025
Copy link

melvin-bot bot commented Feb 12, 2025

@CortneyOfstad Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@CortneyOfstad
Copy link
Contributor

Was able to see this within my own account (AM customer group with 7 members and only 5 names displaying, as shown below):

Image

@melvin-bot melvin-bot bot removed the Overdue label Feb 12, 2025
@CortneyOfstad CortneyOfstad added the External Added to denote the issue can be worked on by a contributor label Feb 12, 2025
@melvin-bot melvin-bot bot changed the title Group - Hover profile of group 6+ members, the tooltip displays five members without ellipsis [$250] Group - Hover profile of group 6+ members, the tooltip displays five members without ellipsis Feb 12, 2025
Copy link

melvin-bot bot commented Feb 12, 2025

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Feb 12, 2025
Copy link

melvin-bot bot commented Feb 12, 2025

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

@CortneyOfstad
Copy link
Contributor

Hey @dukenv0307! We have two proposals above when you have a chance — thanks!

@dukenv0307
Copy link
Contributor

dukenv0307 commented Feb 12, 2025

@daledah's proposal looks good to me, we should limit the group name length to prevent the error, then show the ... when the name is too long (>100 characters)

🎀👀🎀 C+ reviewed

Copy link

melvin-bot bot commented Feb 12, 2025

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

@Shahidullah-Muffakir
Copy link
Contributor

@dukenv0307 I believe we need to add the ellipsis conditionally only if the shouldApplyLimit is true.
otherwise it may cause issue in other places, like here:

Screen.Recording.2025-02-12.at.11.32.57.PM.mov

@dukenv0307
Copy link
Contributor

@Shahidullah-Muffakir I think it's expectation since the group name in these places are consistency. Let's see the final decision from internal team. Thank you

@thienlnam
Copy link
Contributor

cc @Expensify/design

Is there any preference for how we apply ellipsis in this flow?

This is a good image showcasing how it seems like there are only a certain amount of members where there are more
#56582 (comment)

@shawnborton
Copy link
Contributor

Hmm I would think we should use all of the members in the group name, and then we can use the ellipsis to truncate based on available space (in the header and details view).

@dannymcclain
Copy link
Contributor

Agree with that.

@dukenv0307
Copy link
Contributor

@shawnborton @dannymcclain For the header, we limit the space to 1 line only, but for the detail page how can we limit the group name space? Besides, we just allow the maximum group name length to be 100, so I'm now sure how we can use the available space

@shawnborton
Copy link
Contributor

Besides, we just allow the maximum group name length to be 100, so I'm now sure how we can use the available space

Ah, so just to confirm, for the details view we do not truncate via ellipsis, we just limit the group name character count to 100?

That is fine with me, but it seems like we aren't making the group names as long as they could be, right?

@dukenv0307
Copy link
Contributor

@shawnborton

Yes, here is what is happening on staging/main, the group name is too long, so when open the edit page, it will show the error without making any change

Screen.Recording.2025-02-13.at.23.06.04.mov

So I think the best way is to limit the group name character count to 100.

@shawnborton
Copy link
Contributor

Hmm yeah I would think that you shouldn't even be able to create a group name that long if we already have the 100 character limit. And I feel like we should automatically trim the group name for the user otherwise we might create a bunch of cases where the user makes a big group and can't click the Start group button because of a name length error.

@dukenv0307
Copy link
Contributor

Thank you @shawnborton @dannymcclain

Can you please check the result with this solution?

automatically trim the group name for the user

Screen.Recording.2025-02-13.at.23.33.03.mov

@dannymcclain
Copy link
Contributor

I guess that is better, though that group name doesn't seem particularly useful... Though in the mainline case I guess most users would likely have a Display Name. What do you think Shawn?

@shawnborton
Copy link
Contributor

I think this is probably the best way to handle this for now... then in the future, we should consider perhaps changing the actual 100char limit on these sorts of things if we find that group chats need longer names. But I don't think it's a super widely used feature, and hopefully people will rename their groups anyways.

@dannymcclain
Copy link
Contributor

Sounds good to me.

@daledah
Copy link
Contributor

daledah commented Feb 14, 2025

@dukenv0307 I updated the proposal: #56582 (comment), I just removed the ... in the group name

@dukenv0307
Copy link
Contributor

@daledah's proposal is still valid, we're good to go with his solution @thienlnam

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Feb 14, 2025
Copy link

melvin-bot bot commented Feb 14, 2025

📣 @daledah 🎉 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 📖

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 Weekly KSv2 labels Feb 18, 2025
@melvin-bot melvin-bot bot changed the title [$250] Group - Hover profile of group 6+ members, the tooltip displays five members without ellipsis [Due for payment 2025-02-27] [$250] Group - Hover profile of group 6+ members, the tooltip displays five members without ellipsis Feb 20, 2025
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Feb 20, 2025
Copy link

melvin-bot bot commented Feb 20, 2025

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

Copy link

melvin-bot bot commented Feb 20, 2025

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.1-6 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 2025-02-27. 🎊

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

Copy link

melvin-bot bot commented Feb 20, 2025

@dukenv0307 @CortneyOfstad @dukenv0307 The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Feb 26, 2025
@CortneyOfstad
Copy link
Contributor

@dukenv0307 — please complete the checklist by EOD — thanks!

@dukenv0307
Copy link
Contributor

BugZero Checklist:

  • [Contributor] Classify the bug:
Bug classification

Source of bug:

  • 1a. Result of the original design (eg. a case wasn't considered)
  • 1b. Mistake during implementation
  • 1c. Backend bug
  • 1z. Other:

Where bug was reported:

  • 2a. Reported on production
  • 2b. Reported on staging (deploy blocker)
  • 2c. Reported on a PR
  • 2z. Other:

Who reported the bug:

  • 3a. Expensify user
  • 3b. Expensify employee
  • 3c. Contributor
  • 3d. QA
  • 3z. Other:
  • [Contributor] 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: This is new requirement

  • [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source 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

  • [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again. Yes

Regression Test Proposal Template
  • [BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.

    Link to issue:

Regression Test Proposal

Test:

  1. Start a chat with many members, making the chat name very long
  2. Open Chat details
  3. Verify that: The Group name section the chat name is cut off
  4. Click on Group name
  5. Verify that: No errors is shown

Do we agree 👍 or 👎

@dukenv0307
Copy link
Contributor

@CortneyOfstad Done. Thank you

@CortneyOfstad
Copy link
Contributor

Payment Summary

@daledah — paid $250 via Upwork
@dukenv0307 — to be paid $250 via NewDot

Regression Test

https://github.com/Expensify/Expensify/issues/474937

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 External Added to denote the issue can be worked on by a contributor
Projects
Status: Done
Development

No branches or pull requests

8 participants