When a user interacts with the inline engagement in the modal displaying pinned messages for the thread, we need to handle two cases: 1) keep the modal in the background when the reactions list is displayed, and 2) pop the modal when the replies engagement is clicked to navigate to the thread. The first is already handled by the nature of `pushModal` and `popModal`, but we need to handle the second one.
This diff pops the modal (if a modal exists) before navigating to the thread. This will also be useful for the message search implementation since I think the designs are closely shared (not too certain about it though).
Linear: https://linear.app/comm/issue/ENG-3450/allow-interaction-with-inline-engagement-from-thread-pinned-messages
Depends on D7380