From 20e0a25edea48113420203dfa744f00bd86a8ee6 Mon Sep 17 00:00:00 2001 From: Jonathan Dobson Date: Fri, 17 Oct 2025 17:00:55 -0400 Subject: [PATCH] debugger block runs dez i (incremental improvements towards figma design(s)) (#3757) --- .../src/components/StatusBadge.tsx | 6 ++- .../editor/nodes/components/NodeHeader.tsx | 37 +++++++++++-------- skyvern-frontend/src/util/utils.ts | 12 ++++++ 3 files changed, 38 insertions(+), 17 deletions(-) diff --git a/skyvern-frontend/src/components/StatusBadge.tsx b/skyvern-frontend/src/components/StatusBadge.tsx index 8d284487..6f95fca0 100644 --- a/skyvern-frontend/src/components/StatusBadge.tsx +++ b/skyvern-frontend/src/components/StatusBadge.tsx @@ -4,7 +4,7 @@ import { cn } from "@/util/utils"; type Props = { className?: string; - status: Status; + status: Status | "pending"; }; function StatusBadge({ className, status }: Props) { @@ -24,7 +24,9 @@ function StatusBadge({ className, status }: Props) { status === Status.Canceled || status === Status.TimedOut, "bg-yellow-900 text-yellow-50 hover:bg-yellow-900/80": - status === Status.Running || status === Status.Queued, + status === Status.Running || + status === Status.Queued || + status === "pending", })} > {statusText} diff --git a/skyvern-frontend/src/routes/workflows/editor/nodes/components/NodeHeader.tsx b/skyvern-frontend/src/routes/workflows/editor/nodes/components/NodeHeader.tsx index f3826b64..2c8b8866 100644 --- a/skyvern-frontend/src/routes/workflows/editor/nodes/components/NodeHeader.tsx +++ b/skyvern-frontend/src/routes/workflows/editor/nodes/components/NodeHeader.tsx @@ -6,7 +6,7 @@ import { useMutation, useQueryClient } from "@tanstack/react-query"; import { getClient } from "@/api/AxiosClient"; import { ProxyLocation, Status } from "@/api/types"; -import { Timer } from "@/components/Timer"; +import { StatusBadge } from "@/components/StatusBadge"; import { toast } from "@/components/ui/use-toast"; import { useLogging } from "@/hooks/useLogging"; import { useCredentialGetter } from "@/hooks/useCredentialGetter"; @@ -34,7 +34,7 @@ import { useWorkflowSettingsStore, type WorkflowSettingsState, } from "@/store/WorkflowSettingsStore"; -import { cn } from "@/util/utils"; +import { cn, formatDate, toDate } from "@/util/utils"; import { statusIsAFailureType, statusIsFinalized, @@ -188,13 +188,6 @@ function NodeHeader({ const thisBlockIsTargetted = urlBlockLabel !== undefined && urlBlockLabel === blockLabel; - const timerDurationOverride = - workflowRun && workflowRun.finished_at - ? new Date(workflowRun.finished_at).getTime() - - new Date(workflowRun.created_at).getTime() + - 3500 - : null; - const [workflowRunStatus, setWorkflowRunStatus] = useState( workflowRun?.status, ); @@ -475,16 +468,30 @@ function NodeHeader({ cancelBlock.mutate(); }; + const isRunning = workflowRun ? statusIsRunningOrQueued(workflowRun) : false; + const createdAt = toDate(workflowRun?.created_at ?? "", null); + const finishedAt = toDate(workflowRun?.finished_at ?? "", null); + const dt = finishedAt + ? formatDate(finishedAt) + : createdAt + ? formatDate(createdAt) + : null; + return ( <> - {thisBlockIsTargetted && ( -
-
- + {thisBlockIsTargetted ? ( +
+ {isRunning ? ( +
+ +
+ ) : null} + {dt ?
{dt}
: } +
+
-
{workflowRun?.status ?? "pending"}
- )} + ) : null}