- {tasks.length > 0 ? (
- tasks.map((task, index) => (
-
- )
- )
- ) : (
-
+ {!isStreaming && (
+
+
+ {completedTasks} / {totalTasks} tasks
+
+
+ {isSuccess ? (
+
+ ) : (
+
+ )}
+ {isSuccess ? 'Tasks loaded' : 'Failed to load'}
+
+
)}
- {/* Progress Bar */}
- {tasks.length > 0 &&
-
0 && completionPercentage <= 25 && "bg-yellow-400",
- completionPercentage > 25 && completionPercentage <= 50 && "bg-yellow-500",
- completionPercentage > 50 && completionPercentage <= 75 && "bg-green-300",
- completionPercentage > 75 && completionPercentage < 100 && "bg-green-400",
- completionPercentage === 100 && "bg-green-600"
+
+
+
+
+ {isStreaming && !hasData ? (
+
+
+
+
+
+ Loading Tasks
+
+
+ Preparing your task list...
+
+
+ ) : hasData ? (
+
+
+ {sections.map((section) => )}
+
+
+ ) : (
+
+
+
+
+
+ No Tasks Yet
+
+
+ Your task list will appear here once created
+
+
+ )}
+
+
+
+
+ {!isStreaming && hasData && (
+
+
+
+ {sections.length} sections
+
+ {completedTasks === totalTasks && totalTasks > 0 && (
+
+
+ All complete
+
)}
- style={{ width: `${completionPercentage}%` }}
- />
-
}
-
+
+ )}
+
+
+
+ {toolTimestamp && !isStreaming
+ ? new Date(toolTimestamp).toLocaleTimeString()
+ : assistantTimestamp
+ ? new Date(assistantTimestamp).toLocaleTimeString()
+ : ''}
-
-
-
-
-
- {tasks.length > 0 && (
-
-
- {tasks.length} tasks
-
- )}
-
-
-
+
)
-}
\ No newline at end of file
+}
diff --git a/frontend/src/components/thread/tool-views/task-list/_utils.ts b/frontend/src/components/thread/tool-views/task-list/_utils.ts
index b72fe7c6..ea391b66 100644
--- a/frontend/src/components/thread/tool-views/task-list/_utils.ts
+++ b/frontend/src/components/thread/tool-views/task-list/_utils.ts
@@ -1,17 +1,21 @@
-export interface TaskListData {
- tasks: Task[]
- filter?: string
- total?: number
- message?: string
-}
-
export interface Task {
id: string
content: string
status: "pending" | "completed" | "cancelled"
- created_at: string
- updated_at: string
- completed_at?: string
+ section: string // Fixed: should be section, not section_id
+}
+
+export interface Section {
+ id: string
+ title: string
+ tasks: Task[]
+}
+
+export interface TaskListData {
+ sections: Section[]
+ total?: number
+ message?: string
+ filter?: string
}
export function extractTaskListData(
@@ -41,14 +45,15 @@ export function extractTaskListData(
const output = parsedContent.tool_execution.result.output;
const outputData = parseContent(output);
- if (outputData?.tasks && Array.isArray(outputData.tasks)) {
- return outputData;
+ // Nested sections format
+ if (outputData?.sections && Array.isArray(outputData.sections)) {
+ return { sections: outputData.sections };
}
}
- // Check for direct tasks array
- if (parsedContent.tasks && Array.isArray(parsedContent.tasks)) {
- return parsedContent;
+ // Check for direct sections array
+ if (parsedContent.sections && Array.isArray(parsedContent.sections)) {
+ return { sections: parsedContent.sections };
}
// Check for nested content
@@ -58,6 +63,8 @@ export function extractTaskListData(
return null;
};
+
+
// Try tool content first, then assistant content
return extractFromNewFormat(toolContent) || extractFromNewFormat(assistantContent);
diff --git a/frontend/src/components/thread/tool-views/wrapper/ToolViewRegistry.tsx b/frontend/src/components/thread/tool-views/wrapper/ToolViewRegistry.tsx
index 1b05064c..c76a620b 100644
--- a/frontend/src/components/thread/tool-views/wrapper/ToolViewRegistry.tsx
+++ b/frontend/src/components/thread/tool-views/wrapper/ToolViewRegistry.tsx
@@ -81,7 +81,7 @@ const defaultRegistry: ToolViewRegistryType = {
'view-tasks': TaskListToolView,
'update-tasks': TaskListToolView,
'delete-tasks': TaskListToolView,
- 'clear-all-tasks': TaskListToolView,
+ 'clear-tasks': TaskListToolView,
'expose-port': ExposePortToolView,