Matthias Nott
2026-03-15 32ede5388bb6c66c5d5679c2d73fd6ec6b2342bf
components/SessionPicker.tsx
....@@ -265,6 +265,7 @@
265265 } = useChat();
266266 const [editingId, setEditingId] = useState<string | null>(null);
267267 const [keyboardHeight, setKeyboardHeight] = useState(0);
268
+ const sessionScrollRef = useRef<ScrollView>(null);
268269
269270 // Sort: active first, then by index
270271 const sortedSessions = [...sessions].sort((a, b) => {
....@@ -312,7 +313,14 @@
312313 const handleStartRename = useCallback((session: WsSession) => {
313314 Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light);
314315 setEditingId(session.id);
315
- }, []);
316
+ // Scroll down after keyboard appears so the rename field is visible
317
+ const idx = sortedSessions.findIndex(s => s.id === session.id);
318
+ if (idx >= 0 && sessionScrollRef.current) {
319
+ setTimeout(() => {
320
+ sessionScrollRef.current?.scrollTo({ y: idx * 60, animated: true });
321
+ }, 400);
322
+ }
323
+ }, [sortedSessions]);
316324
317325 const handleConfirmRename = useCallback(
318326 (sessionId: string, newName: string) => {
....@@ -407,6 +415,7 @@
407415
408416 {/* Session list */}
409417 <ScrollView
418
+ ref={sessionScrollRef}
410419 style={{ paddingHorizontal: 16 }}
411420 showsVerticalScrollIndicator={false}
412421 keyboardShouldPersistTaps="handled"