Chat: sending a message always scrolls to the bottom

After a send the view jumps to the end of the conversation and resumes
following, even when the operator had scrolled up or the message is taller
than the screen, so the message's end and the reply stay in view.
This commit is contained in:
2026-11-03 11:02:06 +00:00
parent f93d121227
commit c6bebb0af3
2 changed files with 52 additions and 0 deletions
@@ -318,6 +318,18 @@ class _ChatThreadViewState extends State<ChatThreadView> {
if (!mounted) return;
_controller.removeLocal(send.operationId);
_controller.insertLocal(send.toMessage());
// Sending always shows the end of the conversation, even when the
// operator had scrolled up or the message is taller than the screen;
// following resumes so the reply stays in view too.
setState(() {
_following = true;
_newestAtRelease = null;
_distanceFromBottom = 0;
});
_abandonRestore();
WidgetsBinding.instance.addPostFrameCallback((_) {
if (mounted && !_userScrolling) _jumpToBottom();
});
}
/// A refused message leaves the transcript; it is drawn after it as "Not