Open a chat at the newest message

The size-keyed follow effect animated from the very top on first
composition — a tour of the history before landing. A Unit-keyed instant
jump runs first; the animated follow keeps handling arrivals.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Paul Hitt
2026-08-28 16:23:51 -04:00
co-authored by Claude Fable 5
parent 3b6bdb43a3
commit 8ca63c4fa1
@@ -1263,6 +1263,10 @@ fun ColumnScope.ChatScreen(
var draft by remember { mutableStateOf("") }
val listState = rememberLazyListState()
// Open AT the newest message — a jump, not a tour of the history.
LaunchedEffect(Unit) {
if (chat.lines.isNotEmpty()) listState.scrollToItem(chat.lines.lastIndex)
}
// Follow the conversation as it grows. Without this a reply arrives
// off-screen and the app looks like it did nothing.
LaunchedEffect(chat.lines.size) {