From e42771970ffc99d4c5e06477f91234d30b552073 Mon Sep 17 00:00:00 2001 From: Mohamed Boudra Date: Fri, 16 Oct 2026 13:39:31 +0200 Subject: [PATCH] perf(app): limit native chat mount batches Whole-message Markdown rows measure synchronously during Fabric layout. Render fewer history rows per batch and retain a smaller offscreen window so opening a chat does not measure twelve history rows at once. --- packages/app/src/agent-stream/strategy-native.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/app/src/agent-stream/strategy-native.tsx b/packages/app/src/agent-stream/strategy-native.tsx index 65f535db11..66409f23e1 100644 --- a/packages/app/src/agent-stream/strategy-native.tsx +++ b/packages/app/src/agent-stream/strategy-native.tsx @@ -591,8 +591,11 @@ function NativeStreamViewport(props: StreamRenderInput & { strategy: StreamStrat scrollEventThrottle={16} onContentSizeChange={handleContentSizeChange} maintainVisibleContentPosition={maintainVisibleContentPosition} - initialNumToRender={12} - windowSize={10} + // A history row can contain an entire long reply. Keep synchronous native + // Markdown measurement bounded while FlatList fills the surrounding window. + initialNumToRender={2} + maxToRenderPerBatch={2} + windowSize={5} removeClippedSubviews={false} scrollEnabled={scrollEnabled} showsVerticalScrollIndicator