From 714b1e205ddd591913c304a87eaf159a85005ca8 Mon Sep 17 00:00:00 2001 From: Samuel Newman Date: Sat, 13 Jun 2026 00:57:31 +0300 Subject: [PATCH] Fix invite card avatar pile not reflecting member count (#10891) --- src/components/AvatarBubbles.tsx | 16 +++++++++++++--- src/components/dms/ChatInvite/Card.tsx | 7 ++++++- src/components/intents/GroupChatJoinDialog.tsx | 6 ++---- src/screens/Messages/JoinRequest.tsx | 8 ++------ .../components/OutgoingRequestListItem.tsx | 8 ++------ 5 files changed, 25 insertions(+), 20 deletions(-) diff --git a/src/components/AvatarBubbles.tsx b/src/components/AvatarBubbles.tsx index 894e1f34f5..49ac4d006f 100644 --- a/src/components/AvatarBubbles.tsx +++ b/src/components/AvatarBubbles.tsx @@ -31,9 +31,10 @@ export function AvatarBubbles({ profiles: allProfiles, self = false, size = 120, + count, }: { animate?: boolean - profiles: (bsky.profile.AnyProfileView | undefined)[] + profiles: bsky.profile.AnyProfileView[] /** * By default, when there are more than 2 profiles, the current user is * filtered out (so you don't see yourself among your own group's members). @@ -42,13 +43,22 @@ export function AvatarBubbles({ */ self?: boolean size?: number + /** + * The true number of members, used to decide how many bubbles to render when + * it exceeds the number of `profiles` we have on hand (e.g. an invite preview + * that only carries a few member profiles for a much larger group). Slots + * without a profile render as placeholders. Defaults to `profiles.length`. + */ + count?: number }) { const {currentAccount} = useSession() const profiles = !self && allProfiles.length > 2 - ? allProfiles.filter(p => !p || p.did !== currentAccount?.did) + ? allProfiles.filter(p => p.did !== currentAccount?.did) : allProfiles + const bubbleCount = Math.max(profiles.length, count ?? 0) + const scale = size / 120 const marginOffset = size < 120 ? -2 : 0 @@ -79,7 +89,7 @@ export function AvatarBubbles({ }, [animate, p0, p1, p2, p3]) const scales = [p0, p1, p2, p3] - const layouts = getLayouts(profiles.length) + const layouts = getLayouts(bubbleCount) return ( diff --git a/src/components/dms/ChatInvite/Card.tsx b/src/components/dms/ChatInvite/Card.tsx index 33183f82cb..894e36848d 100644 --- a/src/components/dms/ChatInvite/Card.tsx +++ b/src/components/dms/ChatInvite/Card.tsx @@ -29,7 +29,12 @@ export function Card({size}: {size: 'large' | 'small'}) { return ( - + diff --git a/src/screens/Messages/JoinRequest.tsx b/src/screens/Messages/JoinRequest.tsx index b85a056cb6..6ce57a151b 100644 --- a/src/screens/Messages/JoinRequest.tsx +++ b/src/screens/Messages/JoinRequest.tsx @@ -103,12 +103,8 @@ export function JoinRequest({setScreenState}: Props) { ChatBskyGroupDefs.isJoinLinkPreviewView(joinLinkPreview) ? ( diff --git a/src/screens/Messages/components/OutgoingRequestListItem.tsx b/src/screens/Messages/components/OutgoingRequestListItem.tsx index fc0475aee5..b5dcdf08df 100644 --- a/src/screens/Messages/components/OutgoingRequestListItem.tsx +++ b/src/screens/Messages/components/OutgoingRequestListItem.tsx @@ -63,12 +63,8 @@ export function OutgoingRequestListItem({ (hovered || pressed || focused) && t.atoms.bg_contrast_25, ]}>