Open in same window

This commit is contained in:
Louis Knight-Webb
2025-06-22 21:41:02 +01:00
parent 053d5513d6
commit 63de1fe542

View File

@@ -140,7 +140,9 @@ export function TaskDetailsPanel({
const [isDescriptionExpanded, setIsDescriptionExpanded] = useState(false); const [isDescriptionExpanded, setIsDescriptionExpanded] = useState(false);
const [selectedExecutor, setSelectedExecutor] = useState<string>("claude"); const [selectedExecutor, setSelectedExecutor] = useState<string>("claude");
const [isStopping, setIsStopping] = useState(false); const [isStopping, setIsStopping] = useState(false);
const [expandedOutputs, setExpandedOutputs] = useState<Set<string>>(new Set()); const [expandedOutputs, setExpandedOutputs] = useState<Set<string>>(
new Set()
);
const { config } = useConfig(); const { config } = useConfig();
// Available executors // Available executors
@@ -161,8 +163,13 @@ export function TaskDetailsPanel({
const latestActivitiesByProcess = new Map<string, TaskAttemptActivity>(); const latestActivitiesByProcess = new Map<string, TaskAttemptActivity>();
attemptActivities.forEach((activity) => { attemptActivities.forEach((activity) => {
const existing = latestActivitiesByProcess.get(activity.execution_process_id); const existing = latestActivitiesByProcess.get(
if (!existing || new Date(activity.created_at) > new Date(existing.created_at)) { activity.execution_process_id
);
if (
!existing ||
new Date(activity.created_at) > new Date(existing.created_at)
) {
latestActivitiesByProcess.set(activity.execution_process_id, activity); latestActivitiesByProcess.set(activity.execution_process_id, activity);
} }
}); });
@@ -380,7 +387,7 @@ export function TaskDetailsPanel({
}; };
const toggleOutputExpansion = (processId: string) => { const toggleOutputExpansion = (processId: string) => {
setExpandedOutputs(prev => { setExpandedOutputs((prev) => {
const newSet = new Set(prev); const newSet = new Set(prev);
if (newSet.has(processId)) { if (newSet.has(processId)) {
newSet.delete(processId); newSet.delete(processId);
@@ -612,8 +619,6 @@ export function TaskDetailsPanel({
<Button variant="outline" size="sm" asChild> <Button variant="outline" size="sm" asChild>
<Link <Link
to={`/projects/${projectId}/tasks/${task.id}/attempts/${selectedAttempt.id}/compare`} to={`/projects/${projectId}/tasks/${task.id}/attempts/${selectedAttempt.id}/compare`}
target="_blank"
rel="noopener noreferrer"
> >
<FileText className="h-4 w-4 mr-1" /> <FileText className="h-4 w-4 mr-1" />
Changes Changes
@@ -686,9 +691,11 @@ export function TaskDetailsPanel({
<div className="mt-2"> <div className="mt-2">
<div <div
className={`transition-all duration-200 ${ className={`transition-all duration-200 ${
expandedOutputs.has(activity.execution_process_id) expandedOutputs.has(
? '' activity.execution_process_id
: 'max-h-64 overflow-hidden' )
? ""
: "max-h-64 overflow-hidden"
}`} }`}
> >
<ExecutionOutputViewer <ExecutionOutputViewer
@@ -698,17 +705,24 @@ export function TaskDetailsPanel({
] ]
} }
executor={ executor={
selectedAttempt?.executor || undefined selectedAttempt?.executor ||
undefined
} }
/> />
</div> </div>
<Button <Button
variant="ghost" variant="ghost"
size="sm" size="sm"
onClick={() => toggleOutputExpansion(activity.execution_process_id)} onClick={() =>
toggleOutputExpansion(
activity.execution_process_id
)
}
className="mt-2 p-0 h-auto text-xs text-muted-foreground hover:text-foreground" className="mt-2 p-0 h-auto text-xs text-muted-foreground hover:text-foreground"
> >
{expandedOutputs.has(activity.execution_process_id) ? ( {expandedOutputs.has(
activity.execution_process_id
) ? (
<> <>
<ChevronUp className="h-3 w-3 mr-1" /> <ChevronUp className="h-3 w-3 mr-1" />
Show less Show less