From a63cb99f87943a718c138d248e5e13f739a5d359 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Titsworth-Morin?= Date: Sat, 18 Apr 2026 20:34:52 +0000 Subject: [PATCH 1/5] task: move nested-chat-sidebar-tree to active --- tasks/{backlog => active}/2026-04-18-nested-chat-sidebar-tree.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename tasks/{backlog => active}/2026-04-18-nested-chat-sidebar-tree.md (100%) diff --git a/tasks/backlog/2026-04-18-nested-chat-sidebar-tree.md b/tasks/active/2026-04-18-nested-chat-sidebar-tree.md similarity index 100% rename from tasks/backlog/2026-04-18-nested-chat-sidebar-tree.md rename to tasks/active/2026-04-18-nested-chat-sidebar-tree.md From 6559962925034de7cbf88fcaebead51834f77a4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Titsworth-Morin?= Date: Sat, 18 Apr 2026 21:20:02 +0000 Subject: [PATCH 2/5] feat(web): support deeply nested chat sessions with context anchors Replace single-level groupSessions with recursive buildSessionTree that: - Supports arbitrary depth via task.parentTaskId chain - Lifts stale/stopped ancestors from allSessions as dimmed "context anchors" so deeply nested descendants remain visible when their parents are stopped - Detects ancestry cycles (both in walk-up order assignment and parent attachment) to prevent infinite loops from pathological task graphs - Caps visible indent at MAX_VISUAL_DEPTH=5 with L{N+1} overflow badge - Preserves green rail visual language from TaskGroup SessionList now takes optional allSessions prop so the tree can resolve ancestors across stale/recent buckets. Desktop sidebar and MobileSessionDrawer both pass allSessions through. Removed legacy TaskGroup / groupSessions path (replaced by SessionTreeItem). Tests: 18 cases covering depth, anchors, siblings, ordering, aggregates, cycles, and search. Co-Authored-By: Claude Opus 4.6 --- .../project-chat/MobileSessionDrawer.tsx | 2 + .../src/pages/project-chat/SessionList.tsx | 94 ++--- .../pages/project-chat/SessionTreeItem.tsx | 271 +++++++++++++ apps/web/src/pages/project-chat/TaskGroup.tsx | 172 -------- apps/web/src/pages/project-chat/index.tsx | 2 + .../web/src/pages/project-chat/sessionTree.ts | 253 ++++++++++++ .../src/pages/project-chat/useTaskGroups.ts | 155 +------- apps/web/tests/unit/TaskGroup.test.tsx | 296 -------------- apps/web/tests/unit/sessionTree.test.ts | 375 ++++++++++++++++++ apps/web/tests/unit/useTaskGroups.test.ts | 180 +-------- 10 files changed, 945 insertions(+), 855 deletions(-) create mode 100644 apps/web/src/pages/project-chat/SessionTreeItem.tsx delete mode 100644 apps/web/src/pages/project-chat/TaskGroup.tsx create mode 100644 apps/web/src/pages/project-chat/sessionTree.ts delete mode 100644 apps/web/tests/unit/TaskGroup.test.tsx create mode 100644 apps/web/tests/unit/sessionTree.test.ts diff --git a/apps/web/src/pages/project-chat/MobileSessionDrawer.tsx b/apps/web/src/pages/project-chat/MobileSessionDrawer.tsx index 290a0f995..4101bec39 100644 --- a/apps/web/src/pages/project-chat/MobileSessionDrawer.tsx +++ b/apps/web/src/pages/project-chat/MobileSessionDrawer.tsx @@ -159,6 +159,7 @@ export function MobileSessionDrawer({