From bbb1f081d15c2111dafab7e8a06302a99323d33a Mon Sep 17 00:00:00 2001 From: cogwheel0 <172976095+cogwheel0@users.noreply.github.com> Date: Sun, 7 Sep 2025 23:28:18 +0530 Subject: [PATCH] fix: scroll to bottom appearing after send --- lib/features/chat/views/chat_page.dart | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/features/chat/views/chat_page.dart b/lib/features/chat/views/chat_page.dart index 775d9c4..e7a585e 100644 --- a/lib/features/chat/views/chat_page.dart +++ b/lib/features/chat/views/chat_page.dart @@ -925,6 +925,9 @@ class _ChatPageState extends ConsumerState { // Keyboard visibility final keyboardVisible = MediaQuery.of(context).viewInsets.bottom > 0; + // Whether the messages list can actually scroll (avoids showing button when not needed) + final canScroll = _scrollController.hasClients && + _scrollController.position.maxScrollExtent > 0; // Auto-select model when in reviewer mode with no selection if (isReviewerMode && selectedModel == null) { @@ -1410,6 +1413,7 @@ class _ChatPageState extends ConsumerState { }, child: (_showScrollToBottom && !keyboardVisible && + canScroll && ref.watch(chatMessagesProvider).isNotEmpty) ? Center( key: const ValueKey('scroll_to_bottom_visible'),