HomePhabricator
Diffusion Comm 83c353c19ccc

[web] introduce the getEmojiKeyboardPosition function

Description

[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:

  1. 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)
  2. 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)
  3. The next best position is to place the emoji keyboard at the bottom of the tooltip (The fourth conditional statement handles this case)
  4. 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

Details

Provenance
ginsuAuthored on Feb 6 2023, 12:14 PM
Reviewer
tomek
Differential Revision
D6632: [web] introduce the getEmojiKeyboardPosition function
Parents
rCOMM4a38858145ac: [keyserver] reorganize rust-node-addon
Branches
Unknown
Tags
Unknown