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

Set hover status to false on blur #14377

Merged
merged 1 commit into from
Jan 18, 2023
Merged

Conversation

s77rt
Copy link
Contributor

@s77rt s77rt commented Jan 17, 2023

Details

  1. Set hover status to false on blur
  2. Removed resetHoverStateOnOutsideClick which is no longer required (thanks to 1)

$ #14080
PROPOSAL: #14080 (comment)

Tests

  1. Open context menu for any message item
  2. Choose edit comment
  3. Click cancel or save changes
  4. Verify that the message item is not hovered
  5. Open an attachment (modal) in chat
  6. Close the modal
  7. Verify that the message item of that attachment is not hovered
  • Verify that no errors appear in the JS console

Offline tests

n/a

QA Steps

  1. Open context menu for any message item
  2. Choose edit comment
  3. Click cancel or save changes
  4. Verify that the message item is not hovered
  5. Open an attachment (modal) in chat
  6. Close the modal
  7. Verify that the message item of that attachment is not hovered
  • 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:
    • Android / native
    • Android / Chrome
    • iOS / native
    • iOS / Safari
    • MacOS / Chrome / Safari
    • 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
      • If any non-english text was added/modified, I verified the translation was requested/reviewed in #expensify-open-source and it was approved by an internal Expensify engineer. Link to Slack message:
    • 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.mp4
Mobile Web - Chrome
mweb-chrome.mp4
Mobile Web - Safari
mweb-safari.mp4
Desktop
desktop.mp4
iOS
ios.mp4
Android
android.mp4

@s77rt s77rt requested a review from a team as a code owner January 17, 2023 21:33
@melvin-bot melvin-bot bot requested review from ctkochan22 and removed request for a team January 17, 2023 21:33
@melvin-bot
Copy link

melvin-bot bot commented Jan 17, 2023

@ctkochan22 Please 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]

@mananjadhav
Copy link
Collaborator

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:
    • Android / native
    • Android / Chrome
    • iOS / native
    • iOS / Safari
    • MacOS / Chrome / Safari
    • 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

Before:

web-report-hover-before-fix.mov

After:

web-report-hover.mov
Mobile Web - Chrome
mweb-chrome-report-hover.mov
Mobile Web - Safari
mweb-safari-report-hover.mov
Desktop
desktop-report-hover.mov
iOS
ios-report-hover.mov
Android
android-report-hover.mov

Thanks for the quick PR @s77rt.

@ctkochan22 I was finally able to reproduce the issue. Thanks for the comment. I've added the before fix video. I've also checked the following component:

  • Tooltip
  • New Group/Search Options List
  • Workspace Members Page

Let me know if anything else needs to be tested here.

@ctkochan22
Copy link
Contributor

Great work testing! Thank you @mananjadhav

@ctkochan22 ctkochan22 merged commit ec5e756 into Expensify:main Jan 18, 2023
@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
App start TTI 679.897 ms → 695.387 ms (+15.490 ms, +2.3%)
App start runJsBundle 189.844 ms → 195.719 ms (+5.875 ms, +3.1%)
App start nativeLaunch 19.333 ms → 20.167 ms (+0.833 ms, +4.3%)
App start regularAppStart 0.016 ms → 0.015 ms (-0.001 ms, -7.4%)
Open Search Page TTI 616.907 ms → 607.967 ms (-8.940 ms, -1.4%)
Show details
Name Duration
App start TTI Baseline
Mean: 679.897 ms
Stdev: 33.625 ms (4.9%)
Runs: 626.1809260000009 635.6614449999761 638.9166079999413 639.8253430000041 644.2339759999886 649.4601199999452 654.4565950001124 655.6102700000629 657.156534000067 657.3461130000651 659.3918500000145 662.4199119999539 662.7745680001099 664.3931980000343 674.5180649999529 675.1718810000457 675.2083129999228 675.8987590000033 680.7911910000257 681.868465000065 687.9237850001082 688.4835800000001 689.1380040000658 694.5418839999475 698.2479540000204 704.3907480000053 723.1155139999464 727.5043599999044 727.6038049999624 730.6037530000322 754.051720000105 759.8019220000133

Current
Mean: 695.387 ms
Stdev: 27.647 ms (4.0%)
Runs: 651.128279000055 651.7335359998979 655.9440850000829 656.2949210000224 661.8340390000958 665.1605710000731 666.4899440000299 673.5602680000011 675.5984400000889 681.9855820001103 684.1634009999689 685.2927029998973 687.1068690000102 689.8381550000049 696.5416759999935 699.0023560000118 700.431760000065 701.3286160000134 702.2189929999877 702.8109959999565 708.9062590000685 716.7208279999904 720.2753220000304 721.2899249999318 724.3018839999568 729.3779959999956 729.9710099999793 731.2645550000016 737.5726640000939 753.4653739999048
App start runJsBundle Baseline
Mean: 189.844 ms
Stdev: 21.284 ms (11.2%)
Runs: 155 161 170 171 173 173 174 175 175 176 177 177 178 178 181 182 185 188 190 190 193 193 195 195 205 210 211 212 223 225 237 247

Current
Mean: 195.719 ms
Stdev: 24.354 ms (12.4%)
Runs: 167 168 170 171 171 173 174 177 178 179 180 183 185 185 185 186 188 188 192 195 196 196 203 209 214 227 228 228 232 234 241 260
App start nativeLaunch Baseline
Mean: 19.333 ms
Stdev: 1.680 ms (8.7%)
Runs: 17 17 18 18 18 18 18 18 18 18 18 19 19 19 19 19 19 19 19 20 20 20 20 20 21 21 21 22 22 25

Current
Mean: 20.167 ms
Stdev: 2.146 ms (10.6%)
Runs: 17 17 18 18 18 19 19 19 19 19 19 19 19 20 20 20 20 20 20 20 20 21 21 21 22 22 22 25 25 26
App start regularAppStart Baseline
Mean: 0.016 ms
Stdev: 0.001 ms (7.3%)
Runs: 0.013916000025346875 0.014810999855399132 0.014851999934762716 0.0148930000141263 0.014973999932408333 0.015015000011771917 0.015015000011771917 0.01509599993005395 0.015217999927699566 0.015340999932959676 0.015583999920636415 0.01566599984653294 0.015829000156372786 0.015870000002905726 0.015909999841824174 0.015910000074654818 0.015949999913573265 0.01619499991647899 0.016559999901801348 0.016764000058174133 0.016887000063434243 0.01692699990235269 0.016928000142797828 0.017171000130474567 0.01721199997700751 0.017333999974653125 0.017577999969944358 0.01782199996523559 0.019530999939888716

Current
Mean: 0.015 ms
Stdev: 0.001 ms (6.4%)
Runs: 0.013590000104159117 0.013672000030055642 0.013712999876588583 0.01383400009945035 0.014118999941274524 0.014160000020638108 0.01424099993892014 0.014241000171750784 0.014282999793067575 0.014322999864816666 0.01432300009764731 0.014405000023543835 0.014444999862462282 0.014445000095292926 0.014527000021189451 0.01460699993185699 0.014648000011220574 0.014688999857753515 0.014688999857753515 0.0148930000141263 0.015015000011771917 0.015257999999448657 0.015503000002354383 0.0157880000770092 0.015868999995291233 0.01590899983420968 0.015949999913573265 0.016357999993488193 0.016601999988779426 0.01692699990235269 0.01700900006107986
Open Search Page TTI Baseline
Mean: 616.907 ms
Stdev: 20.857 ms (3.4%)
Runs: 582.9096270001028 588.9082849998958 594.0166019999888 596.2508549999911 596.5178640000522 597.1883960000705 597.6479489998892 601.3013110000174 601.7805990001652 604.4781489998568 605.0081380000338 605.1683360000607 608.9122719999868 609.0351970000193 609.0745440002065 609.8517259999644 611.0865479998756 611.5338540000375 613.8066410000902 613.9263110000174 616.5168459999841 617.4086100000422 626.5770270000212 626.8266199999489 631.7462570001371 636.5821539999451 637.2329510001 637.8006589999422 643.0773530001752 645.8182789999992 646.4831540000159 661.5338139999658 671.9387209999841

Current
Mean: 607.967 ms
Stdev: 29.168 ms (4.8%)
Runs: 567.4772129999474 573.5827639999334 575.0290119999554 575.7373450000305 578.3584389998578 580.0651460001245 581.4982100001071 585.0988369998522 586.2278650000226 586.5698659999762 590.7598470000084 592.7657059999183 596.5663250000216 596.7883300001267 599.6407469999976 601.520712000085 602.1775720000733 603.3267419999465 603.8743489999324 603.8846430000849 607.3540860000066 608.1929929999169 610.1719969999976 612.2527669998817 615.2167980000377 623.9768880000338 639.7318120000418 650.3199879999738 657.7733570002019 659.7463789999019 661.6385500000324 666.5758060000371 669.0107419998385

@OSBotify
Copy link
Contributor

🚀 Deployed to staging by https://github.com/ctkochan22 in version: 1.2.57-0 🚀

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

@OSBotify
Copy link
Contributor

🚀 Deployed to production by https://github.com/luacmartins in version: 1.2.57-3 🚀

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

@sobitneupane
Copy link
Contributor

This PR caused this issue.

Issue: If you press and hold on a message and then release the press, the hover effect will be lost

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.

5 participants