From 629f85141f50fee8b05cdf8eb883c15e3862bc38 Mon Sep 17 00:00:00 2001 From: npub1yqxl8fhpqxfzquefhxee324mskczp6ygqftu6kvrt3hp4x2fzntqvmcw9s <200df3a6e10192207329b9b398aabb85b020e8880257cd59835c6e1a994914d6@sprout-oss.stage.blox.sqprod.co> Date: Fri, 17 Jul 2026 12:24:57 -0700 Subject: [PATCH 1/5] Show unread state on collapsed sidebar sections Co-authored-by: npub1yqxl8fhpqxfzquefhxee324mskczp6ygqftu6kvrt3hp4x2fzntqvmcw9s <200df3a6e10192207329b9b398aabb85b020e8880257cd59835c6e1a994914d6@sprout-oss.stage.blox.sqprod.co> Co-authored-by: SmartyPants <200df3a6e10192207329b9b398aabb85b020e8880257cd59835c6e1a994914d6@sprout-oss.stage.blox.sqprod.co> Signed-off-by: npub1yqxl8fhpqxfzquefhxee324mskczp6ygqftu6kvrt3hp4x2fzntqvmcw9s <200df3a6e10192207329b9b398aabb85b020e8880257cd59835c6e1a994914d6@sprout-oss.stage.blox.sqprod.co> --- .../src/features/sidebar/ui/AppSidebar.tsx | 23 +++- .../sidebar/ui/CustomChannelSection.tsx | 32 +++++ .../features/sidebar/ui/SidebarSection.tsx | 13 +++ desktop/tests/e2e/channels.spec.ts | 110 ++++++++++++++++++ 4 files changed, 176 insertions(+), 2 deletions(-) diff --git a/desktop/src/features/sidebar/ui/AppSidebar.tsx b/desktop/src/features/sidebar/ui/AppSidebar.tsx index cf0e65bc7a..01cb789344 100644 --- a/desktop/src/features/sidebar/ui/AppSidebar.tsx +++ b/desktop/src/features/sidebar/ui/AppSidebar.tsx @@ -481,6 +481,15 @@ export function AppSidebar({ ), [directMessages, dmChannelLabels, sortModeFor], ); + const unassignedChannelsHaveUnread = sectionBuckets.unassigned.some( + (channel) => unreadChannelIds.has(channel.id), + ); + const forumsHaveUnread = forumChannels.some((channel) => + unreadChannelIds.has(channel.id), + ); + const directMessagesHaveUnread = sortedDirectMessages.some((channel) => + unreadChannelIds.has(channel.id), + ); const sidebarLoadingShape = useSidebarLoadingShape({ activeCommunityId: activeCommunity?.id, currentPubkey, @@ -709,7 +718,7 @@ export function AppSidebar({ ))} 0} + hasUnread={unassignedChannelsHaveUnread} isCollapsed={collapsedGroups.channels} isActiveChannel={selectedView === "channel"} activeWorkingByChannelId={activeWorkingByChannelId} @@ -749,7 +758,7 @@ export function AppSidebar({ 0} + hasUnread={forumsHaveUnread} isCollapsed={collapsedGroups.forums} isActiveChannel={selectedView === "channel"} activeWorkingByChannelId={activeWorkingByChannelId} @@ -787,6 +796,15 @@ export function AppSidebar({ sectionLabel="direct messages" testId="section-actions-dms" onOpenChange={setDmActionsMenuOpen} + hasUnread={directMessagesHaveUnread} + onMarkAllRead={() => { + for (const channel of sortedDirectMessages) { + onMarkChannelRead( + channel.id, + channel.lastMessageAt, + ); + } + }} onNewMessage={onNewMessage} sortMode={sortModeFor("dms")} onSortModeChange={(mode) => @@ -796,6 +814,7 @@ export function AppSidebar({ } dmParticipantsByChannelId={dmParticipantsByChannelId} + hasUnread={directMessagesHaveUnread} isCollapsed={collapsedGroups.directMessages} isActiveChannel={selectedView === "channel"} activeWorkingByChannelId={activeWorkingByChannelId} diff --git a/desktop/src/features/sidebar/ui/CustomChannelSection.tsx b/desktop/src/features/sidebar/ui/CustomChannelSection.tsx index 2b266e887e..2960bceee3 100644 --- a/desktop/src/features/sidebar/ui/CustomChannelSection.tsx +++ b/desktop/src/features/sidebar/ui/CustomChannelSection.tsx @@ -288,8 +288,20 @@ export function SectionActionsMenu({ ); } +function SectionUnreadIndicator({ testId }: { testId: string }) { + return ( +