Closed kavimuru closed 1 year ago
Triggered auto assignment to @michaelhaxhiu (Bug
), see https://stackoverflow.com/c/expensify/questions/14418 for more details.
Platforms
in OP are β
)@michaelhaxhiu Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
@michaelhaxhiu 6 days overdue. This is scarier than being forced to listen to Vogon poetry!
Job added to Upwork: https://www.upwork.com/jobs/~01b7a7c818708f281d
Current assignee @michaelhaxhiu is eligible for the External assigner, not assigning anyone new.
Triggered auto assignment to Contributor-plus team member for initial proposal review - @mananjadhav (External
)
Triggered auto assignment to @amyevans (External
), see https://stackoverflow.com/c/expensify/questions/7972 for more details.
Going external, this one is reproducible & valid!
Might be helpful I think issue is caused here: https://github.com/Expensify/App/blob/57388640eb97255c0089c4c316d13747b6a1dd34/src/components/Tooltip/TooltipRenderedOnPageBody.js#L101
When tooltip content changes we let the width be determined itself by setting width to undefined
and immediately after that recalculate the width and provide it manually.
Tooltip flickers when the content of the tooltip changes.
If we slow down the video, we can see that when the tooltip content changes, the position of the tooltip is late to update.
Currently, we position the tooltip based on the component width and the tooltip width itself. When the tooltip content changes, the onLayout
callback will be called to update the new tooltip width.
https://github.com/Expensify/App/blob/6fb096948d862ee008445f809cff3ecd51b36f55/src/components/Tooltip/TooltipRenderedOnPageBody.js#L177-L178
https://github.com/Expensify/App/blob/6fb096948d862ee008445f809cff3ecd51b36f55/src/components/Tooltip/TooltipRenderedOnPageBody.js#L119-L124
As we can see, we will update the state inside onLayout
callback, which could be late because the state is updated after the text content is updated.
content updated -> rendered -> onLayout -> width/height updated -> rendered
To calculate the size earlier, we can use useLayoutEffect (even the doc example uses tooltip as an example π€£) which means we need to migrate the component to functional. Here is what we need to do:
useLayoutEffect
with props.text
as the dependency array. Inside the hook:
2a. Get the width and height from getBoundingClientRect
2b. If both height & width is not 0, set the tooltip width and heightPreviously the main proposal
Instead of relying on a fixed unit (tooltip width), we can use a percentage value to position the tooltip.
Remove tooltipWidth calculation from here https://github.com/Expensify/App/blob/6fb096948d862ee008445f809cff3ecd51b36f55/src/styles/getTooltipStyles.js#L187
Add translateX -50% here (translateX should be put before the scale) https://github.com/Expensify/App/blob/6fb096948d862ee008445f809cff3ecd51b36f55/src/styles/getTooltipStyles.js#L139-L146
Change the left to 50% and add transform: [{translateX: '-50%'}, {translateX: -horizontalShift}]
here
https://github.com/Expensify/App/blob/6fb096948d862ee008445f809cff3ecd51b36f55/src/styles/getTooltipStyles.js#L222
I think @bernhardoj proposal looks good. We'll just have to check any regression absolute tooltips.
@amyevans all youts.
Just tested that my proposal won't cover the case when the tooltip is at the edge of the screen. That is because we still use tooltipWidth
to calculate horizontalShift
Updated my proposal to cover all cases with useLayoutEffect
Niiiice one @bernhardoj thanks for being proactive on that. Let's get final π from @amyevans and I'll proceed with assigning you.
Proposal looks great, assigning you @bernhardoj π
We should be able to close out https://github.com/Expensify/App/issues/16211 as a byproduct of the bug fix as well πͺ, 2 π¦ 1 π₯
π£ @bernhardoj You have been assigned to this job by @amyevans! Please apply to this job in Upwork 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 π
Will open the PR soon
PR is ready.
Thanks for the fast work @bernhardoj, next step is to get this reviewed by @mananjadhav
I've started with the review and going through the updated changes by @bernhardoj. Relatively larger than expected as we're changing the class component to functional component.
Reviewing
label has been removed, please complete the "BugZero Checklist".
The solution for this issue has been :rocket: deployed to production :rocket: in version 1.3.12-0 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2023-05-16. :confetti_ball:
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.
As a reminder, here are the bonuses/penalties that should be applied for any External issue:
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:
@amyevans I couldn't pinpoint to the exact PR causing this. We've been using measureTooltip since a long time. I am suspecting this PR must've caused it https://github.com/Expensify/App/pull/8494 but I couldn't confirm by running the specific branch.
Also, considering this isn't going to change that often, and we've moved to a functional component, I don't think we need a regression test here. @amyevans @michaelhaxhiu if you still feel we should add one, here's a proposal.
Regression Test Proposal
I think this is not a regression as the initial implementation of the Tooltip has been using onLayout
.
Btw, we have a regression (my bad) here https://github.com/Expensify/App/issues/18878#issuecomment-1550365511. I have found the issue and let me know if I should open the PR now.
cc: @mananjadhav @amyevans
Yeah @bernhardoj please open the PR.
PR is ready. https://github.com/Expensify/App/pull/19097
Please nudge me if I don't respond when it's time to process payment here (e.g. after the regression PR is merged and cleared)
Putting a date in the title that's more realistic, just so this doesn't appear behind.
Also, considering this isn't going to change that often, and we've moved to a functional component, I don't think we need a regression test here.
Agreed, I don't think we need to add a regression test for this.
Reviewing
label has been removed, please complete the "BugZero Checklist".
The solution for this issue has been :rocket: deployed to production :rocket: in version 1.3.17-5 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2023-06-01. :confetti_ball:
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.
As a reminder, here are the bonuses/penalties that should be applied for any External issue:
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:
The solution for this issue has been :rocket: deployed to production :rocket: in version 1.3.18-2 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2023-06-02. :confetti_ball:
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.
As a reminder, here are the bonuses/penalties that should be applied for any External issue:
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:
@michaelhaxhiu Here's the last comment wrt to the Tooltip and @amyevans's response. This is ready for payout now, but also note it caused two regressions.
Also I think @dukenv0307 is due reporting bonus for reporting the bug here
Actually, we still have 2 regression to be solved.
I'm actually waiting for this PR to reach staging before fixing those 2 regression. As it is already reached staging, I will work on this now. So, maybe we can hold the payment for this fix, is that okay?
@mananjadhav @amyevans
Thanks for the insight! Agreed w/ @bernhardoj, let's hold payment until after those regressions are fully resolved.
I have open the PR to fix the regressions here https://github.com/Expensify/App/pull/20340. Hopefully this will be the last one.
cc: @amyevans @mananjadhav
Please allow me a day to review. I am unwell and would be offline most of the day.
I checked the PR. The changes look fine, but @michaelhaxhiu @kavimuru do we have a set of regression test suite that you can share wrt Tooltips? I just want to make sure we cover everything before we go ahead and merge this one?
Quick bump @michaelhaxhiu @kavimuru @amyevans if you can help with the previous comment?
hmm maybe we can ask @applausebot for their input as they interact the most with the test suites, I'm not sure off the top!
@kavimuru @applausebot Quick bump.
@isagoico recommended the following from our internal slack channel π§
We currently don't have tests to cover that tooltip. Imho we can add these tests to the TC that I shared above:
Thanks I think it won't cover all the regressions, may be with this issue we could update the Tooltip regressions along the way? I'll start with the given list and some that I am aware of.
On top of my head I can think of:
@michaelhaxhiu I'll need a day to cover the testing for all the scenarios and still keeping π€. I don't want to add any more regressions π
Should we pay this out and hold the regression tests as the final step?
Since there was 2 regressions, the payout would be as follows:
@michaelhaxhiu There's still another PR (https://github.com/Expensify/App/pull/20340) awaiting review/deployment/holding period so I'm not sure we're clear to proceed
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:
The tooltip transition is Jittery when the tooltip text changes.
Actual Result:
You shouldn't see any shaking/jitter in the transition.
Workaround:
Can the user still use Expensify without this being fixed? Have you informed them of the workaround?
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1.3.1 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
https://user-images.githubusercontent.com/43996225/232654771-8182efd6-d634-40e9-b1b8-fc5f8a4d8efd.mp4
https://user-images.githubusercontent.com/43996225/232654786-3a83e4f3-19b9-4403-8df5-a8f864b32925.mov
Expensify/Expensify Issue URL: Issue reported by: @dukenv0307 Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1681726366513289
View all open jobs on GitHub
Upwork Automation - Do Not Edit