Compare commits

...

2 Commits

Author SHA1 Message Date
duffyduck 9abde89805 release: bump version to 0.0.3.4 2026-04-11 12:09:23 +02:00
duffyduck ea4f639fcb fix: Auto-scroll retry with multiple delays (100, 300, 600, 1000ms)
FlatList needs time to render - single setTimeout(150) was unreliable.
Now tries 4 times on initial load, 2 times for new messages.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 12:07:54 +02:00
3 changed files with 13 additions and 9 deletions
+2 -2
View File
@@ -79,8 +79,8 @@ android {
applicationId "com.ariacockpit"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 303
versionName "0.0.3.3"
versionCode 304
versionName "0.0.3.4"
// Fallback fuer Libraries mit Product Flavors
missingDimensionStrategy 'react-native-camera', 'general'
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "aria-cockpit",
"version": "0.0.3.3",
"version": "0.0.3.4",
"private": true,
"scripts": {
"android": "react-native run-android",
+10 -6
View File
@@ -373,13 +373,17 @@ const ChatScreen: React.FC = () => {
const shouldAutoScroll = useRef(true);
const lastMessageCount = useRef(0);
// Bei neuen Nachrichten: sofort nach unten
// Bei neuen Nachrichten oder App-Start: nach unten springen
useEffect(() => {
if (messages.length > lastMessageCount.current && shouldAutoScroll.current) {
// Kurzer Delay damit FlatList rendern kann
setTimeout(() => {
flatListRef.current?.scrollToEnd({ animated: messages.length > lastMessageCount.current + 1 ? false : true });
}, 150);
if (messages.length > 0 && shouldAutoScroll.current) {
const isInitial = lastMessageCount.current === 0;
// Mehrfach versuchen (FlatList braucht Zeit zum Rendern)
const delays = isInitial ? [100, 300, 600, 1000] : [100, 300];
for (const delay of delays) {
setTimeout(() => {
flatListRef.current?.scrollToEnd({ animated: !isInitial });
}, delay);
}
}
lastMessageCount.current = messages.length;
}, [messages]);