From bb247abc3e4dd20edcdc4efc04db4d5ce52dabde Mon Sep 17 00:00:00 2001 From: Arjun Patel Date: Tue, 9 Jun 2026 11:42:06 -0700 Subject: [PATCH] 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'}`} );