[web] introduce the getEmojiKeyboardPosition function
Summary:
introduce the getEmojiKeyboardPosition function to reaction-message-utils
getEmojiKeyboardPosition will try to find the best position to place the emoji keyboard. Here is how I ranked the positions of the emoji keyboard:
- The best position is to place the emoji keyboard to the right/left of the tooltip where it doesn't cover the message being reacted to. (The first two conditional statements handle this case)
- The next best position is to place the emoji keyboard at the top of the tooltip. I ranked the top position over the bottom position purely out of personal preference, but if we want to switch, we can do that. (The third conditional statement handles this case)
- The next best position is to place the emoji keyboard at the bottom of the tooltip (The fourth conditional statement handles this case)
- If all fails, we can resort to placing the emoji keyboard to the left/right of the tooltip, where it does cover the message being reacted to. This is not ideal, so is ranked last, but is better than having the emoji keyboard overflow off of the screen.
Depends on D6786
Linear Task: ENG-2849
Test Plan:
Please watch the demo videos below to see the different cases mentioned above (Please note that D6634 will actually call and implement this logic)
Best case:
2nd best case:
3rd best case:
4th best case:
Reviewers: atul, tomek, rohan
Reviewed By: tomek
Subscribers: ashoat, tomek, atul
Differential Revision: https://phab.comm.dev/D6632