History

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

Dara Adedeji committed 2 months ago

Commit 75e4ceb1 parent 50f918c1 file · +9 −6Browse files

Unified · Split

apps/mobile/src/features/threads/ThreadFeed.tsx+9−6
@@ -2866,13 +2866,16 @@ export const ThreadFeed = memo(function ThreadFeed(props: ThreadFeedProps) { · 2865 unmodified lines
28662866 entry.type === "message" ? `message:${entry.message.role}` : entry.type
28672867 }
28682868 getFixedItemSize={getFixedItemSize}
2869− // LegendList swaps its position and size component types when this
2870− // becomes undefined, remounting the feed and replaying row entrances.
2871− // Keep those containers mounted while ordinary updates stay immediate.
2869+ // Android can retain stale native row positions when layout transitions
2870+ // race the measurements arriving during sync, even with duration 0.
2871+ // Keep its rows on LegendList's non-animated positioning path. On iOS,
2872+ // keep a transition installed between disclosures so containers don't remount.
28722873 itemLayoutAnimation={
2873− disclosureToggleSettling
2874− ? THREAD_FEED_LAYOUT_TRANSITION
2875− : THREAD_FEED_IMMEDIATE_TRANSITION
2874+ Platform.OS === "android"
2875+ ? undefined
2876+ : disclosureToggleSettling
2877+ ? THREAD_FEED_LAYOUT_TRANSITION
2878+ : THREAD_FEED_IMMEDIATE_TRANSITION
28762879 }
28772880 onItemSizeChanged={handleItemSizeChanged}
28782881 // Measure rows well before they scroll into view so estimate→actual