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

Change emoji highlighting type when using keyboard navigation #13485

Merged
merged 14 commits into from
Dec 20, 2022

Conversation

stitesExpensify
Copy link
Contributor

@stitesExpensify stitesExpensify commented Dec 9, 2022

Details

  1. Don't highlight the first emoji when opening the picker.
  2. When you press the down or right arrow key on web/desktop, the first emoji should be highlighted immediately (only one keyboard press instead of 2)

Fixed Issues

$ #13417

Tests

Web/Desktop Test:

  1. Open any chat
  2. Open the emoji picker
  3. Make sure the emoji search bar is focused (blinking cursor)
  4. Press the right arrow ONE time
  5. Make sure the first emoji is now highlighted with a blue outline and the search bar is not focused
  6. Press enter and make sure the emoji is added to the composer
  7. Re-open the emoji picker and search for "smile"
  8. Make sure the first emoji is highlighted with a green background
  9. Press enter and make sure it is added to the composer
  10. Re-open the emoji picker and search for "smile" again
  11. Press the right arrow key
  12. Make sure the background of the emoji changes to a blue highlight
  13. Use the arrow keys to move around the highlighted emoji, it should stay blue outlined
  14. Move the mouse into the emoji picker and make sure the hovered emoji is now highlighted with a green background
  15. Press and arrow key while hovering and make sure the highlight turns back to a blue outline
2022-12-16_15-52-22.mp4

Mobile/MWeb Tests:
N/A

  • Verify that no errors appear in the JS console

Offline tests

Same as online test

QA Steps

Tests

Web/Desktop Test:

  1. Open any chat
  2. Open the emoji picker
  3. Make sure the emoji search bar is focused (blinking cursor)
  4. Press the right arrow ONE time
  5. Make sure the first emoji is now highlighted with a blue outline and the search bar is not focused
  6. Press enter and make sure the emoji is added to the composer
  7. Re-open the emoji picker and search for "smile"
  8. Make sure the first emoji is highlighted with a green background
  9. Press enter and make sure it is added to the composer
  10. Re-open the emoji picker and search for "smile" again
  11. Press the right arrow key
  12. Make sure the background of the emoji changes to a blue highlight
  13. Use the arrow keys to move around the highlighted emoji, it should stay blue outlined
  14. Move the mouse into the emoji picker and make sure the hovered emoji is now highlighted with a green background
  15. Press and arrow key while hovering and make sure the highlight turns back to a blue outline

Mobile/MWeb Test:

  1. Make sure the emoji picker works as expected (these platforms should not be affected by this PR)
  • 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 https://user-images.githubusercontent.com/42391420/208477492-436a349b-7cf6-495b-bab7-853bdf75b653.mp4
Mobile Web - Chrome
2022-12-19_10-07-18.mp4
Mobile Web - Safari
2022-12-19_10-05-20.mp4
Desktop
2022-12-20_08-35-40.mp4
iOS
2022-12-19_10-04-44.mp4
Android
2022-12-19_10-11-04.mp4

@stitesExpensify stitesExpensify self-assigned this Dec 9, 2022
@stitesExpensify stitesExpensify marked this pull request as ready for review December 10, 2022 00:08
@stitesExpensify stitesExpensify requested a review from a team as a code owner December 10, 2022 00:08
@stitesExpensify stitesExpensify requested review from a team and removed request for a team December 10, 2022 00:08
@melvin-bot melvin-bot bot requested review from aimane-chnaif and nkuoch and removed request for a team December 10, 2022 00:08
@melvin-bot
Copy link

melvin-bot bot commented Dec 10, 2022

@aimane-chnaif @nkuoch 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]

@melvin-bot melvin-bot bot requested a review from Luke9389 December 10, 2022 00:08
@melvin-bot
Copy link

melvin-bot bot commented Dec 10, 2022

@aimane-chnaif @Luke9389 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]

@stitesExpensify
Copy link
Contributor Author

Sorry I double pullerbear'd on accident. @Luke9389 i'm going to remove you since you were second.

@aimane-chnaif this doesn't need a C+ IMO, so I'm going to remove you as well 😄

@aimane-chnaif
Copy link
Contributor

@stitesExpensify I can help review and test PR and fill reviewer checklist if needed

nkuoch
nkuoch previously approved these changes Dec 12, 2022
@stitesExpensify stitesExpensify changed the title Only highlight emojis once we start using the keyboard or hovering [HOLD] Only highlight emojis once we start using the keyboard or hovering Dec 12, 2022
@stitesExpensify
Copy link
Contributor Author

Throwing this on hold real quick to do some more of my own testing

@stitesExpensify
Copy link
Contributor Author

I don't think this solution actually works technically. The problem is that if you search for an emoji right now, you can hit enter to choose the first emoji. With this change you can no longer do that which is a regression IMO.

@stitesExpensify stitesExpensify changed the title [HOLD] Only highlight emojis once we start using the keyboard or hovering Only highlight emojis once we start using the keyboard or hovering Dec 19, 2022
@stitesExpensify
Copy link
Contributor Author

Okay, this is off hold and I re-added you for review @aimane-chnaif since this is no longer just a 1 line change.

Updating the test steps now, and then hopefully we can get this out the door!

@stitesExpensify
Copy link
Contributor Author

Okay this is ready to go!

@stitesExpensify stitesExpensify changed the title Only highlight emojis once we start using the keyboard or hovering Change emoji highlighting type when using keyboard navigation Dec 19, 2022
@aimane-chnaif
Copy link
Contributor

aimane-chnaif commented Dec 20, 2022

@stitesExpensify Tab key doesn't work correctly (not related to this PR). I think this is accessibility issue which is not given priority for now.

emoji.tab.mov

Other than that, looks good to me and tests well.

@aimane-chnaif
Copy link
Contributor

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
web.mov
Mobile Web - Chrome

mchrome

Mobile Web - Safari
msafari.mp4
Desktop
desktop.mov
iOS
ios.mp4
Android

android

@stitesExpensify stitesExpensify merged commit e36a3fa into main Dec 20, 2022
@stitesExpensify stitesExpensify deleted the stites-doubleKeyboardPressEmojiPicker branch December 20, 2022 15:36
@stitesExpensify
Copy link
Contributor Author

Thanks @aimane-chnaif ! I updated the test videos in the OP 😄

@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 820.340 ms → 851.239 ms (+30.899 ms, +3.8%)
runJsBundle 195.969 ms → 199.375 ms (+3.406 ms, +1.7%)
nativeLaunch 9.107 ms → 9.296 ms (+0.189 ms, +2.1%)
regularAppStart 0.015 ms → 0.015 ms (+0.000 ms, +0.8%)
Show details
Name Duration
TTI Baseline
Mean: 820.340 ms
Stdev: 30.940 ms (3.8%)
Runs: 760.4974499996752 770.2491340003908 772.6959859998897 788.7462269999087 789.6237740004435 792.4930490003899 794.1449880003929 795.5150669999421 809.9567020004615 817.1067310003564 817.5106750000268 817.6061469996348 818.2780039999634 818.6553349997848 819.1511460002512 820.3455050000921 820.6128390002996 824.2065679999068 827.2394359996542 829.6494709998369 837.2588999997824 839.8196539999917 847.8260080004111 848.0672230003402 849.9755720002577 874.9063560003415 878.1189679997042 889.2498960001394

Current
Mean: 851.239 ms
Stdev: 37.875 ms (4.4%)
Runs: 795.9891440002248 798.1025440003723 800.6933359997347 818.2537850001827 818.7744119996205 819.9692540001124 820.7309809997678 823.3840359998867 824.4938340000808 827.5613909997046 827.8653659997508 828.8593189995736 836.8792430004105 838.195566999726 838.5809699995443 843.0240139998496 845.797543999739 848.2492209998891 852.4143700003624 859.376436999999 860.7791959997267 861.3232340002432 869.111801000312 869.3604600001127 872.3577119996771 886.4223370002583 898.4199219997972 905.6882119998336 921.6620819997042 923.3231640001759 952.7660600002855
runJsBundle Baseline
Mean: 195.969 ms
Stdev: 22.467 ms (11.5%)
Runs: 168 170 171 173 173 174 174 176 177 179 180 181 182 185 190 191 192 192 195 199 201 206 209 212 214 214 215 223 224 233 245 253

Current
Mean: 199.375 ms
Stdev: 22.285 ms (11.2%)
Runs: 164 170 172 174 177 177 178 179 180 181 185 185 190 191 193 196 196 197 201 204 208 208 218 219 219 220 223 225 227 229 242 252
nativeLaunch Baseline
Mean: 9.107 ms
Stdev: 0.772 ms (8.5%)
Runs: 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 9 9 9 9 9 10 10 10 10 10 10 10 11

Current
Mean: 9.296 ms
Stdev: 0.808 ms (8.7%)
Runs: 8 8 8 8 8 9 9 9 9 9 9 9 9 9 9 10 10 10 10 10 10 10 10 10 10 10 11
regularAppStart Baseline
Mean: 0.015 ms
Stdev: 0.002 ms (10.1%)
Runs: 0.012736000120639801 0.01285799965262413 0.013264999724924564 0.013426999561488628 0.01342800073325634 0.013508999720215797 0.013833999633789062 0.013835000805556774 0.013956999406218529 0.014120000414550304 0.014120000414550304 0.014120000414550304 0.014120000414550304 0.014241999946534634 0.014364000409841537 0.014403999783098698 0.01460800040513277 0.014649000018835068 0.014892000705003738 0.0148930000141263 0.015096000395715237 0.015422000549733639 0.015463000163435936 0.015625 0.015950999222695827 0.01607299968600273 0.016521000303328037 0.017619000747799873 0.017822000198066235 0.018269000574946404 0.018432000651955605

Current
Mean: 0.015 ms
Stdev: 0.001 ms (5.6%)
Runs: 0.013264999724924564 0.014077999629080296 0.014079000800848007 0.014079000800848007 0.014159999787807465 0.014200999401509762 0.014201000332832336 0.0143630001693964 0.01444500032812357 0.014485999941825867 0.014527000486850739 0.014566999860107899 0.014607000164687634 0.014729000627994537 0.014810999855399132 0.014852000400424004 0.014933999627828598 0.014973999932408333 0.015015000477433205 0.015176999382674694 0.015177000313997269 0.015259000472724438 0.015381000004708767 0.015421000309288502 0.015461999922990799 0.015542999841272831 0.016153999604284763 0.016195000149309635 0.01631700061261654 0.01639800053089857 0.0166830001398921 0.016764000058174133

@OSBotify
Copy link
Contributor

🚀 Deployed to staging by @stitesExpensify in version: 1.2.43-0 🚀

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

@OSBotify
Copy link
Contributor

🚀 Deployed to production by @chiragsalian in version: 1.2.43-1 🚀

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.

4 participants