-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
feat: add/remove reaction #15210
feat: add/remove reaction #15210
Conversation
…no/feat-add-remove-reactions
There was a problem hiding this 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 🎉 LET'S DO THIS!
Waiting for verify_podfile.... |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
// make sure that renderContent isn't mixed with unsupported props | ||
if (__DEV__ && (contextAction.text != null || contextAction.icon != null)) { | ||
throw new Error('Dev error: renderContent() and text/icon cannot be used together.'); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also remove this dev code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Honestly I think this is a good warning to have, I wouldn't mind keeping it
While digging into above console warning, I found performance issue on Lines 203 to 205 in f4ffc7c
|
@stitesExpensify I think it would be good to announce in channel about known issues we discussed in this PR so that contributors or QA team won't do duplicated bug report which we are already aware of and planned to fix. |
🚀 Deployed to staging by https://github.com/stitesExpensify in version: 1.2.81-0 🚀
|
throw new Error('Dev error: renderContent() and text/icon cannot be used together.'); | ||
} | ||
|
||
return contextAction.renderContent(closePopup, payload); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will prefer the following pattern instead of renderContent
if there are no hidden tricks.
- If you want the user to provide UI instead of rendering the default UI via
ContextMenuItem
. - Then we can accept a functional Component instead of Object in
ContextMenuActions
. - It means that the first act of
ContextMenuActions
you added in this PR can simply be a functional component that will accept all the values as props.
This will also remove the possibility of user error where the user can provide text
or icon
and renderContent
together.
🚀 Deployed to production by https://github.com/roryabraham in version: 1.2.81-1 🚀
|
<Pressable | ||
style={({hovered}) => [ | ||
styles.emojiReactionBubble, | ||
StyleUtils.getEmojiReactionBubbleStyle(hovered, hasUserReacted, props.sizeScale), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pressed state styles were missed here. #15813
Friendly FYI: this PR created a very small regression in the copy: #15867. Should've been |
Ach dangit. Thanks for letting me know |
This PR created a regression: #16384. On navigation to Add reaction bubble using keyboard, the emoji picker appears in top left corner. |
With this PR, we have updated the size of emoji in reaction of a message to 28px with a font size of 15px, in mini context menu to 20px with a font size of 13px and in context menu to 34px with a font size of 17px. Those changes might have been missed or not considered in this PR. |
hovered, | ||
pressed, | ||
}) => [ | ||
styles.emojiReactionBubble, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should prevent selection on all buttons where long-press action is supported as it moves the selection around the UI on safari iOS.
#18661
ref={props.innerRef} | ||
focusable | ||
onPress={props.onPress} | ||
accessibilityLabel={props.tooltipText} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Coming from #33547, we should add prop role={CONST.ROLE.BUTTON}
if the Pressable
is a button/icon button to avoid text selection issue on double click.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Details
Implementation for adding and removing reactions, according to:
Known issues:
When sending reactions very rapidly it can happen that a pusher event with stale information overwrites the local state, and thus causing buggy behaviour. This is a known issue with the current architecture. See this video for an example of the bug: https://user-images.githubusercontent.com/16821682/222969430-873513c0-63d5-4a84-95f5-72a13377762e.mov
When editing a message the reactions will get removed. Here pusher sends an event where the
reactions
property in the message object is missing. This needs to be fixed elsewhere I believe.(Done) TODO:
Fixed Issues
$ #15125
PROPOSAL: GH_LINK_ISSUE(COMMENT)
Tests
Quick reactions are working
Test 1: Web specific, hover menu:
Test 2: Quick reactions from context menu
The emoji picker is working
Test 1: Web specific, hover menu:
Test 2: Emoji picker from context menu
Test 3: Emoji picker from reactions
📩 Sending & receiving works
Adding the same reaction twice with different skin tone
Offline tests
QA Steps
See testing steps above
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)ScrollView
component to make it scrollable when more elements are added to the page.Screenshots/Videos
Web
web.mov
Mobile Web - Chrome
Screen.Recording.2023-02-19.at.16.48.58.mov
Mobile Web - Safari
Simulator.Screen.Recording.-.iPhone.14.-.2023-02-19.at.16.45.56.mp4
Desktop
desktop.mov
iOS
Simulator.Screen.Recording.-.iPhone.14.-.2023-02-19.at.16.47.24.mp4
Android
Screen.Recording.2023-02-19.at.16.55.13.mov