| ... | ... | @@ -83,7 +83,7 @@ import { isPdfFile } from "../../lib/filePreview"; |
| 83 | 83 | import { flattenThemeColor } from "../../lib/mobileTheme"; |
| 84 | 84 | import { PresentationSource } from "../../components/NativePresentation"; |
| 85 | 85 | import { useSafeAreaInsets } from "react-native-safe-area-context"; |
| 86 | | import Animated, { FadeIn, LinearTransition, type SharedValue } from "react-native-reanimated"; |
| 86 | import Animated, { FadeIn, type SharedValue } from "react-native-reanimated"; |
| 87 | 87 | import { useUniwindTheme } from "../../lib/useUniwindTheme"; |
| 88 | 88 | import { IOS_NAV_BAR_HEIGHT } from "../../lib/layoutMetrics"; |
| 89 | 89 | import { useFontFamily } from "../../lib/useFontFamily"; |
| ... | ... | @@ -216,8 +216,6 @@ function formatMessageTime(input: string): string { |
| 216 | 216 | // Fixed heights mirror renderFeedEntry's classNames and are only used while |
| 217 | 217 | // text fits at the current font settings. Larger accessibility text is measured. |
| 218 | 218 | const TURN_FOLD_HEIGHT = 42; // min-h-11 (38.5) + mb-1 (3.5), with the mobile 14px rem |
| 219 | | const THREAD_FEED_LAYOUT_TRANSITION = LinearTransition.duration(THREAD_DISCLOSURE_TRANSITION_MS); |
| 220 | | const THREAD_FEED_IMMEDIATE_TRANSITION = LinearTransition.duration(0); |
| 221 | 219 | // Tailwind spacing on the mobile 14px rem: px-3.5 on the user bubble, px-1 on |
| 222 | 220 | // assistant rows. Images size their frame from these before their own layout. |
| 223 | 221 | const USER_BUBBLE_HORIZONTAL_PADDING = 3.5 * 3.5; |
| ... | ... | @@ -2825,17 +2823,8 @@ export const ThreadFeed = memo(function ThreadFeed(props: ThreadFeedProps) { |
| 2825 | 2823 | entry.type === "message" ? `message:${entry.message.role}` : entry.type |
| 2826 | 2824 | } |
| 2827 | 2825 | getFixedItemSize={getFixedItemSize} |
| 2828 | | // Android can retain stale native row positions when layout transitions |
| 2829 | | // race the measurements arriving during sync, even with duration 0. |
| 2830 | | // Keep its rows on LegendList's non-animated positioning path. On iOS, |
| 2831 | | // keep a transition installed between disclosures so containers don't remount. |
| 2832 | | itemLayoutAnimation={ |
| 2833 | | Platform.OS === "android" |
| 2834 | | ? undefined |
| 2835 | | : disclosureToggleSettling |
| 2836 | | ? THREAD_FEED_LAYOUT_TRANSITION |
| 2837 | | : THREAD_FEED_IMMEDIATE_TRANSITION |
| 2838 | | } |
| 2826 | // Virtualized rows must move with their measurements. Native layout |
| 2827 | // transitions can retain stale positions during sync, even at duration 0. |
| 2839 | 2828 | onItemSizeChanged={handleItemSizeChanged} |
| 2840 | 2829 | // Measure rows well before they scroll into view so estimate→actual |
| 2841 | 2830 | // corrections land offscreen instead of under the user's finger. |