Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Add Sort Order Support for Media and Files Attachments Lists in Channel Info

未关闭
#6,359 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

  • #6364 来自 @andremion —— 已关闭,未合并

评估

难度
4/5
预计耗时
3-5 天
新手友好度
55/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
冷清
技术栈
android, kotlin
领域
mobile-dev

调研方向

首先从 ChannelMediaAttachmentsScreen 和 ChannelFilesAttachmentsScreen 跟踪 ChannelAttachmentsViewController 和 ChannelAttachmentsViewModelFactory,然后检查 chatClient.searchMessages 调用以及现有的 headerKeySelector 行为。完成标准是提供向后兼容的 sortOrder API,将其应用于附件列表,并确保消息日期升序和降序时的分组标题顺序保持一致。

由索引模型根据 Issue 内容生成。

描述

feature request

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:

  1. Expose a sortOrder parameter (e.g., ASC / DESC) on:

    • ChannelMediaAttachmentsScreen
    • ChannelFilesAttachmentsScreen
    • ChannelAttachmentsViewModelFactory
    • ChannelAttachmentsViewController
  2. 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 }).
  3. 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

主要语言
Kotlin
星标
1.7k
派生
320
平均合并
1 天 17 小时
30 天内合并 PR
85

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

GetStream/stream-chat-android 的其他 Issue

查看 GetStream/stream-chat-android 的全部 Issue

相似的 Issue

更多 Kotlin Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。