From 3967ea0dcad78865ec3e20818cc7e1c2228cb3c7 Mon Sep 17 00:00:00 2001 From: Dylan Boudro <121908331+starmorph@users.noreply.github.com> Date: Tue, 22 Jul 2025 18:43:42 -0400 Subject: [PATCH] feat: Task plan UI Component: front-end only (#438) * task plan init FE * dark theme * fix build * new swr-config for frequent polling task plan * rm dev logs + comments * CR * CR: center task progress bar * add task tracking to thread-card on default-view (homepage) * progress bar styling, revert cancel button change * revert onstreamready optional * implement homepage taskplan via polling instead of React Context for persistence * rm comment * Update apps/web/src/components/v2/actions-renderer.tsx Co-authored-by: Brace Sproul * Update apps/web/src/components/v2/thread-card.tsx Co-authored-by: Brace Sproul * Update apps/web/src/components/v2/thread-card.tsx Co-authored-by: Brace Sproul * CR * /chat/threads page taskplan * shared utils in progressbar * fix taskPlan for stream actions-renderer --> thread-view * cr --------- Co-authored-by: Brace Sproul --- apps/web/src/app/(v2)/chat/threads/page.tsx | 3 + apps/web/src/components/tasks/index.tsx | 69 +++-- .../web/src/components/tasks/progress-bar.tsx | 288 +++++++++--------- apps/web/src/components/tasks/useTaskPlan.tsx | 20 -- apps/web/src/components/v2/default-view.tsx | 10 +- apps/web/src/components/v2/thread-card.tsx | 49 ++- apps/web/src/components/v2/thread-view.tsx | 57 +++- apps/web/src/hooks/useThreadStatus.ts | 26 +- apps/web/src/hooks/useThreadsStatus.ts | 18 +- apps/web/src/lib/swr-config.ts | 19 +- 10 files changed, 341 insertions(+), 218 deletions(-) delete mode 100644 apps/web/src/components/tasks/useTaskPlan.tsx diff --git a/apps/web/src/app/(v2)/chat/threads/page.tsx b/apps/web/src/app/(v2)/chat/threads/page.tsx index 6c1f6d0d..a078c175 100644 --- a/apps/web/src/app/(v2)/chat/threads/page.tsx +++ b/apps/web/src/app/(v2)/chat/threads/page.tsx @@ -41,6 +41,7 @@ function AllThreadsPageContent() { const { statusMap, + taskPlanMap, statusCounts, isLoading: statusLoading, } = useThreadsStatus(threadIds, threads); @@ -197,6 +198,7 @@ function AllThreadsPageContent() { thread={thread} status={statusMap[thread.id]} statusLoading={statusLoading} + taskPlan={taskPlanMap[thread.id]} /> ))} @@ -212,6 +214,7 @@ function AllThreadsPageContent() { thread={thread} status={statusMap[thread.id]} statusLoading={statusLoading} + taskPlan={taskPlanMap[thread.id]} /> ))} diff --git a/apps/web/src/components/tasks/index.tsx b/apps/web/src/components/tasks/index.tsx index fcafb071..b693700b 100644 --- a/apps/web/src/components/tasks/index.tsx +++ b/apps/web/src/components/tasks/index.tsx @@ -100,11 +100,13 @@ export function TasksSidebar({ const getStateIcon = (state: string) => { switch (state) { case "completed": - return ; + return ( + + ); case "current": - return ; + return ; default: - return ; + return ; } }; @@ -137,7 +139,7 @@ export function TasksSidebar({ return (
@@ -149,14 +151,16 @@ export function TasksSidebar({ style={{ minWidth: isOpen ? "320px" : "0" }} > {/* Header */} -
+
-

Tasks

+

+ Tasks +

@@ -165,11 +169,11 @@ export function TasksSidebar({ {/* Task selector */} {taskPlan.tasks.length > 1 && (
-