Skip to content
TypeScript

fix(mobile): Android Thread settings rows no longer vanish with animations removed (#21757)

shivama077fdd2aa48
diff --git a/apps/mobile/src/features/threads/ThreadSettingsSheet.tsx b/apps/mobile/src/features/threads/ThreadSettingsSheet.tsx
index 11d8710470d..1f17fd3bb84 100644
--- a/apps/mobile/src/features/threads/ThreadSettingsSheet.tsx
+++ b/apps/mobile/src/features/threads/ThreadSettingsSheet.tsx
@@ -49,7 +49,12 @@ import {
type ReactNode,
} from "react";
import { Platform, Pressable, RefreshControl, ScrollView, TextInput, View } from "react-native";
-import Animated, { FadeIn, FadeOut, LinearTransition } from "react-native-reanimated";
+import Animated, {
+ FadeIn,
+ FadeOut,
+ LinearTransition,
+ useReducedMotion,
+} from "react-native-reanimated";
import { useSafeAreaInsets } from "react-native-safe-area-context";
import { SymbolView } from "../../components/ui/AppSymbol";
@@ -938,7 +943,10 @@ function ThreadSettingsMainContent(props: {
if (error) Dialog.alert("Could not refresh models", error);
});
};
- const [animationsReady, setAnimationsReady] = useState(false);
+ const [listLoaded, setListLoaded] = useState(false);
+ // Android can drop the first frame of a reduced-motion fade, leaving rows invisible.
+ const reducedMotion = useReducedMotion();
+ const animationsReady = listLoaded && !reducedMotion;
const catalogItems = buildThreadSettingsCatalogItems(session);
const hasActiveCatalogFilter =
session.providerFilter !== null || session.searchQuery.trim().length > 0;
@@ -1064,7 +1072,7 @@ function ThreadSettingsMainContent(props: {
<RefreshControl refreshing={isRefreshingProviders} onRefresh={refreshProviders} />
) : undefined
}
- onLoad={() => setAnimationsReady(true)}
+ onLoad={() => setListLoaded(true)}
renderItem={renderCatalogItem}
showsVerticalScrollIndicator={false}
/>