From e9f07dee0e3295a3c91f98c4d4ff6b4a211f76f0 Mon Sep 17 00:00:00 2001 From: Jean-Pierre Martineau Date: Thu, 27 Aug 2026 03:40:49 -0400 Subject: [PATCH] Chat: a direct thread picks a message too, whatever the comments said MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two comments claimed the pick was channels-only, one of them flatly stating that direct threads never select. Neither is true: _move_selection and _select_section carry no is_channel gate, and footer_hint has offered a picked-message hint for both kinds all along. What actually differs is what Enter does with the pick — a reply @mention in a channel, the delivery paths in a direct thread. Both also called it the "reply target", which names only the channel half of that; it is the picked message, and only one kind replies to it. Co-Authored-By: Claude Opus 5 (1M context) --- meshterm/ui/chat.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/meshterm/ui/chat.py b/meshterm/ui/chat.py index 797c9b4..4034e1b 100644 --- a/meshterm/ui/chat.py +++ b/meshterm/ui/chat.py @@ -237,7 +237,9 @@ class ChatScreen(Screen): # Both direct and channel threads use the same grouped, Discord/Slack-style # transcript: consecutive messages from one sender share a colored header, with # day dividers between them. Rendering per-message also lets us record where the - # picked reply target lands (channels only; see _selected_line / cursor_line). + # picked message lands (see _selected_line / cursor_line). Both thread kinds + # pick; what differs is only what Enter then does with the pick — a reply in a + # channel, the delivery paths in a direct thread. if self._selected is not None: self._selected = max(0, min(self._selected, len(self._messages) - 1)) lines = self._render_grouped(width) @@ -318,8 +320,8 @@ class ChatScreen(Screen): the same day share one colored header, with each message body indented below. A muted divider marks each new day, and a blank line separates distinct sender groups. Rendering message-by-message (rather than as one Group) lets us record the body line - of the selected reply target in :attr:`_selected_line` so the frame can scroll it into - view (channels only; direct threads never select). + of the picked message in :attr:`_selected_line` so the frame can scroll it into + view. Both thread kinds pick — see :meth:`handle`. A repaint is triggered constantly by things that touch nothing here — the idle tick, a keystroke, the ack spinner — so this memoizes each message's rendered lines