fix(mobile): prevent Android chat rows overlapping during sync (#10983)

This commit is contained in:
Dara Adedeji authored and GitHub committed 2026-09-09 14:34:39 -07:00
1 parent 50f918c57a
commit 75e4ceb964
1 file changed
+9 -6
@@ -2866,13 +2866,16 @@ export const ThreadFeed = memo(function ThreadFeed(props: ThreadFeedProps) {
entry.type === "message" ? `message:${entry.message.role}` : entry.type
}
getFixedItemSize={getFixedItemSize}
// LegendList swaps its position and size component types when this
// becomes undefined, remounting the feed and replaying row entrances.
// Keep those containers mounted while ordinary updates stay immediate.
// Android can retain stale native row positions when layout transitions
// race the measurements arriving during sync, even with duration 0.
// Keep its rows on LegendList's non-animated positioning path. On iOS,
// keep a transition installed between disclosures so containers don't remount.
itemLayoutAnimation={
disclosureToggleSettling
? THREAD_FEED_LAYOUT_TRANSITION
: THREAD_FEED_IMMEDIATE_TRANSITION
Platform.OS === "android"
? undefined
: disclosureToggleSettling
? THREAD_FEED_LAYOUT_TRANSITION
: THREAD_FEED_IMMEDIATE_TRANSITION
}
onItemSizeChanged={handleItemSizeChanged}
// Measure rows well before they scroll into view so estimate→actual