Matthias Nott
2026-03-07 281834df3070cfbdfc28314ab2a2e84d321ca5df
fix: project picker scroll, reconnect scroll, keyboard dismiss

- Project picker wrapped in ScrollView with maxHeight 300
- MessageList uses longer delay (200ms) for bulk loads (reconnect/switch)
- InputBar dismisses keyboard after sending text message
3 files modified
changed files
components/SessionDrawer.tsx patch | view | blame | history
components/chat/InputBar.tsx patch | view | blame | history
components/chat/MessageList.tsx patch | view | blame | history
components/SessionDrawer.tsx
....@@ -11,6 +11,7 @@
1111 Keyboard,
1212 LayoutAnimation,
1313 Pressable,
14
+ ScrollView,
1415 StyleSheet,
1516 Text,
1617 TextInput,
....@@ -556,12 +557,15 @@
556557 </View>
557558
558559 {showProjectPicker && (
559
- <View style={{
560
- marginHorizontal: 12,
561
- borderRadius: 12,
562
- backgroundColor: colors.bgTertiary,
563
- overflow: "hidden",
564
- }}>
560
+ <ScrollView
561
+ style={{
562
+ marginHorizontal: 12,
563
+ borderRadius: 12,
564
+ backgroundColor: colors.bgTertiary,
565
+ maxHeight: 300,
566
+ }}
567
+ keyboardShouldPersistTaps="handled"
568
+ >
565569 {/* Home directory — always first */}
566570 <Pressable
567571 onPress={() => launchSession({ path: "~" })}
....@@ -645,7 +649,7 @@
645649 </Pressable>
646650 )}
647651 </View>
648
- </View>
652
+ </ScrollView>
649653 )}
650654 </View>
651655
components/chat/InputBar.tsx
....@@ -38,6 +38,7 @@
3838 if (!trimmed) return;
3939 onSendText(trimmed);
4040 setText("");
41
+ Keyboard.dismiss();
4142 }, [text, onSendText]);
4243
4344 if (!isTextMode) {
components/chat/MessageList.tsx
....@@ -20,13 +20,14 @@
2020
2121 useEffect(() => {
2222 if (messages.length > 0) {
23
- // If the message count changed by more than 1, it's a session switch —
24
- // snap to bottom instantly instead of visibly scrolling down.
23
+ // If the message count changed by more than 1, it's a session switch or
24
+ // initial load — snap to bottom instantly instead of visibly scrolling.
2525 const delta = Math.abs(messages.length - prevLengthRef.current);
2626 const animated = delta === 1;
27
+ const delay = delta > 1 ? 200 : 50;
2728 setTimeout(() => {
2829 listRef.current?.scrollToEnd({ animated });
29
- }, 50);
30
+ }, delay);
3031 }
3132 prevLengthRef.current = messages.length;
3233 }, [messages.length, isTyping, lastContent]);