Repository navigation
Conversation
In Standard mode, the channel search added `member.user.name` OR `name` autocomplete to the integrator's filter. It now adds `name` autocomplete AND the current user's membership, the same filter that Predefined and Grouped modes already use. The integrator's filter still applies. Channels can no longer be found by a member's name.
Add ChannelListSearchOptions, an open class passed to the ChannelListViewModel and ChannelListViewModelFactory constructors. Apps can override the channel search filter and sort, and the message search channel filter and message filter. The defaults keep the current behaviour in all query modes. The compose sample gets a member name search flag that overrides the channel filter to also match member names, with e2e tests for it.
|
@CodeRabbit review |
PR checklist ✅All required conditions are satisfied:
🎉 Great job! This PR is ready for review. |
✅ Action performedReview finished.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to
|
SDK Size Comparison 📏
|
…to andrerego/and-1201-add-support-to-override-the-messageschannel-search # Conflicts: # stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/viewmodel/channels/ChannelListViewModel.kt
|



Goal
Closes AND-1201
Let apps change the filters and sort that
ChannelListViewModeluses for channel search and message search. Before, they were fixed in the view model, so apps could not search channels by member name or limit message search to some channels. The other SDKs already allow this.Implementation
ChannelListSearchOptions: an open class withchannelFilter,channelSort,messageChannelFilter,messageFilterandmessageSort. The defaults keep the current behaviour in Standard, Predefined and Grouped modes.ChannelSearchParams,MessageSearchParams) with the query, the current user, and the list filter and sort. The list filter and sort arenullin Predefined and Grouped modes, because the server owns them.ChannelListViewModelandChannelListViewModelFactoryconstructors that takesearchOptionsinstead ofmessageSearchSort.messageSearchSortare deprecated, with the same signatures as before, so the API change is additive. The deprecated value is only used whenmessageSortreturnsnull. We can remove it in the next major.messageChannelFiltercan returnnullto skip the message search.channelFilterto also matchmember.user.name.Testing
Manual, in the Compose sample (turn on "Channel search" in the login screen flags):
Unit tests:
ChannelListSearchOptionsTestcovers the defaults.ChannelListViewModelTestchecks that custom options are used for channel search in all three modes, for the next pages, and for message search.E2E:
MemberNameSearchTests(2 tests) and a newChannelSearchTeststest. All of them, plus the existing channel and message search tests, passed locally against the mock server.Validation:
./gradlew spotlessCheck detekt apiCheck testDebugUnitTestpassed.Summary by CodeRabbit