Skip to content

Commit 244b819

Browse files
committed
boxes: Use styled space in recipient header between recipients and line.
This improves consistency between how private and stream message recipient headers are shown. For private messages, this avoids the space being spuriously highlighted (selected) when the message underneath is selected, as a separate space in the columns was not previously styled. For stream messages, this ensures that the stream/topic text is separated from the line/bar by a space, if it wraps onto a second line; previously the space was part of the stream/topic text. Tests amended.
1 parent 949e64d commit 244b819

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

tests/ui/test_ui_tools.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1716,7 +1716,8 @@ def test_main_view_generates_stream_header(self, mocker, message,
17161716
assert isinstance(view_components[0], Columns)
17171717

17181718
assert isinstance(view_components[0][0], Text)
1719-
assert isinstance(view_components[0][1], Divider)
1719+
assert isinstance(view_components[0][1], Text)
1720+
assert isinstance(view_components[0][2], Divider)
17201721

17211722
@pytest.mark.parametrize('message', [
17221723
{

zulipterminal/ui_tools/boxes.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,11 +287,12 @@ def stream_header(self) -> Any:
287287
stream_title_markup = ('bar', [
288288
(bar_color, '{} {} '.format(self.stream_name,
289289
stream_topic_separator)),
290-
('title', ' {} '.format(self.topic_name))
290+
('title', ' {}'.format(self.topic_name))
291291
])
292292
stream_title = urwid.Text(stream_title_markup)
293293
header = urwid.Columns([
294294
('pack', stream_title),
295+
(1, urwid.Text((color, ' '))),
295296
urwid.AttrWrap(urwid.Divider('━'), color),
296297
])
297298
header.markup = stream_title_markup
@@ -305,7 +306,7 @@ def private_header(self) -> Any:
305306
title = urwid.Text(title_markup)
306307
header = urwid.Columns([
307308
('pack', title),
308-
(1, urwid.Text(' ')),
309+
(1, urwid.Text(('general_bar', ' '))),
309310
urwid.AttrWrap(urwid.Divider('━'), 'general_bar'),
310311
])
311312
header.markup = title_markup

0 commit comments

Comments
 (0)