Improve channel attachments TalkBack accessibility#6460
Conversation
PR checklist ✅All required conditions are satisfied:
🎉 Great job! This PR is ready for review. |
|
@CodeRabbit review |
✅ Actions performedReview triggered.
|
WalkthroughThis PR enhances accessibility for attachment screens in the Stream Chat Compose library. It adds manifest activity labels, introduces semantic pane titles and content descriptions on screen scaffolds and media tiles, applies heading semantics to title components, and provides localized string resources across nine language variants to support the new accessibility features. ChangesAccessibility enhancements for attachment screens
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/channel/attachments/ChannelMediaAttachmentsScreen.kt`:
- Around line 165-171: The outer Box in ChannelMediaAttachmentsScreen ignores
the incoming modifier parameter, so caller-provided modifiers (e.g.,
animateItem) are dropped; update ChannelMediaAttachmentsScreen to include the
function's modifier parameter in the Box's modifier chain (apply modifier then
.clickable/.semantics as before) so external modifiers are honored and behavior
matches ChannelFilesAttachmentsItem.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 58e82dbd-a741-4599-8e1e-371ccbd0b878
📒 Files selected for processing (12)
stream-chat-android-compose-sample/src/main/AndroidManifest.xmlstream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/channel/attachments/ChannelFilesAttachmentsScreen.ktstream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/channel/attachments/ChannelMediaAttachmentsScreen.ktstream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/theme/ChatComponentFactory.ktstream-chat-android-ui-common/src/main/res/values-es/strings.xmlstream-chat-android-ui-common/src/main/res/values-fr/strings.xmlstream-chat-android-ui-common/src/main/res/values-hi/strings.xmlstream-chat-android-ui-common/src/main/res/values-in/strings.xmlstream-chat-android-ui-common/src/main/res/values-it/strings.xmlstream-chat-android-ui-common/src/main/res/values-ja/strings.xmlstream-chat-android-ui-common/src/main/res/values-ko/strings.xmlstream-chat-android-ui-common/src/main/res/values/strings.xml
SDK Size Comparison 📏
|
|
|
🚀 Available in v7.2.0 |



AND-1180
Goal
A TalkBack audit of the channel info subscreens (Photos & Videos, Files) surfaced two real gaps:
This PR addresses both, plus a few related leaf-level a11y tightening on the Files list.
Implementation
Pane title + heading semantics on both screens.
Modifier.semantics { paneTitle = ... }onChannelMediaAttachmentsScreenandChannelFilesAttachmentsScreenScaffoldroots. Fires when the pane appears inside a Compose tree (e.g. NavHost destination).Modifier.semantics { heading() }on the top-bar titleTextin both factory functions (ChannelMediaAttachmentsTopBar,ChannelFilesAttachmentsTopBar), so TalkBack's heading-navigation gesture can jump to it.Modifier.semantics { heading() }onChannelFilesAttachmentsHeaderItem(the sticky month section labels in the Files list), so heading-nav can jump between months.Per-tile contentDescription on the media gallery.
ChannelMediaAttachmentsItemBoxgetsModifier.semantics(mergeDescendants = true) { contentDescription = ... }. The description is composed from photo/video type + sender name. Uses 4 new strings instream-chat-android-ui-common(with translations in 7 locales):stream_ui_channel_attachments_media_item_photo/_video/_photo_from_user/_video_from_user."Photo from Chewbacca"for photos or"Video from Chewbacca, 0:00"for videos (the video badge's duration text merges naturally into the parent label).Sample manifest android:label.
The two Activities (
ChannelMediaAttachmentsActivity,ChannelFilesAttachmentsActivity) are launched as separate<activity>entries with noandroid:label. For Activity-rooted screens, TalkBack uses the Activity title for the screen-level Window announcement on launch —paneTitleis for in-Compose-tree pane transitions, not new Activities. Addingandroid:label="@string/stream_ui_channel_attachments_*_title"to both fixes the bare-Activity case.🎨 UI Changes
No UI changes. All changes are accessibility-tree only (or sample-app manifest only).
Testing
Enable TalkBack on a physical device, run the Compose sample.
Summary by CodeRabbit