Description
We are using the Stream Chat Android SDK (Compose UI kit) and we have been exploring the Media
Attachments and Files Attachments screens that are accessible from the Channel Info screen
(DirectChannelInfoScreen / GroupChannelInfoScreen).
Currently, when navigating to ChannelMediaAttachmentsScreen or ChannelFilesAttachmentsScreen,
the list of attachments is loaded via ChannelAttachmentsViewController, which internally calls
chatClient.searchMessages(...) without any sort parameter. The items are displayed in the order
returned by the server, with client-side grouping by relative time span (HeaderKeySelector),
but there is no way to control the sort order (ascending or descending) from the public API.
Feature Request
We would like to request the addition of sort order support for both the media and files
attachments lists. Specifically:
-
Expose a sortOrder parameter (e.g., ASC / DESC) on:
ChannelMediaAttachmentsScreen
ChannelFilesAttachmentsScreen
ChannelAttachmentsViewModelFactory
ChannelAttachmentsViewController
-
Apply the sort order either:
- By passing a sort parameter to the
searchMessages API call (if supported server-side), or
- By sorting the accumulated items client-side using the message creation date
(e.g., sortedByDescending { it.message.createdAt }).
-
Keep the headerKeySelector consistent with the chosen sort order so that group headers
(e.g., "This week", "Last month") remain logically ordered.
Current Behavior
- Attachments are returned in the order provided by the server.
- There is no public API to control or reverse the sort order.
- The only customization available is the
headerKeySelector lambda, which groups items
but does not sort them.
Expected Behavior
- The developer should be able to configure the sort order (ascending or descending by message
creation date) when instantiating the screen or the ViewModel factory.
- Default behavior should remain unchanged (backward compatible).
SDK Details
| Property |
Value |
| Platform |
Android |
| UI Kit |
Jetpack Compose (stream-chat-android-compose) |
Affected components:
ChannelMediaAttachmentsScreen
ChannelFilesAttachmentsScreen
ChannelAttachmentsViewController (stream-chat-android-ui-common)
ChannelAttachmentsViewModelFactory
ChannelAttachmentsViewState
Thanks
Description
We are using the Stream Chat Android SDK (Compose UI kit) and we have been exploring the Media
Attachments and Files Attachments screens that are accessible from the Channel Info screen
(
DirectChannelInfoScreen/GroupChannelInfoScreen).Currently, when navigating to
ChannelMediaAttachmentsScreenorChannelFilesAttachmentsScreen,the list of attachments is loaded via
ChannelAttachmentsViewController, which internally callschatClient.searchMessages(...)without any sort parameter. The items are displayed in the orderreturned by the server, with client-side grouping by relative time span (
HeaderKeySelector),but there is no way to control the sort order (ascending or descending) from the public API.
Feature Request
We would like to request the addition of sort order support for both the media and files
attachments lists. Specifically:
Expose a
sortOrderparameter (e.g.,ASC/DESC) on:ChannelMediaAttachmentsScreenChannelFilesAttachmentsScreenChannelAttachmentsViewModelFactoryChannelAttachmentsViewControllerApply the sort order either:
searchMessagesAPI call (if supported server-side), or(e.g.,
sortedByDescending { it.message.createdAt }).Keep the
headerKeySelectorconsistent with the chosen sort order so that group headers(e.g., "This week", "Last month") remain logically ordered.
Current Behavior
headerKeySelectorlambda, which groups itemsbut does not sort them.
Expected Behavior
creation date) when instantiating the screen or the ViewModel factory.
SDK Details
stream-chat-android-compose)Affected components:
ChannelMediaAttachmentsScreenChannelFilesAttachmentsScreenChannelAttachmentsViewController(stream-chat-android-ui-common)ChannelAttachmentsViewModelFactoryChannelAttachmentsViewStateThanks