Skip to content
Source
Sign inSign up
pingdotgg/t3code

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

MergedSunkenInTime(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/10983/headmerged by juliusmarminge View on GitHub

Showing 1 changed file with 9 additions and 6 deletions.

x
0 of 1 viewed, 1 left
9 additions and 6 deletionsapps/mobile/src/features/threads/ThreadFeed.tsxModified
View file
@@ -2866,13 +2866,16 @@
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