feat(ui): add semanticsLabel to StreamAvatar / Group / Stack - #132
Conversation
…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>
|
Warning Review limit reached
Next review available in: 55 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the 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 configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughChangesAvatar accessibility semantics
Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 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 |
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/stream_core_flutter/lib/src/components/avatar/stream_avatar.dart (1)
214-256: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winExtract 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 sharedWidget 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
📒 Files selected for processing (7)
packages/stream_core_flutter/CHANGELOG.mdpackages/stream_core_flutter/lib/src/components/avatar/stream_avatar.dartpackages/stream_core_flutter/lib/src/components/avatar/stream_avatar_group.dartpackages/stream_core_flutter/lib/src/components/avatar/stream_avatar_stack.dartpackages/stream_core_flutter/test/components/avatar/stream_avatar_group_test.dartpackages/stream_core_flutter/test/components/avatar/stream_avatar_stack_test.dartpackages/stream_core_flutter/test/components/avatar/stream_avatar_test.dart
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>
Summary
semanticsLabeltoStreamAvatar,StreamAvatarGroup, andStreamAvatarStack.null(default) composes through — placeholder / children speak per their own contract.+Noverflow badge) from the semantics tree.Linear tickets
Test plan
flutter testinstream_core_flutter— new avatar / group / stack tests pass.🤖 Generated with Claude Code