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

[Payment Due 2023-12-21][$500] Web – Chat – Tooltip is out if hover the cursor on the mentioned user you have no conversation #31720

Closed
1 of 6 tasks
kbecciv opened this issue Nov 22, 2023 · 27 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review

Comments

@kbecciv
Copy link

kbecciv commented Nov 22, 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!


Version Number: 1.4.2.0
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: Applause - Internal Team
Slack conversation:

Action Performed:

  1. Go to https://staging.new.expensify.com/
  2. Log in with any Gmail account.
  3. Go to any chat
  4. Mention any user you have no conversation yet by typing @ in the composer and selecting from the list.
  5. Hover the cursor on the mentioned user.

Expected Result:

The user detail displayed inside the tooltip.

Actual Result:

Tooltip is out if hover the cursor on the mentioned user you have no conversation yet.

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

Bug6287369_1700668851348.Tooltip_is_out.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01fd8d4190c3d5d7a0
  • Upwork Job ID: 1727358226516967424
  • Last Price Increase: 2023-11-29
  • Automatic offers:
    • ntdiary | Reviewer | 27989202
    • bernhardoj | Contributor | 27989203
@kbecciv kbecciv added External Added to denote the issue can be worked on by a contributor Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Nov 22, 2023
@melvin-bot melvin-bot bot changed the title Web – Chat – Tooltip is out if hover the cursor on the mentioned user you have no conversation [$500] Web – Chat – Tooltip is out if hover the cursor on the mentioned user you have no conversation Nov 22, 2023
Copy link

melvin-bot bot commented Nov 22, 2023

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

Copy link

melvin-bot bot commented Nov 22, 2023

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

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

melvin-bot bot commented Nov 22, 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

Copy link

melvin-bot bot commented Nov 22, 2023

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

@tienifr
Copy link
Contributor

tienifr commented Nov 22, 2023

Proposal

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

Tooltip is out if hover the cursor on the mentioned user you have no conversation

What is the root cause of that problem?

Because the personal details for that new account was not in Onyx yet and we did not pass the required icon prop here, the tooltip was not rendered:

if (!props.icon && !userDisplayName && !userLogin) {
return props.children;
}

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

  1. Add the required icon prop by using OptionsListUtils.getAvatarsForAccountIDs as we have been using here:
const icons = OptionsListUtils.getAvatarsForAccountIDs([accountID], props.personalDetails, {[displayNameOrLogin]: accountID})
  1. Use it in MentionUserRenderer:
<UserDetailsTooltip
    accountID={icons}
    icon={icons[0]}
    fallbackUserDetails={{
        displayName: icons[0].name,
    }}
>

What alternative solutions did you explore? (Optional)

We should check all usages of UserDetailsTooltip to make sure they cover the case of missing user details.

@bernhardoj
Copy link
Contributor

Proposal

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

If we mention a user whom we never had a chat with before, hovering over it won't show a tooltip.

What is the root cause of that problem?

This is a regression from #30342. For the tooltip to show, we need to have either props.icon, userDisplayName, or userLogin.

if (!props.icon && !userDisplayName && !userLogin) {
return props.children;
}
return (
<Tooltip
shiftHorizontal={props.shiftHorizontal}
renderTooltipContent={renderTooltipContent}
renderTooltipContentKey={[userDisplayName, userLogin]}
shouldHandleScroll
>
{props.children}
</Tooltip>
);

For a user mention, we have set a fallback display name (personal detail) that should be used if we don't have the user accountID personal detail (which is true in our case).

<UserDetailsTooltip
accountID={accountID}
fallbackUserDetails={{
displayName: displayNameOrLogin,
}}
>

const userDetails = lodashGet(personalDetails, props.accountID, props.fallbackUserDetails);
let userDisplayName = ReportUtils.getDisplayNameForParticipant(props.accountID);

However, after #30342, the userDisplayName is retrieved from ReportUtils.getDisplayNameForParticipant which has its own logic to get the personal details, so the fallback detail we gave is unused.

image

Notice that previously, we get the display name from userDetails which contains the user's personal detail if exists, or the fallback personal detail.

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

We should fall back to userDetails.displayName if ReportUtils.getDisplayNameForParticipant returns an empty string.

let userDisplayName = ReportUtils.getDisplayNameForParticipant(props.accountID) || userDetails.displayName;

@mingybopeep
Copy link

mingybopeep commented Nov 22, 2023

Contributor details
Your Expensify account email: harrymenen@gmail.com
Upwork Profile Link: https://www.upwork.com/en-gb/freelancers/~0189ace31b95336fbb

When tagging a non-existent user, the userinfo tool tip fails to render.

This is caused by the tooltip expecting user details to exist - a hard dependency.

Solution: When retrieving user data to populate the tooltip, users for whom no user data is returned ought to fall back to placeholder user info. This would solve the issue.

Copy link

melvin-bot bot commented Nov 22, 2023

📣 @mingybopeep! 📣
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. Make sure you've read and understood the contributing guidelines.
  2. 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.
  3. 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.
  4. 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>

@ntdiary
Copy link
Contributor

ntdiary commented Nov 24, 2023

@tienifr , I don't think the icon prop is required, because the other messages can normally display the user detail without this prop.

image

I lean toward @bernhardoj's proposal, we can set the displayName variable to a non-empty value. However, I'm not quite sure whether its value should be the contact information or fall back to Hidden.
According to the requirements in the issue #27393, it seems that we want to display Hidden?

Let's update any place that expects a display name to fall back on the primary login. And if there is neither a displayName or a primary login, to fall back on "Hidden".

cc @puneetlath

@melvin-bot melvin-bot bot added the Overdue label Nov 27, 2023
@laurenreidexpensify
Copy link
Contributor

@ntdiary just so I follow, are we waiting on @puneetlath's comment on the above before moving ahead? Thanks

@melvin-bot melvin-bot bot removed the Overdue label Nov 27, 2023
@ntdiary
Copy link
Contributor

ntdiary commented Nov 28, 2023

However, I'm not quite sure whether its value should be the contact information or fall back to Hidden.
According to the requirements in the issue #27393, it seems that we want to display Hidden?

@ntdiary just so I follow, are we waiting on @puneetlath's comment on the above before moving ahead? Thanks

@laurenreidexpensify, let's wait for two days, it would be great if @puneetlath could provide some clarification. If they don't have time, we can move forward with the default contact information. :)

Copy link

melvin-bot bot commented Nov 29, 2023

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@melvin-bot melvin-bot bot added the Overdue label Dec 1, 2023
Copy link

melvin-bot bot commented Dec 1, 2023

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

@laurenreidexpensify
Copy link
Contributor

@ntdiary let's move ahead 👍

@melvin-bot melvin-bot bot removed the Overdue label Dec 4, 2023
@ntdiary
Copy link
Contributor

ntdiary commented Dec 5, 2023

@ntdiary let's move ahead 👍

Will check the latest code and provide final feedback tomorrow. :)

Copy link

melvin-bot bot commented Dec 6, 2023

@ntdiary @laurenreidexpensify this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

@ntdiary
Copy link
Contributor

ntdiary commented Dec 6, 2023

So far, I think we can move forward with @bernhardoj's proposal, it's okay to show the displayName, this is also consistent with the details page. :)

image

🎀 👀 🎀 C+ reviewed

Copy link

melvin-bot bot commented Dec 6, 2023

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

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

melvin-bot bot commented Dec 6, 2023

📣 @ntdiary 🎉 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 Dec 6, 2023

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

@bondydaa
Copy link
Contributor

bondydaa commented Dec 6, 2023

the only thing I want make sure is that ReportUtils.getDisplayNameForParticipant doesn't "leak" a user's name / personal details, as long as it just displays the email/login then that should be good.

@bernhardoj
Copy link
Contributor

ReportUtils.getDisplayNameForParticipant doesn't "leak" a user's name / personal details,

ReportUtils.getDisplayNameForParticipant returns the user display name if found. The fallback we add will show the login.

PR is ready

cc: @ntdiary

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Daily KSv2 labels Dec 7, 2023
@puneetlath
Copy link
Contributor

Sorry for the delay, but I agree with the logic.

@laurenreidexpensify laurenreidexpensify changed the title [$500] Web – Chat – Tooltip is out if hover the cursor on the mentioned user you have no conversation [Payment Due 2023-12-21][$500] Web – Chat – Tooltip is out if hover the cursor on the mentioned user you have no conversation Dec 20, 2023
@laurenreidexpensify
Copy link
Contributor

This has been on prod since 14 Dec #32632 (comment)

Copy link

melvin-bot bot commented Dec 27, 2023

@bondydaa, @ntdiary, @bernhardoj, @laurenreidexpensify Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@laurenreidexpensify
Copy link
Contributor

Payment Summary:

Contributor; $500 @bernhardoj paid in Upwork
C+ review: $500 @ntdiary paid in Upwork

@ntdiary can you please complete a checklist and confirm if we need a regression test? Thanks

@ntdiary
Copy link
Contributor

ntdiary commented Dec 29, 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:

Regression test steps:

  1. Open any chat on web/desktop platforms.
  2. Mention a user that you never chat with before.
  3. Hover the cursor on the mentioned user.
  4. Verify the tooltip shows.

Considering this is an edge regression case for PR #30342 and a suggestion in Slack regarding regression tests, I personally think it's fine to create a regression test for this issue. :)

cc @laurenreidexpensify

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. Daily KSv2 External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review
Projects
None yet
Development

No branches or pull requests

8 participants