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 2023-08-03] [$1000] Web - The tooltip shows multiple/all the selected users when hovering over the overlayed avatar #22951

Closed
1 of 6 tasks
kbecciv opened this issue Jul 15, 2023 · 42 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

@kbecciv
Copy link

kbecciv commented Jul 15, 2023

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. Settings > Workspace > Members
  2. Click on Invite and select 9 users.
  3. Click on next
  4. Hover over the Overlayed avatar and notice the tooltip shows multiple/all the selected users.

Expected Result:

The tooltip should only show users missing from the initial 2 lines

Actual Result:

The tooltip shows multiple/all the selected users.

Workaround:

Unknown

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.41-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
Notes/Photos/Videos: Any additional supporting documentation

Test75_Overlayedtooltip-1.mp4
Recording.3661.mp4

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

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0117cec49274e7cba8
  • Upwork Job ID: 1680798574892285952
  • 2023-07-17
  • Automatic offers:
    • aimane-chnaif | Reviewer | 25671578
    • ahmedGaber93 | Contributor | 25671580
    • daveSeife | Reporter | 25671581
@kbecciv kbecciv added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jul 15, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 15, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jul 15, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

@ahmedGaber93
Copy link
Contributor

ahmedGaber93 commented Jul 15, 2023

Proposal

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

The tooltip shows number of users max than the reminding when Hovering over the Overlayed avatar.

What is the root cause of that problem?

Wrong calculate for tooltip text in MultipleAvatars, after enable multi rows in PR #21402 we missed changing it base on the new way.

<Tooltip
// We only want to cap tooltips to only the first 10 users or so since some reports have hundreds of users, causing performance to degrade.
text={tooltipTexts.slice(3, 10).join(', ')}
>

we now use rows so tooltipTexts.slice(3, 10) is not correct because rows show 8 avatars.

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

The tooltip text should be

// text={tooltipTexts.slice(3, 10).join(', ')}
text={tooltipTexts.slice((avatarRows.length * props.maxAvatarsInRow) - 1, 10).join(', ')}
  1. .slice with end 10 is the current code now to show only 10 users since some reports have hundreds of users.
    The number 10 seem too small because rows will display 8 users, so I suggest increasing it to 15 or 20 or calculate it dynamic (avatarRows.length * props.maxAvatarsInRow) -1 + x, we can discuss it.

  2. -1 above to show the user number 8.

What alternative solutions did you explore? (Optional)

we can calculate it out of tooltipTexts

text={props.shouldShowTooltip ? _.pluck(avatars.slice(props.maxAvatarsInRow - 1), 'name').slice(0, 10).join(', ') : ''}

@jliexpensify
Copy link
Contributor

jliexpensify commented Jul 17, 2023

Hmm, very odd - I invited 9 users and here's what I see:

image

So I think that hovering over the +1 should only accurately reflect who isn't currently on those 2 lines (i.e. Victoria).

@jliexpensify jliexpensify changed the title Web - The tooltip shows all the selected users when Hovering over the Overlayed avatar. Web - The tooltip shows multiple/all the selected users when hovering over the overlayed avatar Jul 17, 2023
@jliexpensify
Copy link
Contributor

Oh, this is a dupe of #22685

@daveSeife
Copy link

Hi @jliexpensify I think they are different issues. The one you mentioned is about the Avatars moving to the left when adding more than 8 users(this issue can also be seen in the IOU report of more than 7 user splitting a bill and also in "workspace" in the settings).

The issue I posted is about the tooltip not showing the correct users.

Can you please comment on this so I can have a better understanding on how they are the same

@jliexpensify jliexpensify reopened this Jul 17, 2023
@jliexpensify
Copy link
Contributor

@daveSeife I'm going off the Slack link, but it looks like it might be the incorrect one associated with this GH?

@jliexpensify jliexpensify added the External Added to denote the issue can be worked on by a contributor label Jul 17, 2023
@melvin-bot melvin-bot bot changed the title Web - The tooltip shows multiple/all the selected users when hovering over the overlayed avatar [$1000] Web - The tooltip shows multiple/all the selected users when hovering over the overlayed avatar Jul 17, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 17, 2023

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jul 17, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 17, 2023

Current assignee @jliexpensify is eligible for the External assigner, not assigning anyone new.

@melvin-bot
Copy link

melvin-bot bot commented Jul 17, 2023

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

@jliexpensify
Copy link
Contributor

Hi @aimane-chnaif - based off Ahmed's comment here, this isn't considered a regression right? It's just something that we didn't account for in the other PR?

@niteshletxsoft
Copy link

Proposal

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

The tooltip shows number of users max than the reminding when Hovering over the Overlayed avatar.

What is the root cause of that problem?

The cause of this issue is wrong calculation of the number of remaing avatars to be shown in the tooltip.

<Tooltip
// We only want to cap tooltips to only the first 10 users or so since some reports have hundreds of users, causing performance to degrade.
text={tooltipTexts.slice(3, 10).join(', ')}
>

This is the part of the code, which is causing the current issue.

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

To fix this issue, We will define two states as follows along with a const value to show the number of emails in the tooltip

const maxAvatarsInTooltip = 9; //10 - 1 in order to point to the indexes of the array;
const maxAvatarsRows = 2;

// This value will have a value of max 10 depending on the number of user's avatar in the list.
// we are limiting it to 10 or so as some reports have hundreds of users, causing performance to degrade.
const [remainingAvatars, setRemainingAvatars] = useState(0);
// We are counting the remaining number of the users which are not included in the avatars and the tooltip
// to show the count in the tooltip
const [notListedAvatarsCount, setNotListedAvatarsCount] = useState(0);

then we will update the values of the states defined above in calculateAvatarRows function with this code.

https://github.com/Expensify/App/blob/b9508b616f3a7229365c8bd7280fd1e34cfd2f9b/src/components/MultipleAvatars.js#L81C1-L97

// We are going to have only two rows as per the code here above. So we will exclude the Avatars in the rows from the list and 
// Show only 10 more users in the tooltip. If there are more users, We will add a string in the tooltip
// With remaining numbers which are not included in the tooltip.
if (props.icons.length > props.maxAvatarsInRow * maxAvatarsRows) {
    const avatarsCountInTooltip = props.maxAvatarsInRow * maxAvatarsRows + maxAvatarsInTooltip;
    setRemainingAvatars(avatarsCountInTooltip);

    if (props.icons.length > avatarsCountInTooltip) {
        setNotListedAvatarsCount(props.icons.length - avatarsCountInTooltip);
    }
}

Then we will use the states to show the max 10 emails in the tooltip and add the remaining numbers in the tooltip with "...+ N More"

<Tooltip
    // We only want to cap tooltips to only the first 10 users or so since some reports have hundreds of users, causing performance to degrade.
    text={`${tooltipTexts.slice((avatarRows.length * props.maxAvatarsInRow) - 1, remainingAvatars).join(', ')}
${notListedAvatarsCount > 0 ? ` ...+ ${notListedAvatarsCount} More`: "" }`}
>

@melvin-bot
Copy link

melvin-bot bot commented Jul 17, 2023

📣 @niteshletxsoft! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:

  1. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  2. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  3. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
    Screen Shot 2022-11-16 at 4 42 54 PM
    Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>

@niteshletxsoft
Copy link

Contributor details
Your Expensify account email: niteshsharma@letxsoft.com
Upwork Profile Link: https://www.upwork.com/freelancers/~018f40cdf5cfc3c570

@melvin-bot
Copy link

melvin-bot bot commented Jul 17, 2023

✅ Contributor details stored successfully. Thank you for contributing to Expensify!

@aimane-chnaif
Copy link
Contributor

Hi @aimane-chnaif - based off Ahmed's comment here, this isn't considered a regression right? It's just something that we didn't account for in the other PR?

Right, we can fix this as separate here.

@aimane-chnaif
Copy link
Contributor

@ahmedGaber93's proposal looks good to me.
I think these can be fixed together:

  • swap 1st row and 2nd row so that +x is at the end of 2nd row
  • center align horizontally avatars group container

🎀 👀 🎀 C+ reviewed

@melvin-bot
Copy link

melvin-bot bot commented Jul 17, 2023

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

@niteshletxsoft
Copy link

Hi @aimane-chnaif
Would you please share your thoughts, why do you think the proposal shared by AhmedGabar93 looks good but not mine?

I have proposed a better solution to the tooltip issue and an enhancement to handle the large number of members in a Workspace.
As i shared in the solution that We will show only 10 member's name (Email), which are not visible in the avatar rows and the remaining members count will be shown in the tooltip like "...+12 More". Which will give the idea to the user that there are more members, which are not included in the tooltip.

We can also include the below two points with this task as well.

  • swap 1st row and 2nd row so that +x is at the end of 2nd row
  • center align horizontally avatars group container

Looking forward for your reply.

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Jul 21, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 21, 2023

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

Upwork job

@melvin-bot
Copy link

melvin-bot bot commented Jul 21, 2023

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

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 📖

@madmax330
Copy link
Contributor

I agree with @aimane-chnaif's recommendation

@melvin-bot
Copy link

melvin-bot bot commented Jul 21, 2023

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

Upwork job

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Jul 22, 2023
@ahmedGaber93
Copy link
Contributor

@aimane-chnaif PR is now ready for review.

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Jul 27, 2023
@melvin-bot melvin-bot bot changed the title [$1000] Web - The tooltip shows multiple/all the selected users when hovering over the overlayed avatar [HOLD for payment 2023-08-03] [$1000] Web - The tooltip shows multiple/all the selected users when hovering over the overlayed avatar Jul 27, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 27, 2023

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

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jul 27, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 27, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.46-2 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 2023-08-03. 🎊

After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

  • External issue reporter
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

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

As a reminder, here are the bonuses/penalties that should be applied for any External issue:

  • Merged PR within 3 business days of assignment - 50% bonus
  • Merged PR more than 9 business days after assignment - 50% penalty

@melvin-bot
Copy link

melvin-bot bot commented Jul 27, 2023

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:

  • [@aimane-chnaif] The PR that introduced the bug has been identified. Link to the PR:
  • [@aimane-chnaif] 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:
  • [@aimane-chnaif] 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:
  • [@aimane-chnaif] Determine if we should create a regression test for this bug.
  • [@aimane-chnaif] 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.
  • [@jliexpensify] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@jliexpensify
Copy link
Contributor

jliexpensify commented Jul 28, 2023

Payment Summary:

Is this correct? Upworks Job here.

Friendly bump @aimane-chnaif to complete the checklist

@aimane-chnaif
Copy link
Contributor

There was weekend

@jliexpensify
Copy link
Contributor

@aimane-chnaif can you share the timeline please, for documentation purposes?

@aimane-chnaif
Copy link
Contributor

@jliexpensify
Copy link
Contributor

Thank you, updated above!

@jliexpensify
Copy link
Contributor

Bump @aimane-chnaif to complete the checklist before payment. Thanks!

@aimane-chnaif
Copy link
Contributor

Regression Test Proposal:

  1. Login any account
  2. Go to Settings > Workspaces > any workspace > Members > Invite
  3. Select 10+ users and then click next.
  4. Hover over the overlayed avatar and verify that tooltip shows the correct number of remaining users.

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Aug 3, 2023
@jliexpensify
Copy link
Contributor

Everyone paid, job closed, Thanks!

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

No branches or pull requests

7 participants