Matthias Nott
2026-03-07 7d69229cd76447b92ee66f472f760994d00817ae
components/SessionDrawer.tsx
....@@ -9,9 +9,7 @@
99 Animated,
1010 Dimensions,
1111 Keyboard,
12
- KeyboardAvoidingView,
1312 LayoutAnimation,
14
- Platform,
1513 Pressable,
1614 ScrollView,
1715 StyleSheet,
....@@ -276,6 +274,18 @@
276274 const slideAnim = useRef(new Animated.Value(-DRAWER_WIDTH)).current;
277275 const fadeAnim = useRef(new Animated.Value(0)).current;
278276 const [rendered, setRendered] = useState(false);
277
+ const [keyboardHeight, setKeyboardHeight] = useState(0);
278
+ const pickerScrollRef = useRef<ScrollView>(null);
279
+
280
+ useEffect(() => {
281
+ const showSub = Keyboard.addListener("keyboardWillShow", (e) => {
282
+ setKeyboardHeight(e.endCoordinates.height);
283
+ });
284
+ const hideSub = Keyboard.addListener("keyboardWillHide", () => {
285
+ setKeyboardHeight(0);
286
+ });
287
+ return () => { showSub.remove(); hideSub.remove(); };
288
+ }, []);
279289
280290 // Local ordering: merge server sessions while preserving user's drag order
281291 const [orderedSessions, setOrderedSessions] = useState<WsSession[]>([]);
....@@ -473,11 +483,7 @@
473483 elevation: 20,
474484 }}
475485 >
476
- <KeyboardAvoidingView
477
- style={{ flex: 1 }}
478
- behavior={Platform.OS === "ios" ? "padding" : undefined}
479
- >
480
- <GestureHandlerRootView style={{ flex: 1 }}>
486
+ <GestureHandlerRootView style={{ flex: 1, paddingBottom: keyboardHeight }}>
481487 {/* Header */}
482488 <View
483489 style={{
....@@ -564,6 +570,7 @@
564570
565571 {showProjectPicker && (
566572 <ScrollView
573
+ ref={pickerScrollRef}
567574 style={{
568575 marginHorizontal: 12,
569576 borderRadius: 12,
....@@ -630,6 +637,9 @@
630637 autoCapitalize="none"
631638 autoCorrect={false}
632639 returnKeyType="go"
640
+ onFocus={() => {
641
+ setTimeout(() => pickerScrollRef.current?.scrollToEnd({ animated: true }), 100);
642
+ }}
633643 onSubmitEditing={() => {
634644 if (customPath.trim()) launchSession({ path: customPath.trim() });
635645 }}
....@@ -679,7 +689,6 @@
679689 </Text>
680690 </View>
681691 </GestureHandlerRootView>
682
- </KeyboardAvoidingView>
683692 </Animated.View>
684693 </View>
685694 </View>