Skip to content

Commit

Permalink
messages: Show headers if is_search_narrow().
Browse files Browse the repository at this point in the history
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 zulip#1550.
  • Loading branch information
u7327620 committed Oct 24, 2024
1 parent dc4d9bc commit 6527c1f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions zulipterminal/ui_tools/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,14 @@ def need_recipient_header(self) -> bool:
if len(self.model.narrow) == 2 and self.model.narrow[1][0] == "topic":
return False

if self.model.is_search_narrow():
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":
return not (
Expand Down

0 comments on commit 6527c1f

Please sign in to comment.