Repository navigation
fix(AvatarStack): count rendered children - #8795
Merged
tay1orjones merged 6 commits intoNov 25, 2026
Merged
Conversation
🦋 Changeset detectedLatest commit: 625826b The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
nemo-crypto
had a problem deploying
to
github-pages
November 19, 2026 06:58 — with
GitHub Actions
Failure
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
An optional changelog nit remains, recommending an AvatarStack: prefix and a clearer summary of the affected 3+ layout fix.
1 open issue
What changed in this PR
Fixes AvatarStack layout selection in @primer/react so null and false placeholders do not trigger a multi-avatar layout when only one avatar is visible.
Changes:
- Counts children using the same conversion already used for size inference.
- Adds a regression test for one avatar alongside
nullandfalsechildren. - Includes a patch changeset for the layout fix.
| File | Description |
|---|---|
packages/react/src/AvatarStack/AvatarStack.tsx |
Uses React.Children.toArray for the layout count. |
packages/react/src/AvatarStack/AvatarStack.test.tsx |
Verifies placeholders do not inflate the avatar count. |
.changeset/avatar-stack-visible-count.md |
Records the fix for a patch release. |
Review effort: Max
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
tay1orjones
approved these changes
Nov 25, 2026
tay1orjones
enabled auto-merge
November 25, 2026 21:02
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Integration test results from github/github-ui PR:
All checks passed! |
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Problem
AvatarStack uses React.Children.count to choose its geometry, so null and false placeholders select a multiple-avatar layout even when a single avatar is visible. Count rendered children using the same React child conversion used for size inference.
Verification
Added a Chromium regression for a single avatar with null and false children. The AvatarStack suite passed (9 tests).