Skip to content

Improve channel attachments TalkBack accessibility#6460

Merged
andremion merged 6 commits into
developfrom
fix/compose-channel-media-files-a11y
May 21, 2026
Merged

Improve channel attachments TalkBack accessibility#6460
andremion merged 6 commits into
developfrom
fix/compose-channel-media-files-a11y

Conversation

@andremion
Copy link
Copy Markdown
Contributor

@andremion andremion commented May 21, 2026

AND-1180

Goal

A TalkBack audit of the channel info subscreens (Photos & Videos, Files) surfaced two real gaps:

  1. No screen title announced on entry. Both subscreens are launched as separate Activities. TalkBack jumped straight to the back button — the user heard "Back, button" before any signal of which screen they were on.
  2. Channel media gallery tiles were silent. Scanner flagged every tile in the grid with "may not have a label readable by screen readers". For video tiles, the only thing announced was the duration text — and multiple "0:00" tiles announced identically.

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 = ... } on ChannelMediaAttachmentsScreen and ChannelFilesAttachmentsScreen Scaffold roots. Fires when the pane appears inside a Compose tree (e.g. NavHost destination).
  • Modifier.semantics { heading() } on the top-bar title Text in both factory functions (ChannelMediaAttachmentsTopBar, ChannelFilesAttachmentsTopBar), so TalkBack's heading-navigation gesture can jump to it.
  • Modifier.semantics { heading() } on ChannelFilesAttachmentsHeaderItem (the sticky month section labels in the Files list), so heading-nav can jump between months.

Per-tile contentDescription on the media gallery.

  • ChannelMediaAttachmentsItem Box gets Modifier.semantics(mergeDescendants = true) { contentDescription = ... }. The description is composed from photo/video type + sender name. Uses 4 new strings in stream-chat-android-ui-common (with translations in 7 locales): stream_ui_channel_attachments_media_item_photo / _video / _photo_from_user / _video_from_user.
  • The composed announcement is e.g. "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 no android:label. For Activity-rooted screens, TalkBack uses the Activity title for the screen-level Window announcement on launch — paneTitle is for in-Compose-tree pane transitions, not new Activities. Adding android: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.

  1. Open a 1:1 channel → tap the channel avatar → tap Photos & Videos.
  2. On screen entry, TalkBack should announce "Photos & Videos" before landing focus on the back button.
  3. Swipe through the grid: each tile should announce as "Photo from {sender name}" or "Video from {sender name}, {duration}" plus the standard activation hint. Different senders → different labels.
  4. From the channel info, tap Files.
  5. On screen entry, TalkBack should announce "Files" before landing focus on the back button.
  6. Swipe through the list: month headers ("March", "February", etc.) should announce as headings; file rows should read "{filename}, {size}, double-tap to activate".
  7. Use TalkBack's heading-navigation gesture (swipe up/down with the rotor) to jump between month headers and the screen title.

Summary by CodeRabbit

  • New Features
    • Enhanced accessibility support with improved screen reader descriptions and semantic labels for attachment screens
    • Expanded multi-language support with new localized strings for media attachments across 10 languages (English, Spanish, French, Hindi, Indonesian, Italian, Japanese, Korean)
    • Added descriptive titles and labels for file and media attachment screens

Review Change Stack

@andremion andremion requested a review from a team as a code owner May 21, 2026 12:56
@andremion andremion added the pr:improvement Improvement label May 21, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 21, 2026

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.

@andremion
Copy link
Copy Markdown
Contributor Author

@CodeRabbit review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 21, 2026

✅ Actions performed

Review triggered.

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
Copy link
Copy Markdown

coderabbitai Bot commented May 21, 2026

Walkthrough

This 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.

Changes

Accessibility enhancements for attachment screens

Layer / File(s) Summary
Activity manifest labels
stream-chat-android-compose-sample/src/main/AndroidManifest.xml
Activity declarations for ChannelFilesAttachmentsActivity and ChannelMediaAttachmentsActivity are reformatted and now include explicit android:label attributes.
Localized string resources for media items
stream-chat-android-ui-common/src/main/res/values*/strings.xml
Four new media item string resources (photo, video, photo from user, video from user) are added in English base strings and eight localized variants (Spanish, French, Hindi, Indonesian, Italian, Japanese, Korean).
Screen pane title accessibility semantics
stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/channel/attachments/ChannelFilesAttachmentsScreen.kt, ChannelMediaAttachmentsScreen.kt
Both attachment screens set localized paneTitle semantics on their Scaffold composables. Media screen computes localized contentDescription for each tile based on attachment type (video/photo) and sender name presence, then applies it via merged semantics.
Component heading semantics
stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/theme/ChatComponentFactory.kt
Heading semantics are applied to three title Text components: ChannelFilesAttachmentsTopBar, ChannelFilesAttachmentsHeaderItem, and ChannelMediaAttachmentsTopBar.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Suggested reviewers

  • gpunto

Poem

🐰 Hop along the accessible path,
Where pane titles and headings align,
Media tiles speak their language true,
Nine tongues strong, each one fine!
Semantics dance in Compose's light.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Improve channel attachments TalkBack accessibility' clearly and concisely summarizes the main change: enhancing accessibility for TalkBack (screen reader) on attachment screens.
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 PR description is comprehensive and well-structured, covering goal, detailed implementation with code patterns, accessibility semantics, multi-locale string additions, and clear testing instructions aligned with TalkBack accessibility verification.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/compose-channel-media-files-a11y

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

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

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 724e936 and 45987c7.

📒 Files selected for processing (12)
  • stream-chat-android-compose-sample/src/main/AndroidManifest.xml
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/channel/attachments/ChannelFilesAttachmentsScreen.kt
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/channel/attachments/ChannelMediaAttachmentsScreen.kt
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/theme/ChatComponentFactory.kt
  • stream-chat-android-ui-common/src/main/res/values-es/strings.xml
  • stream-chat-android-ui-common/src/main/res/values-fr/strings.xml
  • stream-chat-android-ui-common/src/main/res/values-hi/strings.xml
  • stream-chat-android-ui-common/src/main/res/values-in/strings.xml
  • stream-chat-android-ui-common/src/main/res/values-it/strings.xml
  • stream-chat-android-ui-common/src/main/res/values-ja/strings.xml
  • stream-chat-android-ui-common/src/main/res/values-ko/strings.xml
  • stream-chat-android-ui-common/src/main/res/values/strings.xml

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 21, 2026

SDK Size Comparison 📏

SDK Before After Difference Status
stream-chat-android-client 5.82 MB 5.82 MB 0.00 MB 🟢
stream-chat-android-ui-components 11.02 MB 11.02 MB 0.00 MB 🟢
stream-chat-android-compose 12.41 MB 12.41 MB 0.00 MB 🟢

@andremion andremion enabled auto-merge (squash) May 21, 2026 13:22
@sonarqubecloud
Copy link
Copy Markdown

@andremion andremion merged commit 00f3cf9 into develop May 21, 2026
17 checks passed
@andremion andremion deleted the fix/compose-channel-media-files-a11y branch May 21, 2026 14:00
@stream-public-bot stream-public-bot added the released Included in a release label May 22, 2026
@stream-public-bot
Copy link
Copy Markdown
Contributor

🚀 Available in v7.2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:improvement Improvement released Included in a release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants