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

fix tooltip position changes after closing fab menu #13671

Merged
merged 1 commit into from
Dec 16, 2022

Conversation

0xmiroslav
Copy link
Contributor

Details

wrap AnimatedPressable with View and move position related styles into parent container so that rotate is applied to only button and parent container position is always fixed regardless of rotation.

Fixed Issues

$ #13638
PROPOSAL: #13638 (comment)

Tests

  1. Login with any account
  2. Hover over Fab icon
  3. Verify that tooltip shows
  4. Click on it to open
  5. Click on it again to close
  6. Verify that tooltip shows again and its position stays the same
  • Verify that no errors appear in the JS console

Offline tests

  1. Login with any account
  2. Disable network
  3. Hover over Fab icon
  4. Verify that tooltip shows
  5. Click on it to open
  6. Click on it again to close
  7. Verify that tooltip shows again and its position stays the same

QA Steps

  1. Login with any account
  2. Hover over Fab icon
  3. Verify that tooltip shows
  4. Click on it to open
  5. Click on it again to close
  6. Verify that tooltip shows again and its position stays the same
  • Verify that no errors appear in the JS console

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • iOS / native
    • Android / native
    • iOS / Safari
    • Android / Chrome
    • MacOS / Chrome
    • MacOS / Desktop
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I followed proper code patterns (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • I verified any copy / text that was added to the app is correct English and approved by marketing by adding the Waiting for Copy label for a copy review on the original GH to get the correct copy.
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such
  • I verified that if a function's arguments changed that all usages have also been updated correctly
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately and each prop has a /** comment above it */
    • The file is named correctly
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
    • Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
    • All JSX used for rendering exists in the render method
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • I have checked off every checkbox in the PR author checklist, including those that don't apply to this PR.

Screenshots/Videos

Web
web.mov
Mobile Web - Chrome
mchrome.mp4
Mobile Web - Safari
msafari.mp4
Desktop
desktop.mov
iOS
ios.mp4
Android
android.mp4

@0xmiroslav 0xmiroslav requested a review from a team as a code owner December 16, 2022 21:31
@melvin-bot melvin-bot bot requested review from luacmartins and thesahindia and removed request for a team December 16, 2022 21:31
@melvin-bot
Copy link

melvin-bot bot commented Dec 16, 2022

@luacmartins @thesahindia One of you needs to copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

Copy link
Contributor

@luacmartins luacmartins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM and tests well! @thesahindia all yours!

@thesahindia
Copy link
Member

On it..

@thesahindia
Copy link
Member

Reviewer Checklist

  • I have verified the author checklist is complete (all boxes are checked off).
  • I verified the correct issue is linked in the ### Fixed Issues section above
  • I verified testing steps are clear and they cover the changes made in this PR
    • I verified the steps for local testing are in the Tests section
    • I verified the steps for Staging and/or Production testing are in the QA steps section
    • I verified the steps cover any possible failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
  • I checked that screenshots or videos are included for tests on all platforms
  • I included screenshots or videos for tests on all platforms
  • I verified tests pass on all platforms & I tested again on:
    • iOS / native
    • Android / native
    • iOS / Safari
    • Android / Chrome
    • MacOS / Chrome
    • MacOS / Desktop
  • If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
  • I verified proper code patterns were followed (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick).
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • I verified any copy / text that was added to the app is correct English and approved by marketing by adding the Waiting for Copy label for a copy review on the original GH to get the correct copy.
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I verified that this PR follows the guidelines as stated in the Review Guidelines
  • I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately and each prop has a /** comment above it */
    • The file is named correctly
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
    • Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
    • All JSX used for rendering exists in the render method
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

Web
Screen.Recording.2022-12-17.at.3.19.12.AM.mov
Mobile Web - Chrome Screenshot 2022-12-17 at 3 37 53 AM
Mobile Web - Safari Screenshot 2022-12-17 at 3 30 27 AM
Desktop
Screen.Recording.2022-12-17.at.3.23.07.AM.mov
iOS Screenshot 2022-12-17 at 3 25 51 AM
Android Screenshot 2022-12-17 at 3 37 40 AM

Copy link
Member

@thesahindia thesahindia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works well for me!

Let's merge @luacmartins

@luacmartins
Copy link
Contributor

Quick work on this one! Thanks everyone!

@luacmartins luacmartins merged commit b0f6785 into Expensify:main Dec 16, 2022
@OSBotify
Copy link
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@github-actions
Copy link
Contributor

Performance Comparison Report 📊

Significant Changes To Duration

There are no entries

Meaningless Changes To Duration

Show entries
Name Duration
TTI 793.402 ms → 828.345 ms (+34.944 ms, +4.4%)
runJsBundle 180.419 ms → 194.344 ms (+13.924 ms, +7.7%)
regularAppStart 0.016 ms → 0.015 ms (-0.001 ms, -5.3%)
nativeLaunch 9.833 ms → 9.613 ms (-0.220 ms, -2.2%)
Show details
Name Duration
TTI Baseline
Mean: 793.402 ms
Stdev: 35.307 ms (4.5%)
Runs: 730.3781930003315 734.8520269999281 755.3238070001826 758.5291149998084 759.5316430004314 760.3213120000437 761.4168790001422 771.8100810004398 772.203169000335 777.4320219997317 778.4225399997085 778.696898999624 780.3389459997416 780.6597389997914 783.4626989997923 785.2605630001053 785.4203989999369 794.2588430000469 794.5637220004573 801.4137549996376 807.1589019997045 809.8610279997811 810.1236279997975 816.5183380004019 818.2894200002775 821.24576099962 823.6585849998519 831.9137019999325 866.122018000111 871.3911640001461 874.8676549997181

Current
Mean: 828.345 ms
Stdev: 31.124 ms (3.8%)
Runs: 764.5586970001459 778.366004999727 782.2800249997526 794.2365119997412 798.5630930000916 810.2895750002936 810.3071079999208 811.059952000156 812.2346780002117 816.1459299996495 817.2215449996293 818.6504769995809 819.5711759999394 824.1252060001716 826.8765759998932 827.5354329999536 829.0560370003805 829.0714779999107 832.5520599996671 833.0852950001135 837.8744029998779 837.9024599995464 841.5855409996584 843.0483100004494 848.3990329997614 850.6086630001664 871.0437009995803 887.1276110000908 895.6307100001723 901.3465619999915
runJsBundle Baseline
Mean: 180.419 ms
Stdev: 18.103 ms (10.0%)
Runs: 157 157 163 166 166 166 167 168 168 169 169 169 170 170 173 174 175 175 177 179 185 186 187 195 196 196 201 208 213 220 228

Current
Mean: 194.344 ms
Stdev: 20.038 ms (10.3%)
Runs: 155 163 163 172 178 178 179 179 179 181 181 185 187 188 192 192 193 195 199 201 202 203 205 205 206 210 210 219 221 225 227 246
regularAppStart Baseline
Mean: 0.016 ms
Stdev: 0.001 ms (5.9%)
Runs: 0.014201000332832336 0.014241999946534634 0.0143630001693964 0.014566999860107899 0.014566999860107899 0.01464799977838993 0.0152580002322793 0.015300000086426735 0.01550300046801567 0.015584000386297703 0.015584999695420265 0.015625 0.0157880000770092 0.015829000622034073 0.015951000154018402 0.016071999445557594 0.01607200037688017 0.01607299968600273 0.016316000372171402 0.01631700061261654 0.016397999599575996 0.016479000449180603 0.016479000449180603 0.0165200000628829 0.016521000303328037 0.016886000521481037 0.01733400020748377 0.017374999821186066 0.017455999739468098 0.017496000044047832

Current
Mean: 0.015 ms
Stdev: 0.001 ms (5.3%)
Runs: 0.013346000574529171 0.013753999955952168 0.014077999629080296 0.014159999787807465 0.014159999787807465 0.014201000332832336 0.0143630001693964 0.014566999860107899 0.01460800040513277 0.014689000323414803 0.014689000323414803 0.014810999855399132 0.014973999932408333 0.014973999932408333 0.01501499954611063 0.015095999464392662 0.015096000395715237 0.015137000009417534 0.015217999927699566 0.015259000472724438 0.015381000004708767 0.015461999922990799 0.015625 0.015666000545024872 0.015747000463306904 0.015829000622034073 0.015990999527275562 0.016112999990582466 0.016479999758303165 0.01696799974888563
nativeLaunch Baseline
Mean: 9.833 ms
Stdev: 1.572 ms (16.0%)
Runs: 8 8 8 8 8 9 9 9 9 9 9 9 9 9 9 10 10 10 10 10 10 10 10 11 11 11 11 13 14 14

Current
Mean: 9.613 ms
Stdev: 1.600 ms (16.6%)
Runs: 7 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 9 9 10 10 10 10 10 10 11 11 11 11 12 14 14

@OSBotify
Copy link
Contributor

🚀 Deployed to staging by @luacmartins in version: 1.2.42-0 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

@OSBotify
Copy link
Contributor

🚀 Deployed to production by @yuwenmemon in version: 1.2.42-2 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants