From 82ad6aaeb1c6c58e83991bf0a403888eae369e11 Mon Sep 17 00:00:00 2001 From: Tristan Simas Date: Thu, 29 Oct 2026 21:43:54 -0400 Subject: [PATCH 1/2] Declare the sidebar mounting worker's actual type --- src/toad/widgets/sidebar_tree.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/toad/widgets/sidebar_tree.py b/src/toad/widgets/sidebar_tree.py index 1c84ede3e..7342ad0ba 100644 --- a/src/toad/widgets/sidebar_tree.py +++ b/src/toad/widgets/sidebar_tree.py @@ -38,6 +38,7 @@ from textual.layouts.vertical import VerticalLayout from textual.reactive import reactive from textual.widget import Widget +from textual.worker import Worker from textual.widgets import Static from toad.core.events import ( @@ -238,7 +239,7 @@ class SidebarGroup[RowT: "ListedRow"](KeyedRows[str], VerticalGroup): _rows_pending = False """A reconciliation ran out of its step and left rows unmounted.""" - _row_mounting = None + _row_mounting: Worker[None] | None = None """The worker mounting pending rows after the following frames.""" def __init__( From ab6e7f840aeaa0d7abfb42f21bb71248d751c780 Mon Sep 17 00:00:00 2001 From: Tristan Simas Date: Thu, 29 Oct 2026 21:48:16 -0400 Subject: [PATCH 2/2] Preserve real message envelopes in read-state fixtures --- tests/app/test_channel_display_basis.py | 4 ++-- tests/textual/test_channel_partial_paint.py | 2 +- tests/textual/test_divider_only_viewport_stays_unread.py | 2 +- tests/textual/test_saved_view_read_only.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/app/test_channel_display_basis.py b/tests/app/test_channel_display_basis.py index d37e9e047..925a25dc8 100644 --- a/tests/app/test_channel_display_basis.py +++ b/tests/app/test_channel_display_basis.py @@ -8,9 +8,9 @@ async def test_shown_messages_are_read_exactly_and_hidden_expansion_stays_unread comms = workspace.comms viewer = workspace.viewer project = str(workspace.project) - hidden = comms.messaging.send_message("bob", "carol", "older hidden DM") + hidden = comms.messaging.send("bob", "carol", "older hidden DM").message # Every line of a message names it, so a message whose text is partly on screen is recognisable. - messages = [comms.messaging.send_message("alice", "#team", "\n".join(f"channel {i:02d} line" for _ in range(12))) + messages = [comms.messaging.send("alice", "#team", "\n".join(f"channel {i:02d} line" for _ in range(12))).message for i in range(12)] def seen(): diff --git a/tests/textual/test_channel_partial_paint.py b/tests/textual/test_channel_partial_paint.py index d2aae2f3d..4886825f5 100644 --- a/tests/textual/test_channel_partial_paint.py +++ b/tests/textual/test_channel_partial_paint.py @@ -10,7 +10,7 @@ async def test_partial_viewport_marks_only_painted_text_and_scrolling_marks_the_ workspace.thread("peer", "team", running=True) comms = workspace.comms viewer = workspace.viewer - rows = [comms.messaging.send_message("peer", "#team", f"row {i}\n" + "body\n" * 10) for i in range(8)] + rows = [comms.messaging.send("peer", "#team", f"row {i}\n" + "body\n" * 10).message for i in range(8)] def seen(): return comms.bus.reads.seen_sequences(viewer, comms.registry.snapshot()) diff --git a/tests/textual/test_divider_only_viewport_stays_unread.py b/tests/textual/test_divider_only_viewport_stays_unread.py index 9804fd198..f12b88a91 100644 --- a/tests/textual/test_divider_only_viewport_stays_unread.py +++ b/tests/textual/test_divider_only_viewport_stays_unread.py @@ -15,7 +15,7 @@ async def test_divider_without_body_leaves_the_message_unread(workspace): for index in range(7): comms.messaging.send("peer", "#team", f"earlier {index} " + "body " * 20) comms.views.mark_user_view_read("#team", worktree=Checkout(project)) - last = comms.messaging.send_message("peer", "#team", "LAST " + "body " * 250) + last = comms.messaging.send("peer", "#team", "LAST " + "body " * 250).message # Hold read marks while arranging the divider-only viewport; the first # viewport shows the text and may legitimately mark it. diff --git a/tests/textual/test_saved_view_read_only.py b/tests/textual/test_saved_view_read_only.py index 763b9f283..b03cc3939 100644 --- a/tests/textual/test_saved_view_read_only.py +++ b/tests/textual/test_saved_view_read_only.py @@ -15,7 +15,7 @@ async def test_saved_view_shows_union_history_keeps_its_pin_and_refuses_to_send( workspace.thread("api-agent", "api", running=True) workspace.thread("ui-agent", "ui", running=True) comms = workspace.comms - rows = [comms.messaging.send_message("api-agent", target, body) + rows = [comms.messaging.send("api-agent", target, body).message for target, body in (("#engineering", "union message"), ("#api", "exact message"), ("#engineering", "another union message"))] comms.channels.catalog.replace(CatalogDocument(