Disambiguate composer attachment remove buttons for TalkBack#6433
Disambiguate composer attachment remove buttons for TalkBack#6433andremion wants to merge 2 commits into
Conversation
The (x) remove button on each queued attachment in the Compose composer announced as "Remove attachment" for every item, so TalkBack users could not distinguish between multiple remove buttons. Replace the single contentDescription with per-type, name-aware labels: - Photos / videos: "Remove photo IMG_0023" / "Remove video clip.mp4" (fallback "Remove photo" / "Remove video" when the attachment has no title or name) - Other files: "Remove file report.pdf" (fallback "Remove file") - Voice recordings: "Remove voice message" Adds matching translations for the 7 supported locales. The previously generic stream_compose_remove_attachment resource has no remaining callers and is dropped from all locales, mirroring the cleanup done in PR #6404 for stream_compose_attachments.
|
@CodeRabbit review |
PR checklist ✅All required conditions are satisfied:
🎉 Great job! This PR is ready for review. |
✅ Actions performedReview triggered.
|
WalkthroughAttachment removal actions now display context-specific accessibility descriptions. Voice messages use a dedicated label, file and media attachments use helper functions that choose between generic and named descriptions based on attachment metadata, and string resources are updated across English and seven localized variants. ChangesAttachment Removal Accessibility Descriptions
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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/res/values-ja/strings.xml`:
- Around line 240-246: The Japanese strings.xml still contains the deprecated
generic resource stream_compose_remove_attachment which was removed from other
locales; delete the <string name="stream_compose_remove_attachment"> entry from
this file so the locale matches others, and verify there are no remaining
references to stream_compose_remove_attachment in code or other resource files
(if found, update them to use the corresponding specific keys like
stream_compose_remove_attachment_photo/video/file/voice_message or remove the
references).
🪄 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: 68b9ab51-a35c-432c-83dc-4a95140bbefa
📒 Files selected for processing (11)
stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/messages/composer/internal/attachments/MessageComposerAttachmentAudioRecordItem.ktstream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/messages/composer/internal/attachments/MessageComposerAttachmentFileItem.ktstream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/messages/composer/internal/attachments/MessageComposerAttachmentMediaItem.ktstream-chat-android-compose/src/main/res/values-es/strings.xmlstream-chat-android-compose/src/main/res/values-fr/strings.xmlstream-chat-android-compose/src/main/res/values-hi/strings.xmlstream-chat-android-compose/src/main/res/values-in/strings.xmlstream-chat-android-compose/src/main/res/values-it/strings.xmlstream-chat-android-compose/src/main/res/values-ja/strings.xmlstream-chat-android-compose/src/main/res/values-ko/strings.xmlstream-chat-android-compose/src/main/res/values/strings.xml
SDK Size Comparison 📏
|
Add three Paparazzi snapshot tests rendering each composer attachment item (image, video, file) with a copy of the existing preview data that clears the title and name, exercising the previously uncovered fallback arms of fileAttachmentRemoveDescription and mediaAttachmentRemoveDescription. Extract a shared MessageComposerAttachmentItem helper to dedupe the preview-handler wiring across the four media-item previews.
|



Goal
Resolve Accessibility issue 88 — Attachment Picker
The (x) remove button on each queued attachment in the Compose composer is announced as the same generic "Remove attachment" for every item. With multiple attachments queued, TalkBack users could not tell the remove buttons apart and had no way to confirm which attachment they were about to delete.
Implementation
Replace the single
R.string.stream_compose_remove_attachmentwith per-type, name-aware labels resolved locally inside each composer attachment item:MessageComposerAttachmentMediaItem) —"Remove photo IMG_0023"/"Remove video clip.mp4", falling back to"Remove photo"/"Remove video"when the attachment exposes no title or name. Type comes fromattachment.type == AttachmentType.VIDEO.MessageComposerAttachmentFileItem) —"Remove file report.pdf", falling back to"Remove file".MessageComposerAttachmentAudioRecordItem) —"Remove voice message"(recordings have no useful filename to surface).Display name follows the codebase's standard pick
attachment.title ?: attachment.name. The new string resources are added with translations for all 7 supported locales (es, fr, hi, in, it, ja, ko). The previously genericstream_compose_remove_attachmentresource has no remaining callers and is dropped from all locales — same cleanup pattern as #6404, which removedstream_compose_attachmentsafter the picker-button a11y refactor.No public API surface changes (these composables are routed through
ChatTheme.componentFactory.MessageComposerAttachment{File,Media,AudioRecord}ItemandapiDumpproduces no diff).Testing
Manual steps on the Compose sample with TalkBack enabled:
"Remove photo <filename>"— the two announcements must differ."Remove video <filename>"."Remove file <filename>"."Remove voice message".titleand noname(e.g. via a customMessageComposerControllerplug-in), confirm the fallback"Remove photo"/"Remove video"/"Remove file"is announced.Summary by CodeRabbit
Release Notes