@@ -51,7 +51,6 @@ class _MessageEditState(NamedTuple):
5151 message_id: int
5252 old_topic: str
5353
54-
5554class MessageBox(urwid.Pile):
5655 # type of last_message is Optional[Message], but needs refactoring
5756 def __init__(self, message: Message, model: "Model", last_message: Any) -> None:
@@ -1189,3 +1188,34 @@ def keypress(self, size: urwid_Size, key: str) -> Optional[str]:
11891188 elif is_command_key("MSG_SENDER_INFO", key):
11901189 self.model.controller.show_msg_sender_info(self.message["sender_id"])
11911190 return key
1191+
1192+ class PlaceholderMessageBox(urwid.WidgetWrap):
1193+ def __init__(self, text: str) -> None:
1194+ self.message = {"id": -1} # So it doesn’t explode when accessed
1195+ text_widget = urwid.Text(text)
1196+ self.original_widget = self # Trickery: mimic MessageBox
1197+
1198+ super().__init__(text_widget)
1199+
1200+ def recipient_header(self) -> Any:
1201+ return urwid.Text("") # Blank for empty narrow
1202+
1203+ def top_search_bar(self) -> Any:
1204+ return urwid.Text("") # Stub for compatibility
1205+
1206+ def update_message_author_status(self) -> None:
1207+ pass # Stub for compatibility
1208+
1209+ def keypress(self, size: Tuple[int, int], key: str) -> None:
1210+ if is_command_key("GO_DOWN", key):
1211+ return None
1212+ if is_command_key("GO_UP", key):
1213+ return None
1214+
1215+ elif is_command_key("GO_LEFT", key):
1216+ self.view.show_left_panel(visible=True)
1217+ return None
1218+
1219+ elif is_command_key("GO_RIGHT", key):
1220+ self.view.show_right_panel(visible=True)
1221+ return None
0 commit comments