Skip to content

feat(ui): add semanticsLabel to StreamAvatar / Group / Stack - #132

Merged
xsahil03x merged 2 commits into
mainfrom
feat/avatar-a11y
Jul 24, 2026
Merged

feat(ui): add semanticsLabel to StreamAvatar / Group / Stack#132
xsahil03x merged 2 commits into
mainfrom
feat/avatar-a11y

Conversation

@xsahil03x

@xsahil03x xsahil03x commented Jul 20, 2026

Copy link
Copy Markdown
Member

Summary

  • Adds optional semanticsLabel to StreamAvatar, StreamAvatarGroup, and StreamAvatarStack.
  • null (default) composes through — placeholder / children speak per their own contract.
  • Non-null exposes the widget as a single labeled image node and drops descendants (initials, icons, +N overflow badge) from the semantics tree.

Linear tickets

Test plan

  • flutter test in stream_core_flutter — new avatar / group / stack tests pass.
  • Manual pass with TalkBack / VoiceOver on a fixture app.

🤖 Generated with Claude Code

…amAvatarStack

null (default) composes through — the placeholder or children speak
per their own contract. Non-null exposes the widget as a single
labeled image node and drops descendants (initials, icons, "+N"
overflow badge) from the semantics tree.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@xsahil03x
xsahil03x requested a review from a team as a code owner July 20, 2026 22:01
@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@xsahil03x, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 55 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: d0803759-4274-415e-9298-d6b44fe66712

📥 Commits

Reviewing files that changed from the base of the PR and between c711bba and 261b508.

📒 Files selected for processing (1)
  • packages/stream_core_flutter/CHANGELOG.md
📝 Walkthrough

Walkthrough

Changes

Avatar accessibility semantics

Layer / File(s) Summary
Individual avatar semantics
packages/stream_core_flutter/lib/src/components/avatar/stream_avatar.dart, packages/stream_core_flutter/test/components/avatar/stream_avatar_test.dart
StreamAvatar accepts an optional semanticsLabel; non-null labels expose a labeled image and exclude placeholder initials, with widget tests covering default, excluded, and labeled behavior.
Group and stack semantics
packages/stream_core_flutter/lib/src/components/avatar/stream_avatar_group.dart, packages/stream_core_flutter/lib/src/components/avatar/stream_avatar_stack.dart, packages/stream_core_flutter/CHANGELOG.md
Avatar groups and stacks accept optional labels that collapse child and overflow semantics into one labeled image node; the changelog documents the behavior.
Group and stack accessibility tests
packages/stream_core_flutter/test/components/avatar/stream_avatar_group_test.dart, packages/stream_core_flutter/test/components/avatar/stream_avatar_stack_test.dart
Widget tests verify child-label propagation, parent-label semantics, and suppression of overflow badge semantics.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Suggested reviewers: renefloor

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
Title check ✅ Passed The title clearly states the main change: adding semanticsLabel to the avatar, group, and stack components.
Description check ✅ Passed It covers the summary, ticket reference, and test plan; only the CLA checklist and screenshots section from the template are missing.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/avatar-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.

@codecov

codecov Bot commented Jul 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 47.45%. Comparing base (0abeef5) to head (261b508).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #132      +/-   ##
==========================================
+ Coverage   44.59%   47.45%   +2.86%     
==========================================
  Files         179      179              
  Lines        7252     7259       +7     
==========================================
+ Hits         3234     3445     +211     
+ Misses       4018     3814     -204     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
packages/stream_core_flutter/lib/src/components/avatar/stream_avatar.dart (1)

214-256: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Extract the repeated Semantics-wrap block into a shared helper. The same if (props.semanticsLabel case final label?) { ... Semantics(label: label, image: true, excludeSemantics: true, child: x) ... } block is copy-pasted identically in all three widget files.

  • packages/stream_core_flutter/lib/src/components/avatar/stream_avatar.dart#L214-L256: extract this block into a shared Widget wrapWithSemanticsLabel(Widget child, String? label) helper (or similar) and call it here.
  • packages/stream_core_flutter/lib/src/components/avatar/stream_avatar_group.dart#L172-L213: call the same shared helper instead of duplicating the block.
  • packages/stream_core_flutter/lib/src/components/avatar/stream_avatar_stack.dart#L212-L245: call the same shared helper instead of duplicating the block.
♻️ Example helper
Widget wrapWithSemanticsLabel(Widget child, String? label) {
  if (label == null) return child;
  return Semantics(
    label: label,
    image: true,
    excludeSemantics: true,
    child: child,
  );
}
🤖 Prompt for 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.

In `@packages/stream_core_flutter/lib/src/components/avatar/stream_avatar.dart`
around lines 214 - 256, Extract the duplicated semantics wrapper into a shared
wrapWithSemanticsLabel helper that returns the child unchanged for a null label
and otherwise applies Semantics with the existing label, image, and
excludeSemantics settings. In
packages/stream_core_flutter/lib/src/components/avatar/stream_avatar.dart#L214-L256,
replace the local if block with the helper; make the same replacement in
packages/stream_core_flutter/lib/src/components/avatar/stream_avatar_group.dart#L172-L213
and
packages/stream_core_flutter/lib/src/components/avatar/stream_avatar_stack.dart#L212-L245.
🤖 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.

Nitpick comments:
In `@packages/stream_core_flutter/lib/src/components/avatar/stream_avatar.dart`:
- Around line 214-256: Extract the duplicated semantics wrapper into a shared
wrapWithSemanticsLabel helper that returns the child unchanged for a null label
and otherwise applies Semantics with the existing label, image, and
excludeSemantics settings. In
packages/stream_core_flutter/lib/src/components/avatar/stream_avatar.dart#L214-L256,
replace the local if block with the helper; make the same replacement in
packages/stream_core_flutter/lib/src/components/avatar/stream_avatar_group.dart#L172-L213
and
packages/stream_core_flutter/lib/src/components/avatar/stream_avatar_stack.dart#L212-L245.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6961d9ec-af6d-4079-9183-ec8444cb3a1c

📥 Commits

Reviewing files that changed from the base of the PR and between 59b3f4e and c711bba.

📒 Files selected for processing (7)
  • packages/stream_core_flutter/CHANGELOG.md
  • packages/stream_core_flutter/lib/src/components/avatar/stream_avatar.dart
  • packages/stream_core_flutter/lib/src/components/avatar/stream_avatar_group.dart
  • packages/stream_core_flutter/lib/src/components/avatar/stream_avatar_stack.dart
  • packages/stream_core_flutter/test/components/avatar/stream_avatar_group_test.dart
  • packages/stream_core_flutter/test/components/avatar/stream_avatar_stack_test.dart
  • packages/stream_core_flutter/test/components/avatar/stream_avatar_test.dart

xsahil03x added a commit to GetStream/stream-chat-flutter that referenced this pull request Jul 20, 2026
Points the git dep at c711bba, the commit on the open
GetStream/stream-core-flutter#132 branch that adds `semanticsLabel` to
`StreamAvatar` / `StreamAvatarGroup` / `StreamAvatarStack`. Required
so our chat-side widgets compile; must be swapped to the merged main
ref once #132 lands.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@xsahil03x
xsahil03x enabled auto-merge (squash) July 24, 2026 10:38
@xsahil03x
xsahil03x merged commit 5b5c51a into main Jul 24, 2026
11 checks passed
@xsahil03x
xsahil03x deleted the feat/avatar-a11y branch July 24, 2026 10:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants