Retro Bulletin Board Systems on atproto. Web app and TUI. lazy mirror of alyraffauf/atbbs atbbs.xyz
forums python tui atproto bbs
3
fork

Configure Feed

Select the types of activity you want to include in your feed.

tui: fix focus on replies from activity pane

+11 -4
+3 -1
tui/screens/activity.py
··· 87 87 updated_at=rec.value.get("updatedAt"), 88 88 attachments=rec.value.get("attachments"), 89 89 ) 90 - self.app.push_screen(ThreadScreen(bbs, handle, thread)) 90 + self.app.push_screen( 91 + ThreadScreen(bbs, handle, thread, focus_reply=item.get("reply_uri")) 92 + ) 91 93 except Exception: 92 94 self.notify("Could not open thread.", severity="error") 93 95
+8 -3
tui/screens/thread.py
··· 36 36 Binding("ctrl+b", "ban", "ban user", show=False), 37 37 ] 38 38 39 - def __init__(self, bbs: BBS, handle: str, thread: Thread) -> None: 39 + def __init__( 40 + self, bbs: BBS, handle: str, thread: Thread, focus_reply: str | None = None 41 + ) -> None: 40 42 super().__init__() 41 43 self.bbs = bbs 42 44 self.handle = handle 43 45 self.thread = thread 46 + self._focus_reply = focus_reply 44 47 self._page: int = 1 45 48 self._total_pages: int = 1 46 49 self._replies_map: dict[str, Reply] = {} ··· 76 79 posts = list(self.query(Post)) 77 80 if posts: 78 81 posts[0].focus() 79 - self.load_replies() 82 + self.load_replies(focus_reply=self._focus_reply) 83 + self._focus_reply = None 80 84 81 85 def _update_page_status(self) -> None: 82 86 text = ( ··· 91 95 post.remove() 92 96 93 97 @work(exclusive=True) 94 - async def load_replies(self, page: int = 1) -> None: 98 + async def load_replies(self, page: int = 1, focus_reply: str | None = None) -> None: 95 99 client = self.app.http_client 96 100 try: 97 101 result = await fetch_replies( ··· 99 103 self.bbs, 100 104 self.thread.uri, 101 105 page=page, 106 + focus_reply=focus_reply, 102 107 ) 103 108 except Exception: 104 109 self.notify("Could not fetch replies.", severity="error")