From 926a1a67678907451e89ac287612e10e385999ac Mon Sep 17 00:00:00 2001 From: Shuchang Zheng Date: Fri, 21 Mar 2025 12:02:20 -0700 Subject: [PATCH] Workflow output hide whatever is not present (#1991) --- .../src/routes/workflows/WorkflowRun.tsx | 67 +++++++++++-------- 1 file changed, 39 insertions(+), 28 deletions(-) diff --git a/skyvern-frontend/src/routes/workflows/WorkflowRun.tsx b/skyvern-frontend/src/routes/workflows/WorkflowRun.tsx index e9f6a686..12491c05 100644 --- a/skyvern-frontend/src/routes/workflows/WorkflowRun.tsx +++ b/skyvern-frontend/src/routes/workflows/WorkflowRun.tsx @@ -38,6 +38,7 @@ import { findActiveItem } from "./workflowRun/workflowTimelineUtils"; import { getAggregatedExtractedInformation } from "./workflowRun/workflowRunUtils"; import { Label } from "@/components/ui/label"; import { CodeEditor } from "./components/CodeEditor"; +import { cn } from "@/util/utils"; function WorkflowRun() { const [searchParams, setSearchParams] = useSearchParams(); @@ -153,6 +154,8 @@ function WorkflowRun() { ? (workflowRun.downloaded_file_urls as string[]) : []; + const showBoth = hasSomeExtractedInformation && hasFileUrls; + const showOutputSection = workflowRunIsFinalized && (hasSomeExtractedInformation || hasFileUrls) && @@ -260,35 +263,43 @@ function WorkflowRun() { {showOutputSection && ( -
-
- - -
-
- -
- {fileUrls.length > 0 ? ( - fileUrls.map((url, index) => { - return ( -
- - - {`File ${index + 1}`} - -
- ); - }) - ) : ( -
No files downloaded
- )} +
+ {hasSomeExtractedInformation && ( +
+ +
-
+ )} + {hasFileUrls && ( +
+ +
+ {fileUrls.length > 0 ? ( + fileUrls.map((url, index) => { + return ( + + ); + }) + ) : ( +
No files downloaded
+ )} +
+
+ )}
)} {workflowFailureReason}