This commit is contained in:
2026-01-31 19:00:04 -08:00
parent dcf16e0cc4
commit 6513a3ad04
25 changed files with 617 additions and 397 deletions

View File

@@ -8,6 +8,8 @@ from textual.screen import ModalScreen
from textual.widgets import Static, Button, Checkbox, ListView, ListItem
from textual import work
from rich.text import Text
import logging
logger = logging.getLogger(__name__)
class MatrixRoomPicker(ModalScreen[List[str]]):
@@ -121,7 +123,7 @@ class MatrixRoomPicker(ModalScreen[List[str]]):
# Stop propagation so parent handlers (ConfigModal) don't react.
event.stop()
except Exception:
pass
logger.exception("Failed to stop ListView.Selected event propagation")
def _set_status(self, text: str) -> None:
if self._status_widget:
@@ -137,6 +139,7 @@ class MatrixRoomPicker(ModalScreen[List[str]]):
any_selected = True
break
except Exception:
logger.exception("Error querying checkbox in MatrixRoomPicker; skipping")
continue
if self._save_button:
self._save_button.disabled = not any_selected
@@ -214,7 +217,7 @@ class MatrixRoomPicker(ModalScreen[List[str]]):
cb = self.query_one(f"#{checkbox_id}", Checkbox)
cb.value = True
except Exception:
pass
logger.exception("Failed to set checkbox value in MatrixRoomPicker")
if self._save_button:
self._save_button.disabled = False
elif event.button.id == "matrix-room-clear":
@@ -223,7 +226,7 @@ class MatrixRoomPicker(ModalScreen[List[str]]):
cb = self.query_one(f"#{checkbox_id}", Checkbox)
cb.value = False
except Exception:
pass
logger.exception("Failed to set checkbox value to False in MatrixRoomPicker")
if self._save_button:
self._save_button.disabled = True
elif event.button.id == "matrix-room-save":
@@ -234,5 +237,5 @@ class MatrixRoomPicker(ModalScreen[List[str]]):
if cb.value and room_id:
selected.append(room_id)
except Exception:
pass
logger.exception("Failed to read checkbox state for '%s' while saving MatrixRoomPicker selection", checkbox_id)
self.dismiss(selected)