From 979877eed3a3f6c9d0ba00832c874b0782748f99 Mon Sep 17 00:00:00 2001 From: M57 <41645758+Hy4ri@users.noreply.github.com> Date: Fri, 26 Jun 2026 17:58:26 +0300 Subject: [PATCH] fix: prevent typing effect replay on finalized messages (blink fix) (#398) Root cause: when MessageComplete fires, the reducer atomically moves the streaming message to the messages list and clears streamingMessage. The messages list's typing effect condition (lastAnimatedMessageId check) didn't account for the fact that this message was already rendered with a typing effect in the streaming slot. The animation replayed from scratch on the already-complete message, causing a visible blink. Fix: add message.isStreaming to the condition. Messages finalized via MessageComplete/MessageDone always have isStreaming=false, so they skip the replay naturally. The streaming slot's StreamingBubbleWithTypingEffect continues to handle the animation during active streaming. Closes #374 Co-authored-by: M57 --- app/src/main/java/com/m57/hermescontrol/ui/chat/ChatScreen.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/com/m57/hermescontrol/ui/chat/ChatScreen.kt b/app/src/main/java/com/m57/hermescontrol/ui/chat/ChatScreen.kt index 059a80c8..5bb3d838 100644 --- a/app/src/main/java/com/m57/hermescontrol/ui/chat/ChatScreen.kt +++ b/app/src/main/java/com/m57/hermescontrol/ui/chat/ChatScreen.kt @@ -1102,7 +1102,7 @@ private fun ChatMessageList( val isLastMessage = index == messages.lastIndex val isAssistant = message.role == MessageRole.ASSISTANT - if (typingEffectEnabled && isLastMessage && isAssistant && + if (typingEffectEnabled && isLastMessage && isAssistant && message.isStreaming && lastAnimatedMessageId != message.id ) { StreamingBubbleWithTypingEffect(