You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[$500] Report - A tooltip does not appear above the mentioned user with no conversation history #35554
changed the title [-]Report - A tooltip does not appear above the mentioned user with no conversation history[/-][+][$500] Report - A tooltip does not appear above the mentioned user with no conversation history[/+]on Feb 1, 2024
What alternative solutions did you explore? (Optional)
As we use BaseUserDetailsTooltip in different we can specialize this requirement only for mentions by creating a new prop and passing it
Also we can optionally start adding personal details optimistically when a user is mentioned so that we don't have to wait until the BE returns the personal details as it is behaving now
Please re-state the problem that we are trying to solve in this issue.
What is the root cause of that problem?
In this scenario, the only optimistic personalDetails for the account is the displayName because the login is an empty string.
Therefore, when personalDetails.isOptimisticPersonalDetail is true, the getDisplayNameForParticipant function returns the formattedLogin before calling the getDisplayNameOrDefault to the display name.
That is also why is bug only persists if the user has no internet connectivity because the realistic personalDetails will eventually be retrieved from the backend.
Hence, the root cause is that output of the getDisplayNameForParticipant is an empty string and the condition below relies upon the ?? operator.
Activity
[-]Report - A tooltip does not appear above the mentioned user with no conversation history[/-][+][$500] Report - A tooltip does not appear above the mentioned user with no conversation history[/+]melvin-bot commentedon Feb 1, 2024
Job added to Upwork: https://www.upwork.com/jobs/~016bf9af6101d5958e
melvin-bot commentedon Feb 1, 2024
Triggered auto assignment to Contributor-plus team member for initial proposal review - @akinwale (
External)melvin-bot commentedon Feb 1, 2024
Triggered auto assignment to @garrettmknight (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.lanitochka17 commentedon Feb 1, 2024
We think that this bug might be related to #vip-vsp
CC @quinthar
FitseTLT commentedon Feb 1, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
A tooltip does not appear above the mentioned user with no conversation history
What is the root cause of that problem?
Currently if we don't have the user in personal details we display the mention without tooltip
App/src/components/UserDetailsTooltip/BaseUserDetailsTooltip/index.tsx
Lines 88 to 89 in 9d4c634
What changes do you think we should make in order to solve the problem?
We are already passing the login in
fallbackUserDetailsso we can use it to betitleandsubtitleof the tooltip hereApp/src/components/UserDetailsTooltip/BaseUserDetailsTooltip/index.tsx
Lines 39 to 41 in 9d4c634
and change the current display logic to display with tooltip when there is
fallbackUserDetailsApp/src/components/UserDetailsTooltip/BaseUserDetailsTooltip/index.tsx
Lines 88 to 89 in 9d4c634
And display a default avatar on the tooltip
What alternative solutions did you explore? (Optional)
As we use
BaseUserDetailsTooltipin different we can specialize this requirement only for mentions by creating a new prop and passing itAlso we can optionally start adding personal details optimistically when a user is mentioned so that we don't have to wait until the BE returns the personal details as it is behaving now
Tony-MK commentedon Feb 1, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
What is the root cause of that problem?
In this scenario, the only optimistic
personalDetailsfor the account is thedisplayNamebecause theloginis an empty string.Therefore, when
personalDetails.isOptimisticPersonalDetailis true, thegetDisplayNameForParticipantfunction returns theformattedLoginbefore calling thegetDisplayNameOrDefaultto the display name.App/src/libs/ReportUtils.ts
Lines 1619 to 1621 in 33463c2
That is also why is bug only persists if the user has no internet connectivity because the realistic
personalDetailswill eventually be retrieved from the backend.Hence, the root cause is that output of the
getDisplayNameForParticipantis an empty string and the condition below relies upon the??operator.Thus, in
BaseUserDetailsTooltipcomponent,userDisplayNamewill be an empty string.App/src/components/UserDetailsTooltip/BaseUserDetailsTooltip/index.tsx
Lines 21 to 22 in 33463c2
What changes do you think we should make in order to solve the problem?
Change the
BaseUserDetailsTooltipcomponent to check if the output ofgetDisplayNameForParticipantis an empty string.This will force a fallback to the successive condition to set
userDisplayNameasuserDetails.displayName.trim().Therefore, we can switch the
??operator with the||operator to ensure theuserDisplayNameis not an empty string.What alternative solutions did you explore? (Optional)
Modify the
getDisplayNameForParticipantfunction to return thedisplayNameif it's available and the mention user'spersonalDetailsare optimistic.In this solution, we will use the
PersonalDetailsUtils.getDisplayNameOrDefaultfunction.garrettmknight commentedon Feb 5, 2024
@akinwale can you review these proposals please?
22 remaining items
melvin-bot commentedon Feb 14, 2024
Triggered auto assignment to @anmurali (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.garrettmknight commentedon Feb 14, 2024
@anmurali just reassigning in case this needs help while I'm OOO this week - will be back 2/21 to pick it back up.
akinwale commentedon Mar 4, 2024
Deployed to production: 2024-02-26
Payment due date: 2024-03-04
cc @garrettmknight
FitseTLT commentedon Mar 11, 2024
Payment Overdue @garrettmknight @anmurali
garrettmknight commentedon Mar 13, 2024
All paid out - sorry about that!