Refactor findTooltipPosition by removing size calculation from this function and adding new TOP and BOTTOM positions. Also made the return value optional, as we want to handle the case where it is impossible to display the tooltip anywhere.
Now, the naming convention for position is the following:
- the first word indicates on which border of the source object we want to display the tooltip.
- the second word indicates the direction we want to align the tooltip
So LEFT_BOTTOM means we display the tooltip on the left of the source, and it is aligned to the bottom of the source - for examples see: https://linear.app/comm/issue/ENG-1575#comment-ef9727c3