Has been discussed before on a couple topics:
https://meta.discourse.org/t/show-mini-user-profile-popup-when-clicking-on-mentions-or-avatars-within-an-expanded-reply-thread/10631
https://meta.discourse.org/t/how-do-i-make-clicking-an-mention-open-the-usercard/13982