diff --git a/mobile/src/session/MobileNativeChatView.test.ts b/mobile/src/session/MobileNativeChatView.test.ts index 0e7b0d244a3..89083784766 100644 --- a/mobile/src/session/MobileNativeChatView.test.ts +++ b/mobile/src/session/MobileNativeChatView.test.ts @@ -236,6 +236,7 @@ describe('MobileNativeChatView', () => { await update({ messages: [current], hasMore: true, loadingEarlier: true }) await update({ messages: [older, current], hasMore: false, loadingEarlier: false }) const list = renderer!.root.find((node) => node.type === 'FlatList') + expect(list.props.maintainVisibleContentPosition).toEqual({ minIndexForVisible: 1 }) act(() => list.props.onContentSizeChange()) await act(async () => vi.runAllTimersAsync()) diff --git a/mobile/src/session/MobileNativeChatView.tsx b/mobile/src/session/MobileNativeChatView.tsx index 96dea80efd5..15cb5e28b51 100644 --- a/mobile/src/session/MobileNativeChatView.tsx +++ b/mobile/src/session/MobileNativeChatView.tsx @@ -303,9 +303,8 @@ export function MobileNativeChatView({ contentContainerStyle={styles.listContent} onScroll={onScroll} scrollEventThrottle={32} - // Anchor the viewport to the first visible row so a loadEarlier - // prepend grows the list upward instead of jumping the reader. - maintainVisibleContentPosition={{ minIndexForVisible: 0 }} + // Skip the load-earlier header so the first visible message stays anchored. + maintainVisibleContentPosition={{ minIndexForVisible: 1 }} onContentSizeChange={() => { if (data.length > 0 && atBottom && !keepHistoryPosition) { listRef.current?.scrollToEnd({ animated: false })