From f8aab8232a79e74241667a71adedd93741645ac9 Mon Sep 17 00:00:00 2001 From: Mikhail Kilin Date: Tue, 24 Feb 2026 14:27:43 +0300 Subject: [PATCH] fix: keep selection on last/first message instead of deselecting When pressing down on the last message or up on the first message in chat navigation, stay on the current message instead of exiting message selection mode. Co-Authored-By: Claude Opus 4.6 --- src/app/methods/messages.rs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/app/methods/messages.rs b/src/app/methods/messages.rs index c4a2b5c..3226551 100644 --- a/src/app/methods/messages.rs +++ b/src/app/methods/messages.rs @@ -110,17 +110,13 @@ impl MessageMethods for App { } } - if new_index >= total { - self.chat_state = ChatState::Normal; - } else { + if new_index < total { *selected_index = new_index; + self.stop_playback(); } - self.stop_playback(); - } else { - // Дошли до самого нового сообщения - выходим из режима выбора - self.chat_state = ChatState::Normal; - self.stop_playback(); + // Если new_index >= total — остаёмся на текущем } + // Если уже на последнем — ничего не делаем, остаёмся на месте } }