From 0c1d35061de02ab1ec688a78ba790a36192d3207 Mon Sep 17 00:00:00 2001 From: u7327620 Date: Sun, 20 Oct 2024 19:51:35 +1100 Subject: [PATCH] messages: Show headers if is_search_narrow(). Previously, when text searching, messages appear adjacently under the same heading, this can be confusing since they appear sequentially but there may be messages inbetween that don't meet the search criteria. Fixes part of #1550. --- zulipterminal/ui_tools/messages.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/zulipterminal/ui_tools/messages.py b/zulipterminal/ui_tools/messages.py index 0fa8ea7fb2..c19ce3221a 100644 --- a/zulipterminal/ui_tools/messages.py +++ b/zulipterminal/ui_tools/messages.py @@ -120,8 +120,14 @@ def need_recipient_header(self) -> bool: return False if len(self.model.narrow) == 2 and self.model.narrow[1][0] == "topic": return False + if self.model.is_search_narrow(): - return True + if len(self.model.narrow) == 1: + return True + if len(self.model.narrow) == 2: + return self.message["type"] != "private" + if len(self.model.narrow) == 3: + return self.model.narrow[1][0] != "topic" last_msg = self.last_message if self.message["type"] == "stream":