From dfd41840391e35ff669990f5efb0a5fb955ab0b5 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 bba3fe3..2a7ba41 100644 --- a/src/app/methods/messages.rs +++ b/src/app/methods/messages.rs @@ -109,17 +109,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 — остаёмся на текущем } + // Если уже на последнем — ничего не делаем, остаёмся на месте } }