Remove old task page
This commit is contained in:
@@ -3,7 +3,6 @@ import { BrowserRouter, Routes, Route } from "react-router-dom";
|
||||
import { Navbar } from "@/components/layout/navbar";
|
||||
import { Projects } from "@/pages/projects";
|
||||
import { ProjectTasks } from "@/pages/project-tasks";
|
||||
import { TaskDetailsPage } from "@/pages/task-details";
|
||||
import { TaskAttemptComparePage } from "@/pages/task-attempt-compare";
|
||||
import { Settings } from "@/pages/Settings";
|
||||
import { DisclaimerDialog } from "@/components/DisclaimerDialog";
|
||||
@@ -73,7 +72,7 @@ function AppContent() {
|
||||
<Route path="/projects/:projectId/tasks" element={<ProjectTasks />} />
|
||||
<Route
|
||||
path="/projects/:projectId/tasks/:taskId"
|
||||
element={<TaskDetailsPage />}
|
||||
element={<ProjectTasks />}
|
||||
/>
|
||||
<Route
|
||||
path="/projects/:projectId/tasks/:taskId/attempts/:attemptId/compare"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import React, { createContext, useContext, useState, useEffect, ReactNode } from "react";
|
||||
import { createContext, useContext, useState, useEffect, ReactNode } from "react";
|
||||
import type { Config, ApiResponse } from "shared/types";
|
||||
|
||||
interface ConfigContextType {
|
||||
|
||||
@@ -2,7 +2,6 @@ import { useState, useMemo } from "react";
|
||||
import { Card, CardContent } from "@/components/ui/card";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { Chip } from "@/components/ui/chip";
|
||||
import { FileText, MessageSquare } from "lucide-react";
|
||||
import { ConversationViewer } from "./ConversationViewer";
|
||||
import type { ExecutionProcess } from "shared/types";
|
||||
|
||||
@@ -2,7 +2,6 @@ import { useState, useEffect } from "react";
|
||||
import {
|
||||
X,
|
||||
History,
|
||||
Send,
|
||||
Clock,
|
||||
FileText,
|
||||
Code,
|
||||
@@ -15,7 +14,6 @@ import {
|
||||
import { Button } from "@/components/ui/button";
|
||||
|
||||
import { Label } from "@/components/ui/label";
|
||||
import { Textarea } from "@/components/ui/textarea";
|
||||
import { Chip } from "@/components/ui/chip";
|
||||
import { ExecutionOutputViewer } from "./ExecutionOutputViewer";
|
||||
|
||||
@@ -137,7 +135,6 @@ export function TaskDetailsPanel({
|
||||
Record<string, ExecutionProcess>
|
||||
>({});
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [followUpMessage, setFollowUpMessage] = useState("");
|
||||
const [isDescriptionExpanded, setIsDescriptionExpanded] = useState(false);
|
||||
const [selectedExecutor, setSelectedExecutor] = useState<string>("claude");
|
||||
const { config } = useConfig();
|
||||
@@ -280,12 +277,6 @@ export function TaskDetailsPanel({
|
||||
}
|
||||
};
|
||||
|
||||
const handleSendFollowUp = () => {
|
||||
// TODO: Implement follow-up message API
|
||||
console.log("Follow-up message:", followUpMessage);
|
||||
setFollowUpMessage("");
|
||||
};
|
||||
|
||||
const openInEditor = async () => {
|
||||
if (!task || !selectedAttempt) return;
|
||||
|
||||
@@ -429,11 +420,11 @@ export function TaskDetailsPanel({
|
||||
{/* Attempt Selection */}
|
||||
<div className="flex items-center gap-2 p-3 bg-muted/30 rounded-md">
|
||||
<div className="flex items-center gap-2 flex-1">
|
||||
<span className="text-sm text-muted-foreground">
|
||||
Current attempt:
|
||||
</span>
|
||||
{selectedAttempt && (
|
||||
<span className="text-sm font-medium">
|
||||
<span className="text-sm text-muted-foreground">
|
||||
Current attempt:{" "}
|
||||
</span>
|
||||
{new Date(
|
||||
selectedAttempt.created_at
|
||||
).toLocaleDateString()}{" "}
|
||||
|
||||
@@ -26,7 +26,7 @@ interface ApiResponse<T> {
|
||||
}
|
||||
|
||||
export function ProjectTasks() {
|
||||
const { projectId } = useParams<{ projectId: string }>();
|
||||
const { projectId, taskId } = useParams<{ projectId: string; taskId?: string }>();
|
||||
const navigate = useNavigate();
|
||||
const [tasks, setTasks] = useState<Task[]>([]);
|
||||
const [project, setProject] = useState<Project | null>(null);
|
||||
@@ -70,6 +70,17 @@ export function ProjectTasks() {
|
||||
}
|
||||
}, [projectId]);
|
||||
|
||||
// Handle direct navigation to task URLs
|
||||
useEffect(() => {
|
||||
if (taskId && tasks.length > 0) {
|
||||
const task = tasks.find(t => t.id === taskId);
|
||||
if (task) {
|
||||
setSelectedTask(task);
|
||||
setIsPanelOpen(true);
|
||||
}
|
||||
}
|
||||
}, [taskId, tasks]);
|
||||
|
||||
const fetchProject = async () => {
|
||||
try {
|
||||
const response = await makeRequest(`/api/projects/${projectId}`);
|
||||
@@ -236,11 +247,15 @@ export function ProjectTasks() {
|
||||
const handleViewTaskDetails = (task: Task) => {
|
||||
setSelectedTask(task);
|
||||
setIsPanelOpen(true);
|
||||
// Update URL to include task ID
|
||||
navigate(`/projects/${projectId}/tasks/${task.id}`, { replace: true });
|
||||
};
|
||||
|
||||
const handleClosePanel = () => {
|
||||
setIsPanelOpen(false);
|
||||
setSelectedTask(null);
|
||||
// Remove task ID from URL when closing panel
|
||||
navigate(`/projects/${projectId}/tasks`, { replace: true });
|
||||
};
|
||||
|
||||
const handleProjectSettingsSuccess = () => {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user