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-04-26] [HOLD for payment 2023-04-24] [$1000] The tooltip of the group profile is displaying a blank space on the right side, making it look weird. #16800

Closed
2 of 6 tasks
kavimuru opened this issue Mar 31, 2023 · 45 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

@kavimuru
Copy link

kavimuru commented Mar 31, 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. Open Website
  2. Create a group with multiple members
  3. Go to group chat and hover over profile.

Expected Result:

The tooltip should not have any blank space on its sides.

Actual Result:

The tooltip is displaying a blank space on the right side of the text.

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.2.92-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
3Untitled
Screenshot 2023-03-30 at 3 34 02 PM

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

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01e05c0d676c4933a0
  • Upwork Job ID: 1642861884599095296
  • Last Price Increase: 2023-04-03
@kavimuru kavimuru added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Mar 31, 2023
@MelvinBot
Copy link

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

@MelvinBot
Copy link

MelvinBot commented Mar 31, 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

@melvin-bot melvin-bot bot added the Overdue label Apr 3, 2023
@bfitzexpensify
Copy link
Contributor

Reproduced

@melvin-bot melvin-bot bot removed the Overdue label Apr 3, 2023
@bfitzexpensify bfitzexpensify added the External Added to denote the issue can be worked on by a contributor label Apr 3, 2023
@melvin-bot melvin-bot bot changed the title The tooltip of the group profile is displaying a blank space on the right side, making it look weird. [$1000] The tooltip of the group profile is displaying a blank space on the right side, making it look weird. Apr 3, 2023
@MelvinBot
Copy link

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

@MelvinBot
Copy link

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

@MelvinBot
Copy link

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

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

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

@bernhardoj
Copy link
Contributor

bernhardoj commented Apr 3, 2023

Proposal

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

There are a few space on the avatar group tooltip wrapper.

What is the root cause of that problem?

Tooltip has a maximum width of 375.

maxWidth: variables.sideBarWidth,

Because the text is very long, the text breaks to the next line and left some space on the right. This issue happens depends on how long the tooltip text.

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

We should change how the text would break. We can simply apply word-break to the tooltip text style here

tooltipTextStyle: {
color: themeColors.textReversed,
fontFamily: fontFamily.EXP_NEUE,
fontSize: tooltipFontSize,
overflow: 'hidden',
lineHeight: variables.lineHeightSmall,
// To measure tooltip text width correctly we render it freely i.e. text should not wrap to parent's boundaries.
// More info: https://github.com/Expensify/App/issues/15949#issuecomment-1483011998
...(tooltipContentWidth ? {} : styles.pre),
},

...wordBreak.breakAll,

Before:
image

After:
image

@0xmiros
Copy link
Contributor

0xmiros commented Apr 3, 2023

The screenshot in issue description is deprecated.

This should be the correct one:
#16578 (comment)

@bernhardoj
Copy link
Contributor

bernhardoj commented Apr 3, 2023

I think that would be a different case as the reaction tooltip render it's own component.

EDIT: I see now, we can apply the same fix to both tooltip text and reaction text if we want.

@dukenv0307
Copy link
Contributor

dukenv0307 commented Apr 3, 2023

Proposal

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

The tooltip of the group profile is displaying a blank space on the right side, making it look weird

What is the root cause of that problem?

In the TooltipRenderedOnPageBody.js, firstly we set tooltipContentWidth to undefined

componentDidUpdate(prevProps) {
if (prevProps.text === this.props.text && prevProps.renderTooltipContent === this.props.renderTooltipContent) {
return;
}
// Reset the tooltip text width to 0 so that we can measure it again.
// eslint-disable-next-line react/no-did-update-set-state
this.setState({tooltipContentWidth: undefined}, this.updateTooltipContentWidth);
}

Next, if the offSetWidth > maxWidth (in this case, max width is 375px), we will update the width of tooltips is maxwidth
const wrapperWidth = tooltipContentWidth && (tooltipContentWidth < maxWidth
? tooltipContentWidth + (spacing.ph2.paddingHorizontal * 2) + 1
: maxWidth);

But then we don't update the tooltipContentWidth so that the tooltipContentWidth still be the old value

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

In TooltipRenderedOnPageBody.js, We need to re-calculate the tooltipContentWidth one more time if it is greater than maxWidth

What alternative solutions did you explore? (Optional)

NA

Result

Screen Shot 2023-04-03 at 22 54 04

@mollfpr
Copy link
Contributor

mollfpr commented Apr 5, 2023

@bernhardoj I think we still want an email still in the same line so it is easy to read it.

@dukenv0307 Could you share the result using shorten email? I wondering if it's still showing only 3 line emails.

@mollfpr
Copy link
Contributor

mollfpr commented Apr 5, 2023

@0xmiroslav What we have here is a tooltip in the avatar group, and what you attach is in the reaction tooltip.

I wonder if we can apply the same solution for the reaction tooltip.

@0xmiros
Copy link
Contributor

0xmiros commented Apr 5, 2023

If they have the same root cause, solution should also be same and can be applied to reaction tooltip as well.
If different solution and need more research, can be separate issue.

@mollfpr
Copy link
Contributor

mollfpr commented Apr 5, 2023

Sounds good!

@dukenv0307
Copy link
Contributor

@mollfpr This is the result of using shorten email, the number of lines will depend on the width of content

Screenshot 2023-04-06 at 09 11 59

@mollfpr
Copy link
Contributor

mollfpr commented Apr 7, 2023

@dukenv0307 That looks good to me. Can we also fix the tooltip on the reaction chat?

@dukenv0307
Copy link
Contributor

@mollfpr It works well in the tooltip on the reaction chat

Screenshot 2023-04-07 at 22 37 09

@mollfpr
Copy link
Contributor

mollfpr commented Apr 9, 2023

Next, if the offSetWidth > maxWidth (in this case, max width is 375px), we will update the width of tooltips is maxwidth

But then we don't update the tooltipContentWidth so that the tooltipContentWidth still be the old value

@dukenv0307 Just a question to understand the root cause is. Could you explain when we didn't update the tooltipContentWidth and why we still using the old value of tooltipContentWidth? Thanks!

@dukenv0307
Copy link
Contributor

@mollfpr Currently, If tooltipContentWidth (ex: 1200px) > maxWidth (ex: 375px), we will update wrapperWidth (the width of tooltips) is maxWidth (375px)

const wrapperWidth = tooltipContentWidth && (tooltipContentWidth < maxWidth
? tooltipContentWidth + (spacing.ph2.paddingHorizontal * 2) + 1
: maxWidth);

But at this time, because the email is too long it automatically breaks the line, It makes the offsetWidth of tooltips smaller(ex: 260px) and we don't have any logic to update tooltipContentWidth = current offsetWidth (260px) (tooltipContentWidth still be 1200px) so the wrapperWidth is not updated (it still be 375px)
Note: tooltipContentWidth only be used to calculate the wrapperWidth. So that if the wrapperWidth is correct, we won't need to update tooltipContentWidth. But in this case, after updating the wrapperWidth, the wrapperWidth still be wrong (Because the email is too long, it automatically breaks the line).
To resolve this problem, we need to update tooltipContentWidth one more time then wrapperWidth also be updated one more time

@mollfpr
Copy link
Contributor

mollfpr commented Apr 17, 2023

Thanks @situchan! Yeah, we should clean that up. @dukenv0307 Could you open a PR for the update so we can CP the PR before it's hit production?

@dukenv0307
Copy link
Contributor

@mollfpr I am doing on it. The PR will be ready soon

@dukenv0307
Copy link
Contributor

@mollfpr The PR is ready to review. Please check.

@puneetlath
Copy link
Contributor

@bfitzexpensify let's make sure @situchan gets paid for a bug report on this one as well.

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 labels Apr 17, 2023
@melvin-bot melvin-bot bot changed the title [$1000] The tooltip of the group profile is displaying a blank space on the right side, making it look weird. [HOLD for payment 2023-04-24] [$1000] The tooltip of the group profile is displaying a blank space on the right side, making it look weird. Apr 17, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Apr 17, 2023
@MelvinBot
Copy link

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

@MelvinBot
Copy link

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.0-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-04-24. 🎊

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

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

@MelvinBot
Copy link

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:

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

@bfitzexpensify
Copy link
Contributor

Re: regression test, I think it's reasonable to update the Create Group Conversation regression test with an extra step like:

  • Verify the tooltip is correctly spaced when hovering over the profile images of all users in the group

@mollfpr
Copy link
Contributor

mollfpr commented Apr 18, 2023

@bfitzexpensify Yes! That seems an excellent place to put in the regression test.

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Apr 19, 2023
@melvin-bot melvin-bot bot changed the title [HOLD for payment 2023-04-24] [$1000] The tooltip of the group profile is displaying a blank space on the right side, making it look weird. [HOLD for payment 2023-04-26] [HOLD for payment 2023-04-24] [$1000] The tooltip of the group profile is displaying a blank space on the right side, making it look weird. Apr 19, 2023
@MelvinBot
Copy link

MelvinBot commented Apr 19, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.1-3 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-04-26. 🎊

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

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

@MelvinBot
Copy link

MelvinBot commented Apr 19, 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:

  • [@mollfpr] The PR that introduced the bug has been identified. Link to the PR:
  • [@mollfpr] 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:
  • [@mollfpr] 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:
  • [@puneetlath / @bfitzexpensify] Determine if we should create a regression test for this bug.
  • [@mollfpr] 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.
  • [@puneetlath / @bfitzexpensify] Link the GH issue for creating/updating the regression test once above steps have been agreed upon: https://github.com/Expensify/Expensify/issues/278028

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Apr 24, 2023
@bfitzexpensify
Copy link
Contributor

Offers sent out @situchan @Tushu17 @mollfpr

@dukenv0307 I couldn't find you on Upwork - can you please apply to the job here?

Regression test update is in https://github.com/Expensify/Expensify/issues/278028

@dukenv0307
Copy link
Contributor

@bfitzexpensify I've applied, my profile is https://www.upwork.com/freelancers/~01f5cbe690701118a2, thank you!

@bfitzexpensify
Copy link
Contributor

@dukenv0307 offer was sent last week, please accept and I'll finalize payment - thanks!

@dukenv0307
Copy link
Contributor

@bfitzexpensify I've accepted, thanks!

@bfitzexpensify
Copy link
Contributor

Great, that's all paid out now. @mollfpr once you complete the steps in #16800 (comment) we can close this one out.

@mollfpr
Copy link
Contributor

mollfpr commented May 2, 2023

[@mollfpr] The PR that introduced the bug has been identified. Link to the PR:
[@mollfpr] 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:

We have refactored the tooltip body in this PR #15325, but I don't think that PR is wrong doing it.

[@mollfpr] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) to catch this type of bug sooner. Link to discussion:

Regression steps should be enough.

@bfitzexpensify
Copy link
Contributor

Cool, thanks! Agreed with your points. OK, let's close this one out.

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

9 participants