From 69edf46ec8abab64339373de9cd2883ca28e922f Mon Sep 17 00:00:00 2001 From: Kelvin Amoaba <97001695+AmoabaKelvin@users.noreply.github.com> Date: Mon, 16 Nov 2026 01:52:24 +0000 Subject: [PATCH] fix(mobile): keep a chat code block's wrap choice when its prose redraws (#42908) MobileNativeChatMessage keyed each prose block by a running offset that its proseRow closure advanced. Paced prose calls that closure from its own renders (reveal steps, the scroll growth hold), so every such render continued from the last total and handed the code block a new row key, which dropped its wrap choice. Key the block by its index instead. --- .../transcript/messages/MobileNativeChatMessage.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mobile/src/session/native-chat/transcript/messages/MobileNativeChatMessage.tsx b/mobile/src/session/native-chat/transcript/messages/MobileNativeChatMessage.tsx index c0211d4da3e..6a2d8c514cd 100644 --- a/mobile/src/session/native-chat/transcript/messages/MobileNativeChatMessage.tsx +++ b/mobile/src/session/native-chat/transcript/messages/MobileNativeChatMessage.tsx @@ -247,10 +247,9 @@ function MobileNativeChatMessageImpl({ ) } const isChatTurn = message.role === 'user' || message.role === 'assistant' - let proseOffset = 0 + // Paced prose calls this from its own renders too, so the key must not depend on earlier calls. const proseRow = (block: Chat.NativeChatBlock, key: number, text: string, revealing = false) => { - const textKey = `${message.id}:text:${proseOffset}` - proseOffset += text.length + 1 + const textKey = `${message.id}:text:${key}` return Chat.isSubagentGroupBlock(block) && isRenderableSubagentGroup(block) ? (