-
Notifications
You must be signed in to change notification settings - Fork 302
Add filtering and sorting options for QueryThreads
.
#5931
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…equest for broader customization and deprecate the old one.
DB Entities have been updated. Do we need to upgrade DB Version?
|
SDK Size Comparison 📏
|
There was a problem hiding this 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 adds support for filtering and sorting options to the QueryThreads
operation in the Stream Chat Android SDK. The purpose is to enhance the thread querying capabilities by allowing developers to customize thread queries with specific filters and sorting criteria.
Key changes:
- Add
filter
andsort
properties toQueryThreadsRequest
with comprehensive documentation of supported fields - Update
ThreadsViewModelFactory
to acceptQueryThreadsRequest
constructor and deprecate the old constructor - Refactor internal state management to support multiple query instances with different filters/sorts
Reviewed Changes
Copilot reviewed 61 out of 61 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
stream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/viewmodel/threads/ThreadsViewModelFactory.kt | Updates factory to accept QueryThreadsRequest, deprecates old constructor |
stream-chat-android-client/src/main/java/io/getstream/chat/android/client/api/models/QueryThreadsRequest.kt | Adds filter and sort properties with comprehensive documentation |
stream-chat-android-state/src/main/java/io/getstream/chat/android/state/plugin/logic/internal/LogicRegistry.kt | Refactors to support multiple QueryThreadsLogic instances per filter/sort combination |
stream-chat-android-core/src/main/java/io/getstream/chat/android/models/Thread.kt | Adds ComparableFieldProvider implementation and extraData property |
stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/viewmodel/threads/ThreadsViewModelFactory.kt | Mirror changes from UI components factory |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
...-client/src/main/java/io/getstream/chat/android/client/query/request/ChannelFilterRequest.kt
Show resolved
Hide resolved
...-client/src/main/java/io/getstream/chat/android/client/query/request/ChannelFilterRequest.kt
Outdated
Show resolved
Hide resolved
...src/main/java/io/getstream/chat/android/offline/repository/database/internal/ChatDatabase.kt
Show resolved
Hide resolved
…roid/client/query/request/ChannelFilterRequest.kt Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! 👍🏻
Can you please increase the coverage a bit more? (No need to care about the compose coverage, they are done in my PR)
...roid-client/src/main/java/io/getstream/chat/android/client/api/models/QueryThreadsRequest.kt
Show resolved
Hide resolved
...roid-client/src/main/java/io/getstream/chat/android/client/api/models/QueryThreadsRequest.kt
Show resolved
Hide resolved
...roid-client/src/main/java/io/getstream/chat/android/client/api/models/QueryThreadsRequest.kt
Show resolved
Hide resolved
# Conflicts: # CHANGELOG.md # DEPRECATIONS.md # stream-chat-android-compose/api/stream-chat-android-compose.api # stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/viewmodel/threads/ThreadsViewModelFactory.kt
# Conflicts: # CHANGELOG.md
|
🎯 Goal
Add support for filtering and sorting the results of the
QueryThreads
operation.Resolves: https://linear.app/stream/issue/AND-633/query-threads-improvements
🛠 Implementation details
LLC
filter
andsort
properties to theQueryThreadsRequest
extraData
properties onThread
andThreadInfo
State/Offline
QueryThreadsRequest
UI Common
ThreadListController
to acceptQueryThreadsRequest
in the constructor instead of separate arguments.Compose / XML
ThreadsViewModelFactory(QueryThreadsRequest)
constructorThreadsViewModelFactory(threadLimit, threadReplyLimit, threadParticipantLimit)
constructor in favor ofThreadsViewModelFactory(QueryThreadsRequest)
constructor.🎨 UI Changes
No visible UI changes, the changes are additions to the LLC API, and in the instantiation of the
ThreadsViewModelFactory
🧪 Testing
QueryThreadsRequest
passed in the existingThreadsViewModelFactory
(inChannelsActivity
in the compose sample orThreadsFragment
in the XML sample)