diff --git a/zulipterminal/ui_tools/messages.py b/zulipterminal/ui_tools/messages.py index 2e5742a065..bf128dcc29 100644 --- a/zulipterminal/ui_tools/messages.py +++ b/zulipterminal/ui_tools/messages.py @@ -33,7 +33,7 @@ from zulipterminal.server_url import near_message_url from zulipterminal.ui_tools.tables import render_table from zulipterminal.urwid_types import urwid_MarkupTuple, urwid_Size -from zulipterminal.widget import find_widget_type +from zulipterminal.widget import find_widget_type, process_todo_widget if typing.TYPE_CHECKING: @@ -733,6 +733,24 @@ def main_view(self) -> List[Any]: if self.message.get("submessages"): widget_type = find_widget_type(self.message.get("submessages")) + if widget_type == "todo": + title, tasks = process_todo_widget(self.message.get("submessages")) + + todo_widget = f"{title}" + + if tasks: + for task_id, task_info in tasks.items(): + status = "[✔ ]" if task_info["completed"] else "[ ]" + task_name = task_info["task"] + task_description = task_info["desc"] + + if task_description == "": + todo_widget += f"\n{status} {task_name}" + else: + todo_widget += f"\n{status} {task_name}: {task_description}" + + self.message["content"] = todo_widget + # Transform raw message content into markup (As needed by urwid.Text) content, self.message_links, self.time_mentions = self.transform_content( self.message["content"], self.model.server_url