Add Sort Order Support for Media and Files Attachments Lists in Channel Info
维护者通常 1 天内回复
还没有人认领这个 Issue。
- #6364 来自 @andremion —— 已关闭,未合并
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 55/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 冷清
- 领域
- mobile-dev
调研方向
首先从 ChannelMediaAttachmentsScreen 和 ChannelFilesAttachmentsScreen 跟踪 ChannelAttachmentsViewController 和 ChannelAttachmentsViewModelFactory,然后检查 chatClient.searchMessages 调用以及现有的 headerKeySelector 行为。完成标准是提供向后兼容的 sortOrder API,将其应用于附件列表,并确保消息日期升序和降序时的分组标题顺序保持一致。
由索引模型根据 Issue 内容生成。
描述
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
sortOrderparameter (e.g.,ASC/DESC) on:ChannelMediaAttachmentsScreenChannelFilesAttachmentsScreenChannelAttachmentsViewModelFactoryChannelAttachmentsViewController
-
Apply the sort order either:
- By passing a sort parameter to the
searchMessagesAPI call (if supported server-side), or - By sorting the accumulated items client-side using the message creation date
(e.g.,sortedByDescending { it.message.createdAt }).
- By passing a sort parameter to the
-
Keep the
headerKeySelectorconsistent 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
headerKeySelectorlambda, 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:
ChannelMediaAttachmentsScreenChannelFilesAttachmentsScreenChannelAttachmentsViewController(stream-chat-android-ui-common)ChannelAttachmentsViewModelFactoryChannelAttachmentsViewState
Thanks
- 主要语言
- Kotlin
- 星标
- 1.7k
- 派生
- 320
- 平均合并
- 1 天 17 小时
- 30 天内合并 PR
- 85
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
GetStream/stream-chat-android 的其他 Issue
-
feature request
难度 3/5 1-2 天 新手友好度 65/100
GetStream/stream-chat-android#6556 · 1 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
-
feature request
难度 3/5 1-2 天 新手友好度 38/100
GetStream/stream-chat-android#6243 ·
维护者通常 1 天内回复
-
compose feature request
难度 4/5 3-5 天 新手友好度 35/100
GetStream/stream-chat-android#5612 · 3 条评论 ·
维护者通常 1 天内回复
-
core feature request
难度 4/5 3-5 天 新手友好度 25/100
GetStream/stream-chat-android#5279 ·
维护者通常 1 天内回复
-
feature request ui-components
难度 3/5 1-2 天 新手友好度 35/100
GetStream/stream-chat-android#5006 · 3 条评论 ·
维护者通常 1 天内回复
查看 GetStream/stream-chat-android 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 82/100
-
难度 2/5 1-3 小时 新手友好度 72/100
world-federation-of-advertisers/cross-media-measurement#4653 ·
维护者通常 1 天内回复
-
enhancement help wanted
难度 2/5 1-3 小时 新手友好度 70/100
kabirvashisht4-glitch/Vet#22 ·
-
documentation good first issue
难度 1/5 1-3 小时 新手友好度 85/100
djazairdev/wilayas#23 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 85/100
lysine-dev/okhttp#9788 ·
维护者通常 1 天内回复