-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[$1000] Web - Tooltip position keeps on shifting for long user names on request money details page #23784
Comments
Triggered auto assignment to @laurenreidexpensify ( |
Bug0 Triage Checklist (Main S/O)
|
The issue is caused by App/src/components/DisplayNames/index.js Line 49 in ddc19e0
|
Proposed solutionPlease re-state the problem that we are trying to solve in this issue.Web - Tooltip position keeps on shifting for long user names on request money details page What is the root cause of that problem? There are two root causes of this issue. The first one is that after increasing the amount, let say $100 -> $1000, the display name container size shrunk which causes the tooltip to move. I believe this is normal behavior and there is nothing we can do. The second issue is that In this particular case, I noticed that the child element left offset is For the same selected users, After refreshing reloading the browser on cash parent and child node left offset is consistent What changes do you think we should make in order to solve the problem? Update App/src/components/DisplayNames/index.js Line 54 in ddc19e0
Updated code here: let containerWidth;
let containerLeft;
if (this.childRefs[index].offsetParent) {
const parent = this.childRefs[index].offsetParent;
({ width: containerWidth, left: containerLeft } = parent.getBoundingClientRect());
} else {
({ width: containerWidth, left: containerLeft } = this.containerLayout);
}
or
if (this.containerRef) {
({ width: containerWidth, left: containerLeft } = this.containerRef.getBoundingClientRect();
} else {
({ width: containerWidth, left: containerLeft } = this.containerLayout);
} What alternative solutions did you explore? (Optional)N/A |
ProposalPlease re-state the problem that we are trying to solve in this issue.The tooltip position in the money request confirmation page is placed at the very end of the text and it changes after opening the edit amount page. So, the problem is not about editing the amount, simply opening the edit amount or description page is enough. What is the root cause of that problem?In DisplayNames, we have App/src/components/DisplayNames/index.js Lines 54 to 57 in eb02006
The function depends on the width and left position of the text (from The problem is, That's why, when we first open the confirmation page, the left position of the container is bigger than the text itself (by bigger, this means it is positioned more to the right than the text. it makes sense because the navigation animation slides from the right). And when we go to the edit amount page and go back, the container's left position is smaller than the text because the navigation animation now slides from the left. If we refresh the page, there is no animation going on, so the value is correct. What changes do you think we should make in order to solve the problem?Don't rely on the
|
Job added to Upwork: https://www.upwork.com/jobs/~0133c32537626b0505 |
Current assignee @laurenreidexpensify is eligible for the External assigner, not assigning anyone new. |
not overdue, added to upwork |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @s77rt ( |
@spcheema Thanks for the proposal. Your RCA does not seem accurate enough, I don't see how the display name container is related to changing the amount. Also |
@s77rt Thanks for reviewing. I'll come back to more explanation. Kindly allow sometime. |
@s77rt Here is the first video of amount related issue I mentioned in RCA: https://www.loom.com/share/7568b39882da43b49b9d47b692f74c16 If you noticed, the amount container size increased after changing the amount. So that name container (parent actually) width is smaller now. Due to that tooltip shifted to the right. Working on second point and update here shortly. |
@s77rt Here is a bit more explanation of why I said incorrect value.
The element is first visible (of course outside the viewport) then navigate This is the reason I mentioned the Incorrect value due to I have attached a screenshot of the value returns in both cases. Kindly note the left value I hope it makes sense. I completely agree I should have explained all the theories earlier. That's why the solution is to use parent element reference because the child span element is overflowing the parent container. I thought of explaining the solution details as well. Another approach is to delay setting up |
@spcheema Thanks for the update. I see you are testing in Split money flow, this explains the display name container changing width. However I am afraid your explanation for the
This solution is also misleading, we already use the parent element for calculation, it's just that we use one static value that is calculated on mount (via I think @bernhardoj had the first complete proposal so it seems fair to go with their proposal. |
@bernhardoj Thanks for the proposal. Your RCA is correct, this is solely dependent on the 🎀 👀 🎀 C+ reviewed |
Triggered auto assignment to @Julesssss, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
@s77rt Happy with your decision since I want to submit proposal first no doubt honestly. Because RCA was quite clear to me. But I won't buy misleading thing you are selling😉 Go for it @bernhardoj 🚀🚀🚀 |
📣 @s77rt 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app! |
📣 @bernhardoj 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app! Offer link |
📣 @dhanashree-sawant 🎉 An offer has been automatically sent to your Upwork account for the Reporter role 🎉 Thanks for contributing to the Expensify app! |
PR is ready cc: @s77rt |
🎯 ⚡️ Woah @s77rt / @bernhardoj, great job pushing this forwards! ⚡️ The pull request got merged within 3 working days of assignment, so this job is eligible for a 50% #urgency bonus 🎉
On to the next one 🚀 |
#23990 - this was deployed to prod on 9 august - I am working on payment now |
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:
|
Payment Summary:
|
@s77rt please complete the regression checklist above and then we can close this out. Thanks |
|
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:
Expected Result:
App should display tooltip constantly at center of username on request money details page as it does on search page
Actual Result:
Tooltip position changes when we change amount or description and is not at center of username on request money details page
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1.3.46-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
Notes/Photos/Videos: Any additional supporting documentation
tooltip.position.changes.on.change.in.amount.description.1.mp4
Recording.3954.mp4
Expensify/Expensify Issue URL:
Issue reported by: @dhanashree-sawant
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1690428525912479
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: