Skip to content

Conversation

demchenkoalex
Copy link
Member

@demchenkoalex demchenkoalex requested a review from Copilot July 26, 2025 07:47
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements two-sided pagination functionality for the Flutter chat UI, allowing users to load both older messages (towards the top) and newer messages (towards the bottom) of the chat.

Key changes:

  • Added onStartReached callback for loading newer messages at the bottom of the chat
  • Extended LoadMoreNotifier to track separate loading states for older and newer messages
  • Added animated parameter to chat controller operations to control animation behavior during pagination
  • Updated pagination examples to demonstrate both older and newer message loading

Reviewed Changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/flutter_chat_ui/lib/src/utils/load_more_notifier.dart Refactored to support separate loading states for older vs newer messages
packages/flutter_chat_ui/lib/src/load_more.dart Simplified LoadMore widget by removing height measurement functionality
packages/flutter_chat_ui/lib/src/chat_animated_list/chat_animated_list_reversed.dart Added support for onStartReached callback and startPaginationThreshold
packages/flutter_chat_ui/lib/src/chat_animated_list/chat_animated_list.dart Added comprehensive two-sided pagination logic with scroll anchoring
packages/flutter_chat_core/lib/src/chat_controller/in_memory_chat_controller.dart Added animated parameter to all message operations
packages/flutter_chat_core/lib/src/chat_controller/chat_operation.dart Extended ChatOperation to include animated flag
examples/flyer_chat/lib/pagination_older.dart Refactored existing pagination example to focus on older messages
examples/flyer_chat/lib/pagination_newer.dart New example demonstrating newer message pagination
examples/flyer_chat/lib/pagination_mock_database.dart Extracted mock database logic for shared use across examples
examples/flyer_chat/lib/main.dart Updated navigation to include both pagination examples
examples/flyer_chat/lib/hive_chat_controller.dart Added animated parameter support to Hive implementation
Comments suppressed due to low confidence (1)

examples/flyer_chat/lib/pagination_older.dart:115

  • Typo in comment: 'reserved' should be 'reversed'.
      // If the list is reversed, we might need to add an offset that

@flyerhq flyerhq deleted a comment from cursor bot Jul 26, 2025
@demchenkoalex
Copy link
Member Author

@cursor review

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no bugs!


Bugbot free trial expires on July 29, 2025
Learn more in the Cursor dashboard.

@demchenkoalex demchenkoalex force-pushed the feat/two-sided-pagination branch from 332dfab to a8f2b07 Compare July 26, 2025 08:04
@demchenkoalex demchenkoalex merged commit 8cca314 into main Jul 26, 2025
1 check passed
@demchenkoalex demchenkoalex deleted the feat/two-sided-pagination branch July 26, 2025 08:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant