···3939 def refresh_data(self) -> None:
4040 for child in list(self.query(Post)):
4141 child.remove()
4242- try:
4343- self.query_one("#activity-loading").remove()
4444- except Exception:
4545- pass
4242+ for w in self.query("#activity-loading"):
4343+ w.remove()
4644 self.query_one("#activity-scroll").mount(
4745 Static("Loading...", id="activity-loading")
4846 )
···9795 async def load_inbox(self) -> None:
9896 session = self.app.user_session
9997 if not session:
100100- try:
101101- self.query_one("#activity-loading").update("Log in to see your inbox.")
102102- except Exception:
103103- pass
9898+ for w in self.query("#activity-loading"):
9999+ w.update("Log in to see your inbox.")
104100 return
105101106102 from core.records import fetch_inbox
···113109 self.notify("Failed to load inbox.", severity="error")
114110 return
115111116116- try:
117117- self.query_one("#activity-loading").remove()
118118- except Exception:
119119- pass
112112+ for w in self.query("#activity-loading"):
113113+ w.remove()
120114121115 scroll = self.query_one("#activity-scroll")
122116 if not self._items:
···137131 )
138132139133 # select first post
140140- try:
141141- self.query(Post).first().focus()
142142- except Exception:
143143- pass
134134+ posts = list(self.query(Post))
135135+ if posts:
136136+ posts[0].focus()
+2-4
tui/screens/board.py
···7979 lv.index = 0
80808181 # Remove old next page button if present
8282- try:
8383- await self.query_one("#next-page", Button).remove()
8484- except Exception:
8585- pass
8282+ for btn in self.query("#next-page"):
8383+ await btn.remove()
86848785 if next_cursor:
8886 if self.page + 1 >= len(self.cursor_history):
+2-4
tui/screens/compose.py
···160160 return
161161 if self.quote:
162162 self.quote = None
163163- try:
164164- self.query_one("#quote-info").remove()
165165- except Exception:
166166- pass
163163+ for w in self.query("#quote-info"):
164164+ w.remove()
167165 else:
168166 self.quote = self._original_quote
169167 body_preview = self.quote.body[:60] + (
+6-10
tui/screens/thread.py
···6464 yield Footer()
65656666 def on_mount(self) -> None:
6767- try:
6868- self.query(Post).first().focus()
6969- except Exception:
7070- pass
6767+ posts = list(self.query(Post))
6868+ if posts:
6969+ posts[0].focus()
7170 self.load_replies(focus_reply=self._focus_reply)
7271 self._focus_reply = None # only use on first load
7372···131130 )
132131133132 # Focus first reply
134134- try:
135135- replies = [p for p in self.query(Post) if p.collection == lexicon.REPLY]
136136- if replies:
137137- replies[0].focus()
138138- except Exception:
139139- pass
133133+ replies = [p for p in self.query(Post) if p.collection == lexicon.REPLY]
134134+ if replies:
135135+ replies[0].focus()
140136141137 def action_next_page(self) -> None:
142138 if self._page < self._total_pages: