Skip to content

Automate browser based workflows with AI

Studio block detail: render status via the shared StatusBadge pill (#7602)

Celal Zamanoğluf901a9df1ad9
diff --git a/skyvern-frontend/src/routes/workflows/workflowRun/WorkflowRunBlockDetail.test.tsx b/skyvern-frontend/src/routes/workflows/workflowRun/WorkflowRunBlockDetail.test.tsx
index 64b1ee89a..3316c7de7 100644
--- a/skyvern-frontend/src/routes/workflows/workflowRun/WorkflowRunBlockDetail.test.tsx
+++ b/skyvern-frontend/src/routes/workflows/workflowRun/WorkflowRunBlockDetail.test.tsx
@@ -536,7 +536,8 @@ describe("WorkflowRunBlockDetail router", () => {
// Should render the running extraction's detail header
expect(screen.getByText("Extraction")).toBeDefined();
expect(screen.getByText("extract_posts")).toBeDefined();
- expect(screen.getByText("Running")).toBeDefined();
+ // StatusBadge renders the raw status token ("running"), capitalized via CSS.
+ expect(screen.getByText("running")).toBeDefined();
});
it("does not show a redundant Selected action section when a child action is selected", () => {
diff --git a/skyvern-frontend/src/routes/workflows/workflowRun/blockDetail/BlockDetailHeader.test.tsx b/skyvern-frontend/src/routes/workflows/workflowRun/blockDetail/BlockDetailHeader.test.tsx
index aa85fab8a..ccbe61de7 100644
--- a/skyvern-frontend/src/routes/workflows/workflowRun/blockDetail/BlockDetailHeader.test.tsx
+++ b/skyvern-frontend/src/routes/workflows/workflowRun/blockDetail/BlockDetailHeader.test.tsx
@@ -168,9 +168,10 @@ describe("BlockDetailHeader two-tier hierarchy", () => {
const primaryText = primary?.textContent ?? "";
const metaText = meta?.textContent ?? "";
- // Primary row is the glance: identity + outcome only.
+ // Primary row is the glance: identity + outcome only. StatusBadge renders
+ // the raw status token ("completed") and capitalizes it via CSS.
expect(primaryText).toContain("HTTP Request");
- expect(primaryText).toContain("Completed");
+ expect(primaryText).toContain("completed");
// The UUID is debug detail — demoted out of the primary row into meta.
expect(primaryText).not.toContain("wrb_531711929286793050");
diff --git a/skyvern-frontend/src/routes/workflows/workflowRun/blockDetail/shared.tsx b/skyvern-frontend/src/routes/workflows/workflowRun/blockDetail/shared.tsx
index 52e594515..e7ac07d86 100644
--- a/skyvern-frontend/src/routes/workflows/workflowRun/blockDetail/shared.tsx
+++ b/skyvern-frontend/src/routes/workflows/workflowRun/blockDetail/shared.tsx
@@ -1,10 +1,5 @@
-import {
- CheckCircledIcon,
- CrossCircledIcon,
- ReloadIcon,
-} from "@radix-ui/react-icons";
-import { Status } from "@/api/types";
import { CopyButton } from "@/components/CopyButton";
+import { StatusBadge } from "@/components/StatusBadge";
import { Skeleton } from "@/components/ui/skeleton";
import {
Tooltip,
@@ -50,47 +45,6 @@ function TruncatedWithTooltip({
);
}
-function StatusPill({ status }: { status: Status | null }) {
- if (status === null) return null;
- const isSuccess = status === Status.Completed;
- const isFailure =
- status === Status.Failed ||
- status === Status.Terminated ||
- status === Status.TimedOut ||
- status === Status.Canceled;
- const isRunning = status === Status.Running;
-
- if (isSuccess) {
- return (
- <span className="inline-flex items-center gap-1 rounded bg-success/15 px-2 py-0.5 text-xs text-success">
- <CheckCircledIcon className="size-3.5" />
- <span>Completed</span>
- </span>
- );
- }
- if (isFailure) {
- return (
- <span className="inline-flex items-center gap-1 rounded bg-destructive/15 px-2 py-0.5 text-xs text-destructive">
- <CrossCircledIcon className="size-3.5" />
- <span className="capitalize">{status}</span>
- </span>
- );
- }
- if (isRunning) {
- return (
- <span className="inline-flex items-center gap-1 rounded bg-sky-500/15 px-2 py-0.5 text-xs text-sky-700 dark:text-sky-300">
- <ReloadIcon className="size-3.5 animate-spin" />
- <span>Running</span>
- </span>
- );
- }
- return (
- <span className="inline-flex items-center gap-1 rounded bg-muted px-2 py-0.5 text-xs capitalize text-tertiary-foreground dark:bg-slate-700">
- {status}
- </span>
- );
-}
-
function BlockDetailHeader({
block,
iterationOverride,
@@ -155,7 +109,9 @@ function BlockDetailHeader({
{duration}
</span>
)}
- <StatusPill status={block.status} />
+ {block.status && (
+ <StatusBadge status={block.status} alwaysShowLabel />
+ )}
</span>
</div>
<div
@@ -364,5 +320,4 @@ export {
GoalText,
JsonView,
Section,
- StatusPill,
};