From 9ae8f2a7a5cb9b275466ceb4b3be945996ea82b0 Mon Sep 17 00:00:00 2001 From: John Tennant Date: Wed, 9 Sep 2026 12:45:59 -0400 Subject: [PATCH] Keep unassigned task channels in their parent sidebar section Signed-off-by: John Tennant --- desktop/src/features/sidebar/ui/AppSidebar.tsx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/desktop/src/features/sidebar/ui/AppSidebar.tsx b/desktop/src/features/sidebar/ui/AppSidebar.tsx index 8d674e9a41..a4c451aa95 100644 --- a/desktop/src/features/sidebar/ui/AppSidebar.tsx +++ b/desktop/src/features/sidebar/ui/AppSidebar.tsx @@ -318,7 +318,16 @@ export function AppSidebar({ for (const channel of streamChannels) { if (starredChannelIds?.has(channel.id)) continue; - const sectionId = channelAssignments[channel.id]; + let sectionId = channelAssignments[channel.id]; + let ancestor = channel.id; + const visited = new Set(); + while (!sectionIds.has(sectionId) && !visited.has(ancestor)) { + visited.add(ancestor); + const parent = taskParentByChannelId.get(ancestor); + if (!parent) break; + ancestor = parent; + sectionId = channelAssignments[ancestor]; + } if (sectionId && sectionIds.has(sectionId)) { if (!bySection[sectionId]) { bySection[sectionId] = []; @@ -342,6 +351,7 @@ export function AppSidebar({ }; }, [ streamChannels, + taskParentByChannelId, channelSections, channelAssignments, starredChannelIds,