From f6dde97ec92c377ed454ccb77c767ab0a99c142d Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Wed, 10 May 2023 16:58:14 -0700 Subject: [PATCH] popovers: Fix 'u' keyboard shortcut on messages without avatars. In ab0c5f3092e75857ba85195ce948c504174816a3, it was missed that this code depended on the sender_info_hover CSS class, which is no longer an empty element on messages without a message sender avatar/name element. The logic is still hacky, as it relies on the position of an invisible element, but we're rewriting the positioning logic using Tippy anyway, so it's not worth doing much to make it nicer. Fixes #25496. --- web/src/popovers.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/web/src/popovers.js b/web/src/popovers.js index 5baff665e7..b2538d7314 100644 --- a/web/src/popovers.js +++ b/web/src/popovers.js @@ -670,7 +670,12 @@ export function user_info_popover_manage_menu_handle_keyboard(key) { export function show_sender_info() { const $message = $(".selected_message"); - const $sender = $message.find(".sender_info_hover"); + let $sender = $message.find(".inline_profile_picture"); + if ($sender.length === 0) { + // Messages without an avatar have an invisible message_sender + // element that's roughly in the right place. + $sender = $message.find(".message_sender"); + } const message = message_lists.current.get(rows.id($message)); const user = people.get_by_user_id(message.sender_id);