From bb247abc3e4dd20edcdc4efc04db4d5ce52dabde Mon Sep 17 00:00:00 2001 From: Arjun Patel Date: Tue, 9 Jun 2026 11:42:06 -0700 Subject: [PATCH 1/5] show private for sterams with no other members --- .../src/features/particles/stream-top-bar.tsx | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/js/desktop/src/features/particles/stream-top-bar.tsx b/js/desktop/src/features/particles/stream-top-bar.tsx index 97f0f25..c6b19e7 100644 --- a/js/desktop/src/features/particles/stream-top-bar.tsx +++ b/js/desktop/src/features/particles/stream-top-bar.tsx @@ -24,6 +24,7 @@ import { CircleDot, EllipsisVertical, Pencil, + Lock, Globe, Trash2, } from 'lucide-react'; @@ -271,17 +272,19 @@ function MembersIndicator({ }) { const network = useNetwork(networkId); const visibility = parseVisibleTo(streamParticle.visible_to, networkId); + + const userId = useAuthStore((s) => s.user?.id); const humans = network?.humans ?? []; - const memberIds = + const othersIds = visibility.mode === 'network' - ? humans.map((h) => h.id) - : visibility.humanIds; - const shownMembers = memberIds + ? [] + : visibility.humanIds.filter((id) => id != userId); + const shownMembers = othersIds .slice(0, 3) .map((id) => humans.find((h) => h.id === id)) .filter((h): h is NonNullable => !!h); - const overflow = memberIds.length - shownMembers.length; + const overflow = othersIds.length - othersIds.length; return ( @@ -295,7 +298,7 @@ function MembersIndicator({ Everyone - ) : ( + ) : othersIds.length > 0 ? ( <> {shownMembers.map((human) => ( @@ -310,13 +313,18 @@ function MembersIndicator({ +{overflow} )} + ) : ( + <> + + Private + )} {visibility.mode === 'network' ? `Everyone in ${network?.name ?? 'network'}` - : `${memberIds.length} ${memberIds.length === 1 ? 'member' : 'members'}`} + : `${othersIds.length + 1} ${othersIds.length + 1 === 1 ? 'member' : 'members'}`} ); -- 2.54.0 From 209674ed7764d1d3f2e905c5ecbbc7a7d585a5e9 Mon Sep 17 00:00:00 2001 From: Arjun Patel Date: Tue, 9 Jun 2026 11:42:23 -0700 Subject: [PATCH 2/5] invalid calculation --- js/desktop/src/features/particles/stream-top-bar.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/desktop/src/features/particles/stream-top-bar.tsx b/js/desktop/src/features/particles/stream-top-bar.tsx index c6b19e7..1306f6b 100644 --- a/js/desktop/src/features/particles/stream-top-bar.tsx +++ b/js/desktop/src/features/particles/stream-top-bar.tsx @@ -284,7 +284,7 @@ function MembersIndicator({ .slice(0, 3) .map((id) => humans.find((h) => h.id === id)) .filter((h): h is NonNullable => !!h); - const overflow = othersIds.length - othersIds.length; + const overflow = othersIds.length - shownMembers.length; return ( -- 2.54.0 From 5dbd6929e6356866155ae2ef7b927a6670279730 Mon Sep 17 00:00:00 2001 From: Arjun Patel Date: Tue, 9 Jun 2026 11:47:35 -0700 Subject: [PATCH 3/5] refactor: more readable code --- .../src/features/particles/stream-top-bar.tsx | 30 +++++++++++-------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/js/desktop/src/features/particles/stream-top-bar.tsx b/js/desktop/src/features/particles/stream-top-bar.tsx index 1306f6b..29f12c2 100644 --- a/js/desktop/src/features/particles/stream-top-bar.tsx +++ b/js/desktop/src/features/particles/stream-top-bar.tsx @@ -276,10 +276,14 @@ function MembersIndicator({ const userId = useAuthStore((s) => s.user?.id); const humans = network?.humans ?? []; - const othersIds = - visibility.mode === 'network' - ? [] - : visibility.humanIds.filter((id) => id != userId); + const isNetworkWide = visibility.mode === 'network'; + const allMemberIds = visibility.humanIds; + const othersIds = isNetworkWide + ? [] + : allMemberIds.filter((id) => id != userId); + + const isPrivate = othersIds.length == 0; + const shownMembers = othersIds .slice(0, 3) .map((id) => humans.find((h) => h.id === id)) @@ -293,12 +297,17 @@ function MembersIndicator({ onClick={onClick} className="no-drag flex items-center gap-1.5 rounded-full bg-white/5 px-2 py-1 text-xs text-white/70 backdrop-blur-sm transition-colors hover:bg-white/10" > - {visibility.mode === 'network' ? ( + {isNetworkWide ? ( <> Everyone - ) : othersIds.length > 0 ? ( + ) : isPrivate ? ( + <> + + Private + + ) : ( <> {shownMembers.map((human) => ( @@ -313,18 +322,13 @@ function MembersIndicator({ +{overflow} )} - ) : ( - <> - - Private - )} - {visibility.mode === 'network' + {isNetworkWide ? `Everyone in ${network?.name ?? 'network'}` - : `${othersIds.length + 1} ${othersIds.length + 1 === 1 ? 'member' : 'members'}`} + : `${allMemberIds.length} ${allMemberIds.length === 1 ? 'member' : 'members'}`} ); -- 2.54.0 From 1725a44f9b128d4048b0fb1d1a9ed0e910fa4c7a Mon Sep 17 00:00:00 2001 From: Arjun Patel Date: Tue, 9 Jun 2026 11:49:21 -0700 Subject: [PATCH 4/5] fix type error --- js/desktop/src/features/particles/stream-top-bar.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/desktop/src/features/particles/stream-top-bar.tsx b/js/desktop/src/features/particles/stream-top-bar.tsx index 29f12c2..eb2e83e 100644 --- a/js/desktop/src/features/particles/stream-top-bar.tsx +++ b/js/desktop/src/features/particles/stream-top-bar.tsx @@ -277,7 +277,7 @@ function MembersIndicator({ const humans = network?.humans ?? []; const isNetworkWide = visibility.mode === 'network'; - const allMemberIds = visibility.humanIds; + const allMemberIds = isNetworkWide ? humans.map((h) => h.id) : visibility.humanIds; const othersIds = isNetworkWide ? [] : allMemberIds.filter((id) => id != userId); -- 2.54.0 From f90b81acfdfa9d8b112629c31ee0cf72ca4fb080 Mon Sep 17 00:00:00 2001 From: Arjun Patel Date: Tue, 9 Jun 2026 12:30:17 -0700 Subject: [PATCH 5/5] format --- js/desktop/src/features/particles/stream-top-bar.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/js/desktop/src/features/particles/stream-top-bar.tsx b/js/desktop/src/features/particles/stream-top-bar.tsx index eb2e83e..e5cca4b 100644 --- a/js/desktop/src/features/particles/stream-top-bar.tsx +++ b/js/desktop/src/features/particles/stream-top-bar.tsx @@ -277,7 +277,9 @@ function MembersIndicator({ const humans = network?.humans ?? []; const isNetworkWide = visibility.mode === 'network'; - const allMemberIds = isNetworkWide ? humans.map((h) => h.id) : visibility.humanIds; + const allMemberIds = isNetworkWide + ? humans.map((h) => h.id) + : visibility.humanIds; const othersIds = isNetworkWide ? [] : allMemberIds.filter((id) => id != userId); -- 2.54.0