From b16726cc2b863f1702a1d27ff48deca398785167 Mon Sep 17 00:00:00 2001 From: Louis Knight-Webb Date: Tue, 24 Jun 2025 16:57:45 +0100 Subject: [PATCH] Task attempt 661f4103-d3a8-4f67-a2b8-fd9c8633ac00 - Final changes --- .../src/components/tasks/TaskDetailsPanel.tsx | 572 +++++++++--------- 1 file changed, 294 insertions(+), 278 deletions(-) diff --git a/frontend/src/components/tasks/TaskDetailsPanel.tsx b/frontend/src/components/tasks/TaskDetailsPanel.tsx index aa0f35fc..910a75bb 100644 --- a/frontend/src/components/tasks/TaskDetailsPanel.tsx +++ b/frontend/src/components/tasks/TaskDetailsPanel.tsx @@ -684,300 +684,316 @@ export function TaskDetailsPanel({
{/* Header */} -
-
-
-

- {task.title} -

-
- - {statusLabels[task.status]} - +
+ {/* Title and Task Actions */} +
+
+
+

+ {task.title} +

+
+ + {statusLabels[task.status]} + +
+
+
+ {onEditTask && ( + + )} + {onDeleteTask && ( + + )} +
-
- {onEditTask && ( - - )} - {onDeleteTask && ( - - )} - -
-
- {/* Description */} -
-
- {task.description ? ( -
-

200 - ? "line-clamp-6" - : "" - }`} - > - {task.description} -

- {task.description.length > 200 && ( - - )} -
- ) : ( -

- No description provided -

- )} + {task.description} +

+ {task.description.length > 200 && ( + + )} +
+ ) : ( +

+ No description provided +

+ )} +
- {/* Attempt Selection */} -
-
- {selectedAttempt && ( -
- - - Current attempt:{" "} - - {new Date( - selectedAttempt.created_at - ).toLocaleDateString()}{" "} - {new Date( - selectedAttempt.created_at - ).toLocaleTimeString()} - -
- )} -
- {taskAttempts.length > 1 && ( - - - - - - {taskAttempts.map((attempt) => ( - handleAttemptChange(attempt.id)} - className={ - selectedAttempt?.id === attempt.id - ? "bg-accent" - : "" - } - > -
- - {new Date( - attempt.created_at - ).toLocaleDateString()}{" "} - {new Date( - attempt.created_at - ).toLocaleTimeString()} - - - {attempt.executor || "executor"} - -
-
- ))} -
-
+ {/* Integrated Toolbar */} +
+
+ {/* Current Attempt Info */} +
+ {selectedAttempt ? ( + <> +
+ + {new Date(selectedAttempt.created_at).toLocaleDateString()}{" "} + {new Date(selectedAttempt.created_at).toLocaleTimeString([], { + hour: "2-digit", + minute: "2-digit", + })} + + + ({selectedAttempt.executor || "executor"}) + +
+
+ + ) : ( +
+ No attempts yet +
)} -
- - - +
+ + {/* Action Button Groups */} +
+ {/* Attempt Management Group */} +
+ {taskAttempts.length > 1 && ( + + + + + + {taskAttempts.map((attempt) => ( + handleAttemptChange(attempt.id)} + className={ + selectedAttempt?.id === attempt.id + ? "bg-accent" + : "" + } + > +
+ + {new Date( + attempt.created_at + ).toLocaleDateString()}{" "} + {new Date( + attempt.created_at + ).toLocaleTimeString()} + + + {attempt.executor || "executor"} + +
+
+ ))} +
+
+ )} +
+ + + + + + + {availableExecutors.map((executor) => ( + setSelectedExecutor(executor.id)} + className={ + selectedExecutor === executor.id + ? "bg-accent" + : "" + } + > + {executor.name} + {selectedExecutor === executor.id && + " (Default)"} + + ))} + + +
+
+ + {selectedAttempt && ( + <> +
+ + {/* Execution Control Group */} +
+ {(isAttemptRunning || isStopping) && ( + + )} + + + + setIsHoveringDevServer(true)} + onMouseLeave={() => setIsHoveringDevServer(false)} + > + + + + + {!project?.dev_script ? ( +

+ Configure a dev server command in project + settings +

+ ) : runningDevServer && devServerDetails ? ( +
+

+ Dev Server Logs (Last 10 lines): +

+
+                                        {(() => {
+                                          const stdout =
+                                            devServerDetails.stdout || "";
+                                          const stderr =
+                                            devServerDetails.stderr || "";
+                                          const allOutput =
+                                            stdout + (stderr ? "\n" + stderr : "");
+                                          const lines = allOutput
+                                            .split("\n")
+                                            .filter((line) => line.trim());
+                                          const lastLines = lines.slice(-10);
+                                          return lastLines.length > 0
+                                            ? lastLines.join("\n")
+                                            : "No output yet...";
+                                        })()}
+                                      
+
+ ) : runningDevServer ? ( +

Stop the running dev server

+ ) : ( +

Start the dev server

+ )} +
+
+
+
+ +
+ + {/* Code Actions Group */} +
- - - {availableExecutors.map((executor) => ( - setSelectedExecutor(executor.id)} - className={ - selectedExecutor === executor.id - ? "bg-accent" - : "" - } +
+ + + +
+ + )}
- - {selectedAttempt && ( -
- {(isAttemptRunning || isStopping) && ( - - )} - - - - setIsHoveringDevServer(true)} - onMouseLeave={() => setIsHoveringDevServer(false)} - > - - - - - {!project?.dev_script ? ( -

- Configure a dev server command in project - settings -

- ) : runningDevServer && devServerDetails ? ( -
-

- Dev Server Logs (Last 10 lines): -

-
-                                  {(() => {
-                                    const stdout =
-                                      devServerDetails.stdout || "";
-                                    const stderr =
-                                      devServerDetails.stderr || "";
-                                    const allOutput =
-                                      stdout + (stderr ? "\n" + stderr : "");
-                                    const lines = allOutput
-                                      .split("\n")
-                                      .filter((line) => line.trim());
-                                    const lastLines = lines.slice(-10);
-                                    return lastLines.length > 0
-                                      ? lastLines.join("\n")
-                                      : "No output yet...";
-                                  })()}
-                                
-
- ) : null} -
-
-
- - -
- )}