fix(#213): scroll-to-bottom FAB now targets absolute list bottom (#245)

This commit is contained in:
M57 authored and GitHub committed 2026-06-21 19:16:32 +03:00
1 parent abe9e0e284
commit 2f5a31d3cb
1 file changed
+7 -1
@@ -524,7 +524,13 @@ fun ChatScreen(
FloatingActionButton(
onClick = {
scrollScope.launch {
listState.animateScrollToItem(state.messages.lastIndex)
val totalItems =
state.messages.size +
(if (state.streamingMessage != null) 1 else 0) +
(if (state.isThinking) 1 else 0)
if (totalItems > 0) {
listState.animateScrollToItem(totalItems - 1)
}
}
},
modifier = Modifier.size(40.dp),