Skip to content

chore: adjustmens to Avatar, GroupAvatar and ChannelAvatar#3087

Merged
arnautov-anton merged 1 commit intomasterfrom
chore/avatar-adjustments
Apr 2, 2026
Merged

chore: adjustmens to Avatar, GroupAvatar and ChannelAvatar#3087
arnautov-anton merged 1 commit intomasterfrom
chore/avatar-adjustments

Conversation

@arnautov-anton
Copy link
Copy Markdown
Contributor

@arnautov-anton arnautov-anton commented Apr 2, 2026

Removed overflowCount prop from GroupAvatar

The overflowCount prop has been removed from GroupAvatarProps. Overflow is now calculated automatically: when displayMembers has more than 4 entries, only the first 2 are rendered and a "+N" badge shows the remainder.

Removed overflowCount prop from AvatarStack

The overflowCount prop has been removed from AvatarStack. Overflow is now calculated automatically based on the new capLimit prop (defaults to 3): when displayInfo has more entries than capLimit, only the first capLimit items are rendered and a "+N" badge shows the remainder.

Removed overflowCount and explicit displayMembers from ChannelAvatarProps

The overflowCount prop has been removed from ChannelAvatarProps. The displayMembers prop is no longer declared directly on ChannelAvatarProps β€” it is still accepted because it is inherited from Partial<GroupAvatarProps>, but it is no longer independently typed on the interface.

ChannelAvatarProps.size type widened

The size prop on ChannelAvatarProps changed from GroupAvatarProps['size'] (i.e., '2xl' | 'xl' | 'lg' | null) to GroupAvatarProps['size'] | AvatarProps['size'] (i.e., '2xl' | 'xl' | 'lg' | 'md' | 'sm' | 'xs' | (string & {}) | null). This is not a breaking change for existing code but changes the accepted values.

getGroupChannelDisplayInfo return value changed

The utility function getGroupChannelDisplayInfo (from src/components/ChannelListItem/utils.tsx) no longer returns overflowCount in its result object.

AvatarProps.size type widened to accept arbitrary strings

The size prop on AvatarProps changed from the union '2xl' | 'xl' | 'lg' | 'md' | 'sm' | 'xs' | null to '2xl' | 'xl' | 'lg' | 'md' | 'sm' | 'xs' | (string & {}) | null. This allows passing custom size strings while preserving autocomplete for the known values.

GroupAvatarProps.size type widened to accept arbitrary strings

The size prop on GroupAvatarProps changed from '2xl' | 'xl' | 'lg' | null to '2xl' | 'xl' | 'lg' | (string & {}) | null. This allows passing custom size strings while preserving autocomplete for the known values.

New capLimit prop on AvatarStack

A new optional capLimit prop (type number, default 3) controls the maximum number of avatars rendered before overflow. When displayInfo has more entries than capLimit, only the first capLimit items are shown and a "+N" badge displays the remainder.

GroupAvatarMember type gains optional id field

The GroupAvatarMember type now includes an optional id?: string field. When present, it is used as the React key for rendered avatars instead of the fallback ${userName}-${imageUrl}-${index} pattern.

Behavioral Changes

ChannelAvatar always renders via GroupAvatar internally

Previously, ChannelAvatar conditionally chose between <Avatar> (for 0–1 members) and <GroupAvatar> (for 2+ members). It now always delegates to <GroupAvatar>, which itself renders a single <Avatar> when fewer than 2 members are present. The visual output is unchanged, but the component tree structure differs.

GroupAvatar auto-caps displayed members at 4 (or 2 with overflow)

Previously, callers controlled how many members to display and the overflow count. Now GroupAvatar internally slices displayMembers:

  • 4 or fewer members: all are rendered, no badge.
  • More than 4 members: only the first 2 are rendered, with a "+N" badge showing the count of remaining members.

AvatarStack auto-caps displayed items (default: 3, configurable via capLimit)

Previously, callers controlled how many items to display and the overflow count. Now AvatarStack internally slices displayInfo based on the capLimit prop (default 3):

  • capLimit or fewer items: all are rendered, no badge.
  • More than capLimit items: only the first capLimit are rendered, with a "+N" badge showing the count of remaining items.

TypingIndicator no longer manually slices typing users

The TypingIndicator component previously sliced the list of typing users to a maximum of 3 before passing to AvatarStack. It now passes all typing users, relying on AvatarStack's internal capping (also at 3). The net visual result is unchanged.

@arnautov-anton arnautov-anton force-pushed the chore/avatar-adjustments branch from 3a0c328 to 10b504b Compare April 2, 2026 09:55
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 2, 2026

Size Change: -29 B (0%)

Total Size: 613 kB

πŸ“¦ View Changed
Filename Size Change
dist/cjs/index.js 237 kB -12 B (-0.01%)
dist/es/index.mjs 235 kB -17 B (-0.01%)
ℹ️ View Unchanged
Filename Size
dist/cjs/audioProcessing.js 1.32 kB
dist/cjs/emojis.js 2.96 kB
dist/cjs/mp3-encoder.js 1.27 kB
dist/cjs/WithAudioPlayback.js 42.4 kB
dist/css/emoji-replacement.css 456 B
dist/css/index.css 45.4 kB
dist/es/audioProcessing.mjs 1.31 kB
dist/es/emojis.mjs 2.47 kB
dist/es/mp3-encoder.mjs 756 B
dist/es/WithAudioPlayback.mjs 42.2 kB

compressed-size-action

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 2, 2026

Codecov Report

βœ… All modified and coverable lines are covered by tests.
βœ… Project coverage is 79.57%. Comparing base (7b5835e) to head (3ddd6f3).
⚠️ Report is 6 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3087      +/-   ##
==========================================
+ Coverage   79.53%   79.57%   +0.03%     
==========================================
  Files         426      426              
  Lines       12174    12179       +5     
  Branches     3916     3914       -2     
==========================================
+ Hits         9683     9691       +8     
+ Misses       2491     2488       -3     

β˜” View full report in Codecov by Sentry.
πŸ“’ 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.
  • πŸ“¦ JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@arnautov-anton arnautov-anton force-pushed the chore/avatar-adjustments branch from 10b504b to 5bd8052 Compare April 2, 2026 10:39
@arnautov-anton arnautov-anton force-pushed the chore/avatar-adjustments branch from 5bd8052 to 3ddd6f3 Compare April 2, 2026 10:49
@arnautov-anton arnautov-anton marked this pull request as ready for review April 2, 2026 11:48
@arnautov-anton arnautov-anton merged commit 49d576e into master Apr 2, 2026
9 checks passed
@arnautov-anton arnautov-anton deleted the chore/avatar-adjustments branch April 2, 2026 15:57
github-actions bot pushed a commit that referenced this pull request Apr 3, 2026
## [14.0.0-beta.6](v14.0.0-beta.5...v14.0.0-beta.6) (2026-04-03)

### ⚠ BREAKING CHANGES

* for existing code but changes the accepted values.

### `getGroupChannelDisplayInfo` return value changed

The utility function `getGroupChannelDisplayInfo` (from
`src/components/ChannelListItem/utils.tsx`) no longer returns
`overflowCount` in its result object.

### `AvatarProps.size` type widened to accept arbitrary strings

The `size` prop on `AvatarProps` changed from the union `'2xl' | 'xl' |
'lg' | 'md' | 'sm' | 'xs' | null` to `'2xl' | 'xl' | 'lg' | 'md' | 'sm'
| 'xs' | (string & {}) | null`. This allows passing custom size strings
while preserving autocomplete for the known values.

### `GroupAvatarProps.size` type widened to accept arbitrary strings

The `size` prop on `GroupAvatarProps` changed from `'2xl' | 'xl' | 'lg'
| null` to `'2xl' | 'xl' | 'lg' | (string & {}) | null`. This allows
passing custom size strings while preserving autocomplete for the known
values.

### New `capLimit` prop on `AvatarStack`

A new optional `capLimit` prop (type `number`, default `3`) controls the
maximum number of avatars rendered before overflow. When `displayInfo`
has more entries than `capLimit`, only the first `capLimit` items are
shown and a "+N" badge displays the remainder.

### `GroupAvatarMember` type gains optional `id` field

The `GroupAvatarMember` type now includes an optional `id?: string`
field. When present, it is used as the React `key` for rendered avatars
instead of the fallback `${userName}-${imageUrl}-${index}` pattern.

## Behavioral Changes

### `ChannelAvatar` always renders via `GroupAvatar` internally

Previously, `ChannelAvatar` conditionally chose between `<Avatar>` (for
0–1 members) and `<GroupAvatar>` (for 2+ members). It now always
delegates to `<GroupAvatar>`, which itself renders a single `<Avatar>`
when fewer than 2 members are present. The visual output is unchanged,
but the component tree structure differs.

### `GroupAvatar` auto-caps displayed members at 4 (or 2 with overflow)

Previously, callers controlled how many members to display and the
overflow count. Now `GroupAvatar` internally slices `displayMembers`:
- **4 or fewer members:** all are rendered, no badge.
- **More than 4 members:** only the first 2 are rendered, with a "+N"
badge showing the count of remaining members.

### `AvatarStack` auto-caps displayed items (default: 3, configurable
via `capLimit`)

Previously, callers controlled how many items to display and the
overflow count. Now `AvatarStack` internally slices `displayInfo` based
on the `capLimit` prop (default `3`):
- **`capLimit` or fewer items:** all are rendered, no badge.
- **More than `capLimit` items:** only the first `capLimit` are
rendered, with a "+N" badge showing the count of remaining items.

### `TypingIndicator` no longer manually slices typing users

The `TypingIndicator` component previously sliced the list of typing
users to a maximum of 3 before passing to `AvatarStack`. It now passes
all typing users, relying on `AvatarStack`'s internal capping (also at
3). The net visual result is unchanged.

### chore

* adjustmens to Avatar, GroupAvatar and ChannelAvatar ([#3087](#3087)) ([49d576e](49d576e))

### Bug Fixes

* **examples:** clean up tutorial examples for v14 ([#3089](#3089)) ([6239895](6239895))
* **examples:** enable async voice recording preview in thread composer ([#3092](#3092)) ([6c7cd42](6c7cd42))
* **examples:** fix resize handle alignment and thread border gap in RTL ([#3091](#3091)) ([2f060ae](2f060ae))
* **Icons, RTL:** update icon catalog, RTL layout fixes, dark mode & thread voice recording ([#3090](#3090)) ([a4b1c26](a4b1c26)), closes [#3080](#3080)
@stream-ci-bot
Copy link
Copy Markdown

πŸŽ‰ This PR is included in version 14.0.0-beta.6 πŸŽ‰

The release is available on:

Your semantic-release bot πŸ“¦πŸš€

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants