Skip to content

PR 2: Made EmojiPicker a Singleton Component #7578

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

Merged
merged 39 commits into from
Feb 21, 2022

Conversation

mananjadhav
Copy link
Collaborator

@mananjadhav mananjadhav commented Feb 4, 2022

Details

  • This is the second PR for the same tagged issue, which makes the EmojiPicker a singleton component by keeping a common ref. Refer the comment [HOLD for payment 2022-04-12] [$2000] Edit Comment - There's no emoji picker when editing a comment #3245 (comment)

  • One change is that earlier we used to set props like updatePreferredSkinTone, etc to the Popover child component. Because we're setting reference for the Popover, I've had to move these props to EmojiPickerMenu separately to index.js and index.native.js

  • Additionally, changed the Popover with PopoverWithMeasuredContent for EmojiPicker

Fixed Issues

$ #3245

Tests

  1. Tested that Emojis work fine as before
  2. Tested the skintone selection for Compose
  3. Tested the frequently used emojis for Compose
  • Verify that no errors appear in the JS console

QA Steps

  1. Go to any chat
  2. Click on EmojiPicker
  3. Select the Emoji and enter
  4. You can change the Skintone and ensure that it works fine as before.
  • Verify that no errors appear in the JS console

Tested On

  • Web
  • Mobile Web
  • Desktop
  • iOS
  • Android

Screenshots

Web

web-emoji-picker-with-singleton

Mobile Web

mweb-emoji-picker-with-singleton

Desktop

desktop-emoji-picker-with-singleton

iOS

ios-emoji-picker-with-singleton

Android

android-emoji-picker-with-singleton

@mananjadhav mananjadhav requested a review from a team as a code owner February 4, 2022 23:15
@MelvinBot MelvinBot requested review from parasharrajat and puneetlath and removed request for a team February 4, 2022 23:15
@mananjadhav mananjadhav changed the title Made EmojiPicker a Singleton Component PR 2: Made EmojiPicker a Singleton Component Feb 4, 2022
@parasharrajat
Copy link
Member

Waiting for First PR to merge....

@mananjadhav
Copy link
Collaborator Author

@parasharrajat I'll pull the main branch and update this PR for you to review.

…singleton

# Conflicts:
#	src/pages/home/report/ReportActionCompose.js
@mananjadhav
Copy link
Collaborator Author

@parasharrajat @puneetlath PR ready for your review.

Comment on lines 127 to 128
width: CONST.EMOJI_PICKER_SIZE,
height: CONST.EMOJI_PICKER_SIZE,
Copy link
Member

Choose a reason for hiding this comment

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

EMOJI_PICKER_SIZE indicates the width of it which can't be used for height. we have to give a static to the picker and create another variable for the height. Could you please ask on the slack what should be the height of the picker? I think 380 - 400 px looks good to me.

we can define Const as:

EMOJI_PICKER: {
WIDTH: 320,
HEIGHT: 380
}

then apply the height to Picker and use to pass to the dimensions.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Okay I can confirm, but when I saw the height in my browser, it was 322, hence I used the same var.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It seems the height was 405 for the Popover. I've used 400 and it looks fine. Do we still need to check on Slack?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, please. I am not a design expert. @shawnborton Could you please help us determine the correct height for EmojiPicker?

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm I'm honestly not too sure, but 400 seems fine to me?

Copy link
Member

Choose a reason for hiding this comment

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

I think 400 is fine too.

Copy link
Member

@parasharrajat parasharrajat Feb 17, 2022

Choose a reason for hiding this comment

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

It is very important that you @mananjadhav take care of the case where screen height is less than 400 then it should just take screen height as before and respect all the margins that are applied

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

take care of the case where screen height is less than 400 then it should just take screen height as before and respect all the margins that are applied

I am just testing everything right now.

Copy link
Collaborator Author

@mananjadhav mananjadhav Feb 17, 2022

Choose a reason for hiding this comment

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

then it should just take screen height as before

Was it working before? Afai can tell, the current picker still gets cut when the screen height is less than 400 on the web. For mobile devices, anyway, we have a bottom docked modal.

Except for the height issue on the web, it is working fine on all the platforms.

Copy link
Member

@parasharrajat parasharrajat left a comment

Choose a reason for hiding this comment

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

Code looking goo. Only one thing missing.

I will test the height thing and let you know.

Co-authored-by: Rajat Parashar <[email protected]>
Copy link
Member

@parasharrajat parasharrajat left a comment

Choose a reason for hiding this comment

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

Small tweaks. But tests well.

@mananjadhav
Copy link
Collaborator Author

PR updated. @parasharrajat @puneetlath

Copy link
Member

@parasharrajat parasharrajat left a comment

Choose a reason for hiding this comment

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

LGTM
cc @puneetlath
🎀 👀 🎀 C+ reviewed

@puneetlath puneetlath merged commit 58f0168 into Expensify:main Feb 21, 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.

@OSBotify
Copy link
Contributor

🚀 Deployed to staging by @puneetlath in version: 1.1.40-0 🚀

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

@OSBotify
Copy link
Contributor

OSBotify commented Mar 1, 2022

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

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

@Stutikuls
Copy link

Stutikuls commented Mar 9, 2022

Issue 1 -

Title- [High]: Chrome + Jaws : Keyboard : 'Change skin tone' control is not accessible using keyboard.
Actual - Focus does not land on the 'Change skin tone' control using keyboard, focus stuck on the 1st smiley.
Expected -'Change skin tone' control should accessible using keyboard.
WCAG failure - 2.1.1
Reproducible in staging?: - Yes
Version Number: - v1.1.40-2
Platforms - Web (Chrome + Jaws), iOS, Desktop (MAC)

7578_Chnage.skintone.is.not.accessibl.using.keyoard.mp4

Issue 2 -

Title- [Medium]: Chrome + Jaws : Screen Reader: Name & Role is not defined for the 'Emoji' control.
Actual - Name & Role is not defined for the 'Emoji' control. Screen reader is reading "type and test etc." when focus lands on the Emoji control.
Expected -Name - 'Emoji' and Role - 'Button' should define for the 'Emoji' control.
WCAG failure - 4.1.2
Reproducible in staging?: - Yes
Version Number: - v1.1.40-2
Platforms - Web (Chrome + Jaws), iOS, Desktop (MAC). Android

7578_Name.role.is.not.defined.for.Emoji.control.mp4

Issue 3 -

Title- [Medium]: Chrome + Jaws : Keyboard: 'Emoji' control is not accessible using screen reader.
Actual - 'Emoji' control is not accessible using screen reader. While press Enter on the control, control is not activated.
Expected -'Emoji' control should activated using screen reader.
WCAG failure - 2.1.1
Reproducible in staging?: - Yes
Version Number: - v1.1.40-2
Platforms - Web (Chrome + Jaws), Mobile -web(iOS)

7598_Emoji.control.is.not.accessible.using.screen.reader.mp4

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.

6 participants