From dbc2b2a83963fa8eb8a751b84c225512b9afa4da Mon Sep 17 00:00:00 2001 From: Aman Agrawal Date: Thu, 16 Mar 2023 10:40:28 +0000 Subject: [PATCH] recent_conversations: Fix unread topics navigation behaviour. When marking an unread topic as read with `unread` filter selected, we don't need to move user a row down since removing the selected row will automatically move the user down. Without this, the user goes down twice which is not intended. --- web/src/recent_topics_ui.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/web/src/recent_topics_ui.js b/web/src/recent_topics_ui.js index bd3814cd87..34e2bf4fc4 100644 --- a/web/src/recent_topics_ui.js +++ b/web/src/recent_topics_ui.js @@ -1263,7 +1263,11 @@ export function initialize() { const topic = $elt.attr("data-topic-name"); unread_ops.mark_topic_as_read(stream_id, topic); } - change_focused_element($elt, "down_arrow"); + // If `unread` filter is selected, the focused topic row gets removed + // and we automatically move one row down. + if (!filters.has("unread")) { + change_focused_element($elt, "down_arrow"); + } }); $("body").on("keydown", ".on_hover_topic_read", ui_util.convert_enter_to_click);