Clean up TalkBack accessibility semantics#6498
Conversation
The locked and overview rows set contentDescription on a mergeDescendants container, which concatenates with the child descriptions (duration, progress) so any new child silently shifts the announce. Move the label onto a child leaf (the leading icon and the waveform) so the announce is composed from the children in visual order, and keep the merge only as the single TalkBack focus stop.
Remove the empty Modifier.semantics(mergeDescendants = true) {} blocks on
Rows that already have a clickable or toggleable, where the merge boundary
is implicit. Keep the load-bearing ones (containers with no click handler)
and add a short comment explaining that they group their children into a
single TalkBack focus stop.
The focused ephemeral Giphy preview announced "Only visible to you, [alt text], Giphy". Compose a single description that leads with "Giphy preview", then the alt text, then "Only visible to you", and apply it via clearAndSetSemantics so the merged stop reads in that order. Add the stream_compose_giphy_preview_label string in all supported locales.
Add isTraversalGroup to the multi-image grid container so that once focus is inside the grid, a swipe walks every tile in order before leaving, instead of letting the surrounding list pull focus across rows mid-grid.
PR checklist ✅All required conditions are satisfied:
🎉 Great job! This PR is ready for review. |
|
@CodeRabbit review |
✅ Action performedReview finished.
|
SDK Size Comparison 📏
|
WalkthroughThis PR refactors TalkBack accessibility semantics across the Stream Chat Compose UI library. Changes include composing Giphy preview descriptions from multiple text sources, enabling grid traversal grouping for media attachments, relocating content descriptions from parent to leaf components in audio recording, removing redundant semantics modifiers from toggleable/clickable elements, and documenting accessibility intent throughout the codebase with clarifying comments. ChangesTalkBack Accessibility Semantics
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
🚥 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 |
MessageGiphyContent composes and owns the focused preview's merged TalkBack description and clears the inner GiphyAttachmentContent semantics. Note in the KDoc that customizing the preview's accessibility announcement should override MessageGiphyContent rather than GiphyAttachmentContent.
|



Goal
The TalkBack sweep (AND-1180) left the Compose SDK's accessibility code uneven: a few parent-level overrides re-derive what their children already announce, and some empty merge-semantics blocks add noise. This consolidates the remaining cleanup into one pass, and folds in the verified media-grid traversal change and the QA reorder feedback on the Giphy preview, so we stop opening a PR per finding.
Implementation
Four independent changes, one per commit:
contentDescriptionundermergeDescendantsconcatenated with the child descriptions (duration, progress), so any new child silently shifted the announce. The label now lives on a child leaf (the leading icon, the waveform) and the merge stays only as the single TalkBack focus stop.Modifier.semantics(mergeDescendants = true) {}on Rows that already have aclickableortoggleable(the merge boundary is implicit there), and kept plus commented the load-bearing ones (containers with no click handler, such as the deleted-message fallback).clearAndSetSemantics). Added thestream_compose_giphy_preview_labelstring in all supported locales.isTraversalGroupso a TalkBack swipe walks every tile in order before leaving the grid.No public API change (
apiCheckpasses). The changes are semantics and string only.Testing
Manual TalkBack testing on a device or emulator:
/giphy <query>command. With TalkBack on, focus the rendered preview. It should read as a single stop: "Giphy preview, [search query / alt text], Only visible to you" (leading with "Giphy preview"). Verified on-device: the merged accessibility node exposescontentDescription="Giphy preview, <query>, Only visible to you".Summary by CodeRabbit
Improvements
Localization