Skip to content

Let apps override the channel list search filters and sort - #6884

Merged
andremion merged 7 commits into
developfrom
andrerego/and-1201-add-support-to-override-the-messageschannel-search
Oct 23, 2026
Merged

andremion merged 7 commits into
developfrom
andrerego/and-1201-add-support-to-override-the-messageschannel-search

Conversation

@andremion

@andremion andremion commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Goal

Closes AND-1201

Let apps change the filters and sort that ChannelListViewModel uses 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

  • New ChannelListSearchOptions: an open class with channelFilter, channelSort, messageChannelFilter, messageFilter and messageSort. The defaults keep the current behaviour in Standard, Predefined and Grouped modes.
  • Each function gets a params holder (ChannelSearchParams, MessageSearchParams) with the query, the current user, and the list filter and sort. The list filter and sort are null in Predefined and Grouped modes, because the server owns them.
  • New ChannelListViewModel and ChannelListViewModelFactory constructors that take searchOptions instead of messageSearchSort.
  • The constructors that take messageSearchSort are deprecated, with the same signatures as before, so the API change is additive. The deprecated value is only used when messageSort returns null. We can remove it in the next major.
  • messageChannelFilter can return null to skip the message search.
  • Compose sample: new "Member name search" login flag that overrides channelFilter to also match member.user.name.

Testing

Manual, in the Compose sample (turn on "Channel search" in the login screen flags):

  1. Search for a member's name, for example "Lando". No channel is found, because the default search matches channel names only.
  2. Turn on "Member name search" too and log in again. Search "Lando" again. The channels with that member are shown.
  3. Search for a channel name. Only the matching channel is shown.

Unit tests: ChannelListSearchOptionsTest covers the defaults. ChannelListViewModelTest checks 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 new ChannelSearchTests test. All of them, plus the existing channel and message search tests, passed locally against the mock server.

Validation: ./gradlew spotlessCheck detekt apiCheck testDebugUnitTest passed.

Summary by CodeRabbit

  • New Features
    • Channel search can now match member names as well as channel names. In the sample app, this option can be enabled in the feature settings.
    • Compose channel lists now support customizable channel and message search behavior, including filters and sorting.
  • Tests
    • Added coverage for channel and member-name search, search filters and sorting, and message search behavior.

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.
@andremion andremion added the pr:new-feature New feature label Oct 23, 2026
@andremion

Copy link
Copy Markdown
Contributor Author

@CodeRabbit review

@github-actions

Copy link
Copy Markdown
Contributor

PR checklist ✅

All required conditions are satisfied:

  • Title length is OK (or ignored by label).
  • At least one pr: label exists.
  • Sections ### Goal, ### Implementation, and ### Testing are filled, or the PR is bot-authored.
  • An issue is linked (Linear ticket or GitHub issue), or the PR is bot-authored.

🎉 Great job! This PR is ready for review.

@coderabbitai

coderabbitai Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f4931309-b0c4-4a8d-8eb3-c88e07912084
📥 Commits

Reviewing files that changed from the base of the PR and between 4a039c3 and a54d26a.

📒 Files selected for processing: 14
  • stream-chat-android-compose-sample/src/androidTestE2eDebug/kotlin/io/getstream/chat/android/compose/tests/ChannelSearchTests.kt
  • stream-chat-android-compose-sample/src/androidTestE2eDebug/kotlin/io/getstream/chat/android/compose/tests/MemberNameSearchTests.kt
  • stream-chat-android-compose-sample/src/androidTestE2eDebug/kotlin/io/getstream/chat/android/compose/tests/StreamTestCase.kt
  • stream-chat-android-compose-sample/src/e2e/java/io/getstream/chat/android/compose/sample/ui/StartupActivity.kt
  • stream-chat-android-compose-sample/src/main/java/io/getstream/chat/android/compose/sample/data/CustomSettings.kt
  • stream-chat-android-compose-sample/src/main/java/io/getstream/chat/android/compose/sample/feature/channel/list/SampleChannelListViewModelFactory.kt
  • stream-chat-android-compose-sample/src/main/java/io/getstream/chat/android/compose/sample/ui/login/CustomLoginActivity.kt
  • stream-chat-android-compose-sample/src/main/res/values/strings.xml
  • stream-chat-android-compose/api/stream-chat-android-compose.api
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/viewmodel/channels/ChannelListSearchOptions.kt
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/viewmodel/channels/ChannelListViewModel.kt
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/viewmodel/channels/ChannelListViewModelFactory.kt
  • stream-chat-android-compose/src/test/kotlin/io/getstream/chat/android/compose/viewmodel/channels/ChannelListSearchOptionsTest.kt
  • stream-chat-android-compose/src/test/kotlin/io/getstream/chat/android/compose/viewmodel/channels/ChannelListViewModelTest.kt

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

📝 Walkthrough

The Compose channel list API adds configurable options for channel filters, channel sorting, and message-search filters. The view model uses these options across standard, predefined-filter, and grouped searches, including pagination. The sample app adds an opt-in member-name search setting and end-to-end tests for member-name and channel-name queries.

Priority: ➖ Normal

Merge Risk: ⚪ Minimal · up to a54d2

No confirmed issue blocks merging after normal validation.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 60 functions across 12 files. (2 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly summarizes the main change: it lets applications override channel-list search filters and sorting. It is concise and specific.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The pull request description clearly explains the goal, implementation, testing, linked issue, and validation results. It omits the required Checklist section and does not explicitly confirm the Strea…
Full details: Description check

Explanation

The pull request description clearly explains the goal, implementation, testing, linked issue, and validation results. It omits the required Checklist section and does not explicitly confirm the Stream CLA or tests/docs checklist items.

Full details: Docstring Coverage

Explanation

Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 60 functions across 12 files. (2 skipped: 2 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

A rabbit checks the channel list,
And finds a name among the mist.
With filters set and queries bright,
Three group chats come into sight.
The bunny hops; the tests pass right!

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor

SDK Size Comparison 📏

SDK Before After Difference Status
stream-chat-android-client 6.27 MB 6.27 MB 0.00 MB 🟢
stream-chat-android-ui-components 11.59 MB 11.59 MB 0.00 MB 🟢
stream-chat-android-compose 13.26 MB 13.26 MB 0.00 MB 🟢
stream-chat-android-ai-compose 2.17 MB 2.17 MB 0.00 MB 🟢
stream-chat-android-ai-ondevice 1.67 MB 1.67 MB 0.00 MB 🟢

Base automatically changed from andrerego/and-978-use-the-name-and-membership-filter-for-channel-search-in to develop October 23, 2026 14:56
…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
@andremion
andremion marked this pull request as ready for review October 23, 2026 15:04
@andremion
andremion requested a review from a team as a code owner October 23, 2026 15:04
@andremion
andremion enabled auto-merge October 23, 2026 15:04
@andremion
andremion disabled auto-merge October 23, 2026 15:33
@andremion
andremion enabled auto-merge October 23, 2026 15:45
@sonarqubecloud

Copy link
Copy Markdown

@andremion
andremion added this pull request to the merge queue Oct 23, 2026
Merged via the queue into develop with commit 5a9e2ee Oct 23, 2026
25 checks passed
@andremion
andremion deleted the andrerego/and-1201-add-support-to-override-the-messageschannel-search branch October 23, 2026 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:new-feature New feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants