mirror of
https://github.com/stablyai/orca.git
synced 2026-11-19 04:23:57 +00:00
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.
This commit is contained in:
@@ -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) ? (
|
||||
<MobileNativeChatSubagentGroup
|
||||
key={`subagent-group:${block.groupId}`}
|
||||
|
||||
Reference in New Issue
Block a user