Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions apps/client/lib/src/widgets/chat_panel/chat_message_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,12 @@ class ChatMessageList extends ConsumerWidget {
child: ListView.builder(
controller: scrollController,
padding: const EdgeInsets.only(bottom: 16),
// Pre-build ~one viewport of off-screen messages on each side so that
// momentum scrolling doesn't flash blank space while items mount. The
// Flutter default of 250 is too tight for chat where rows include
// images, reactions, and reply quotes that each take a frame to lay
// out. Tuned conservatively to keep memory in check on long histories.
cacheExtent: 600,
itemCount: messages.length + 1,
itemBuilder: (context, index) {
if (index == 0) {
Expand Down
Loading