Skip to content
Open
17 changes: 16 additions & 1 deletion zulipterminal/ui_tools/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,23 @@ def private_header(self) -> Any:
header.markup = title_markup
return header

def empty_narrow_header(self) -> Any:
title_markup = ("header", [("general_narrow", "No selected message")])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering if it would be clearer to simply leave this blank?

title = urwid.Text(title_markup)
header = urwid.Columns(
[
("pack", title),
(1, urwid.Text(("general_bar", " "))),
urwid.AttrWrap(urwid.Divider(MESSAGE_HEADER_DIVIDER), "general_bar"),
]
)
header.markup = title_markup
return header

def recipient_header(self) -> Any:
if self.message["type"] == "stream":
if self.model.controller.is_in_empty_narrow:
return self.empty_narrow_header()
elif self.message["type"] == "stream":
Comment on lines -202 to +218
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a partial fix towards the issue? That is, we start to show a different message in the message header and the current-message header? Assuming so, the commit text could indicate that.

Does the new header structure need to follow the form of the others? I know it's rather hacky in places, so it's likely fine for now.

return self.stream_header()
else:
return self.private_header()
Expand Down