@@ -686,22 +686,23 @@ def main_view(self) -> List[Any]:
686
686
687
687
if any_differences : # Construct content_header, if needed
688
688
text_keys = ("author" , "star" , "time" , "status" )
689
- text : Dict [str , urwid_MarkupTuple ] = {key : (None , " " ) for key in text_keys }
689
+ text : Dict [str , List [urwid_MarkupTuple ]] = {
690
+ key : [(None , " " )] for key in text_keys
691
+ }
690
692
691
693
if any (
692
694
different [key ] for key in ("recipients" , "author" , "author_id" , "24h" )
693
695
):
694
696
if self .model .is_user_name_duplicate (message ["this" ]["author" ]):
695
- text ["author" ] = (
696
- "msg_sender" ,
697
- message ["this" ]["author" ]
698
- + " "
699
- + "("
700
- + str (message ["this" ]["author_id" ])
701
- + ")" ,
702
- )
697
+ text ["author" ] = [
698
+ ("msg_sender" , message ["this" ]["author" ]),
699
+ (
700
+ "msg_mention" ,
701
+ f" ({ message ['this' ]['author_id' ]} )" ,
702
+ ),
703
+ ]
703
704
else :
704
- text ["author" ] = ("msg_sender" , message ["this" ]["author" ])
705
+ text ["author" ] = [ ("msg_sender" , message ["this" ]["author" ])]
705
706
# TODO: Refactor to use user ids for look up instead of emails.
706
707
email = self .message .get ("sender_email" , "" )
707
708
user = self .model .user_dict .get (email , None )
@@ -711,17 +712,17 @@ def main_view(self) -> List[Any]:
711
712
712
713
# The default text['status'] value is (None, ' ')
713
714
if status in STATE_ICON :
714
- text ["status" ] = (f"user_{ status } " , STATE_ICON [status ])
715
+ text ["status" ] = [ (f"user_{ status } " , STATE_ICON [status ])]
715
716
716
717
if message ["this" ]["is_starred" ]:
717
- text ["star" ] = ("starred" , "*" )
718
+ text ["star" ] = [ ("starred" , "*" )]
718
719
if any (different [key ] for key in ("recipients" , "author" , "timestamp" )):
719
720
this_year = date .today ().year
720
721
msg_year = message ["this" ]["datetime" ].year
721
722
if this_year != msg_year :
722
- text ["time" ] = ("time" , f"{ msg_year } - { message ['this' ]['time' ]} " )
723
+ text ["time" ] = [ ("time" , f"{ msg_year } - { message ['this' ]['time' ]} " )]
723
724
else :
724
- text ["time" ] = ("time" , message ["this" ]["time" ])
725
+ text ["time" ] = [ ("time" , message ["this" ]["time" ])]
725
726
726
727
content_header = urwid .Columns (
727
728
[
0 commit comments