Automate browser based workflows with AI
Python aiapiautomationbrowserbrowser-automationcomputergptllmplaywrightpowerautomatepuppeteerpythonrpaseleniumvisionworkflow
feat(SKY-11509): restyle run tabs — Details→Overview popover, Inputs/Outputs center tabs, responsive header (#6927)
Celal Zamanoğlu24119e0aad20
diff --git a/skyvern-frontend/src/components/CopyButton.tsx b/skyvern-frontend/src/components/CopyButton.tsxindex 2c12ddd55..ff5c0f401 100644--- a/skyvern-frontend/src/components/CopyButton.tsx+++ b/skyvern-frontend/src/components/CopyButton.tsx@@ -3,8 +3,15 @@ import { CheckIcon, CopyIcon } from "@radix-ui/react-icons";import { Button } from "@/components/ui/button";import { copyText } from "@/util/copyText";+import { cn } from "@/util/utils";-function CopyButton({ value }: { value: string }) {+function CopyButton({+ value,+ className,+}: {+ value: string;+ className?: string;+}) {const [copied, setCopied] = useState(false);const handleCopy = async () => {@@ -17,7 +24,13 @@ function CopyButton({ value }: { value: string }) {};return (- <Button size="icon" variant="ghost" onClick={handleCopy}>+ <Button+ size="icon"+ variant="ghost"+ onClick={handleCopy}+ className={cn(className)}+ aria-label="Copy to clipboard"+ >{copied ? <CheckIcon /> : <CopyIcon />}</Button>);diff --git a/skyvern-frontend/src/routes/workflows/studio/runview/OverviewCodeBlock.tsx b/skyvern-frontend/src/routes/workflows/studio/runview/OverviewCodeBlock.tsxnew file mode 100644index 000000000..a32ace84d--- /dev/null+++ b/skyvern-frontend/src/routes/workflows/studio/runview/OverviewCodeBlock.tsx@@ -0,0 +1,27 @@+import { CopyButton } from "@/components/CopyButton";+import { CodeEditor } from "@/routes/workflows/components/CodeEditor";++export function OverviewCodeBlock({+ value,+ maxHeight = "220px",+}: {+ value: string;+ maxHeight?: string;+}) {+ return (+ <div className="relative">+ <div className="absolute right-2 top-2 z-10">+ <CopyButton+ value={value}+ className="h-7 w-7 bg-slate-elevation3/80 text-muted-foreground backdrop-blur hover:bg-slate-elevation4 hover:text-foreground"+ />+ </div>+ <CodeEditor+ language="json"+ value={value}+ readOnly+ maxHeight={maxHeight}+ />+ </div>+ );+}diff --git a/skyvern-frontend/src/routes/workflows/studio/runview/OverviewField.tsx b/skyvern-frontend/src/routes/workflows/studio/runview/OverviewField.tsxnew file mode 100644index 000000000..e857997f2--- /dev/null+++ b/skyvern-frontend/src/routes/workflows/studio/runview/OverviewField.tsx@@ -0,0 +1,18 @@+import { type ReactNode } from "react";++export function OverviewField({+ label,+ children,+}: {+ label: string;+ children: ReactNode;+}) {+ return (+ <div className="flex flex-col gap-1">+ <span className="text-[11px] font-medium uppercase tracking-wide text-muted-foreground">+ {label}+ </span>+ <div className="break-words text-sm text-foreground">{children}</div>+ </div>+ );+}diff --git a/skyvern-frontend/src/routes/workflows/studio/runview/RunDetailsButton.tsx b/skyvern-frontend/src/routes/workflows/studio/runview/RunDetailsButton.tsxdeleted file mode 100644index 20ca0dae1..000000000--- a/skyvern-frontend/src/routes/workflows/studio/runview/RunDetailsButton.tsx+++ /dev/null@@ -1,129 +0,0 @@-import { InfoCircledIcon } from "@radix-ui/react-icons";-import { Link } from "react-router-dom";--import { type FailureCategory, type Status } from "@/api/types";-import { CopyButton } from "@/components/CopyButton";-import { FailureCategoryBadge } from "@/components/FailureCategoryBadge";-import { StatusBadge } from "@/components/StatusBadge";-import {- Popover,- PopoverContent,- PopoverTrigger,-} from "@/components/ui/popover";-import { basicLocalTimeFormat, basicTimeFormat } from "@/util/timeFormat";-import { cn } from "@/util/utils";--type RunDetailsButtonProps = {- workflowRunId: string;- status: Status;- startedAt: string | null;- finishedAt: string | null;- failureReason: string | null;- failureCategory: Array<FailureCategory> | null;- browserSessionId: string | null;- browserProfileId: string | null;-};--function DetailRow({- label,- children,-}: {- label: string;- children: React.ReactNode;-}) {- return (- <div className="flex items-start justify-between gap-4">- <span className="text-xs text-muted-foreground">{label}</span>- <div className="min-w-0 text-right text-sm">{children}</div>- </div>- );-}--export function RunDetailsButton({- workflowRunId,- status,- startedAt,- finishedAt,- failureReason,- failureCategory,- browserSessionId,- browserProfileId,-}: RunDetailsButtonProps) {- return (- <Popover>- <PopoverTrigger asChild>- <button- type="button"- className={cn(- "inline-flex items-center gap-1.5 rounded-md px-2 py-1 text-xs font-medium",- "text-muted-foreground hover:bg-slate-elevation3 hover:text-foreground",- "focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",- )}- >- <InfoCircledIcon className="h-4 w-4" />- Details- </button>- </PopoverTrigger>- <PopoverContent- align="end"- className="flex w-[24rem] max-w-[90vw] flex-col gap-3"- >- <DetailRow label="Run ID">- <div className="flex items-center justify-end gap-1">- <span className="truncate font-mono text-xs">{workflowRunId}</span>- <CopyButton value={workflowRunId} />- </div>- </DetailRow>- <DetailRow label="Status">- <StatusBadge status={status} />- </DetailRow>- {failureCategory?.length ? (- <DetailRow label="Failure">- <FailureCategoryBadge failureCategory={failureCategory} />- </DetailRow>- ) : null}- {failureReason ? (- <DetailRow label="Reason">- <span className="whitespace-pre-wrap break-words text-destructive">- {failureReason}- </span>- </DetailRow>- ) : null}- {startedAt ? (- <DetailRow label="Started">- <span title={basicTimeFormat(startedAt)}>- {basicLocalTimeFormat(startedAt)}- </span>- </DetailRow>- ) : null}- {finishedAt ? (- <DetailRow label="Finished">- <span title={basicTimeFormat(finishedAt)}>- {basicLocalTimeFormat(finishedAt)}- </span>- </DetailRow>- ) : null}- {browserSessionId ? (- <DetailRow label="Browser session">- <Link- to={`/browser-session/${browserSessionId}/stream`}- className="truncate font-mono text-xs underline underline-offset-4"- >- {browserSessionId}- </Link>- </DetailRow>- ) : null}- {browserProfileId ? (- <DetailRow label="Browser profile">- <Link- to={`/browser-profiles/${browserProfileId}`}- className="truncate font-mono text-xs underline underline-offset-4"- >- {browserProfileId}- </Link>- </DetailRow>- ) : null}- </PopoverContent>- </Popover>- );-}diff --git a/skyvern-frontend/src/routes/workflows/studio/runview/RunHero.tsx b/skyvern-frontend/src/routes/workflows/studio/runview/RunHero.tsxindex df8edf864..e18e215fe 100644--- a/skyvern-frontend/src/routes/workflows/studio/runview/RunHero.tsx+++ b/skyvern-frontend/src/routes/workflows/studio/runview/RunHero.tsx@@ -1,10 +1,12 @@-import { type ReactNode, useEffect, useState } from "react";+import { type ReactNode, useEffect, useRef, useState } from "react";import {CodeIcon,CounterClockwiseClockIcon,Cross2Icon,ExclamationTriangleIcon,+ FileTextIcon,GlobeIcon,+ ListBulletIcon,PlayIcon,} from "@radix-ui/react-icons";@@ -34,32 +36,46 @@ type RunHeroProps = {browserSessionId: string | null;recordingUrls: string[];elapsed: string;- details?: ReactNode;inputs?: ReactNode;outputs?: ReactNode;+ overview?: ReactNode;actions?: ReactNode;onRecordingPlay?: (index: number) => void;onFix?: () => void;onRetry?: () => void;};-type CenterView = "code" | "stream" | "recording" | "screenshot";+type CenterView =+ | "code"+ | "inputs"+ | "outputs"+ | "stream"+ | "recording"+ | "screenshot";++// Below this header width the toggle/dropdown labels collapse to icons.+const HEADER_COMPACT_BELOW_PX = 640;function ViewToggle({active,onClick,icon,- children,+ label,+ compact,}: {active: boolean;onClick: () => void;- icon?: React.ReactNode;- children: React.ReactNode;+ icon: React.ReactNode;+ label: string;+ compact: boolean;}) {return (<buttontype="button"onClick={onClick}+ title={compact ? label : undefined}+ aria-label={label}+ aria-pressed={active}className={cn("inline-flex items-center gap-1.5 rounded px-2 py-1 text-[11px] font-medium","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",@@ -69,7 +85,7 @@ function ViewToggle({)}>{icon}- {children}+ {compact ? null : label}</button>);}@@ -86,9 +102,9 @@ export function RunHero({browserSessionId,recordingUrls,elapsed,- details,inputs,outputs,+ overview,actions,onRecordingPlay,onFix,@@ -97,8 +113,10 @@ export function RunHero({const pinnedFrameId = useRunViewStore((s) => s.pinnedFrameId);const pinFrame = useRunViewStore((s) => s.pinFrame);const jumpToLive = useRunViewStore((s) => s.jumpToLive);- const codeOpen = useRunViewStore((s) => s.codeOpen);- const setCodeOpen = useRunViewStore((s) => s.setCodeOpen);+ const centerView = useRunViewStore((s) => s.centerView);+ const setCenterView = useRunViewStore((s) => s.setCenterView);+ const compact = useRunViewStore((s) => s.headerCompact);+ const setHeaderCompact = useRunViewStore((s) => s.setHeaderCompact);const { setRunStreamSlot } = useStudioShellContext();// The live page URL comes from the stream frames (CDP); reset per run.@@ -114,26 +132,45 @@ export function RunHero({setFailureDismissed(false);}, [workflowRunId]);+ // Collapse labels to icons by the header's own width — the studio side panels+ // make viewport width the wrong signal.+ const headerRef = useRef<HTMLDivElement>(null);+ useEffect(() => {+ const el = headerRef.current;+ if (!el || typeof ResizeObserver === "undefined") {+ return;+ }+ const observer = new ResizeObserver((entries) => {+ const width = entries[0]?.contentRect.width ?? 0;+ setHeaderCompact(width < HEADER_COMPACT_BELOW_PX);+ });+ observer.observe(el);+ return () => observer.disconnect();+ }, [setHeaderCompact]);+const scrubbing = pinnedFrameId != null && pinnedFrameId !== "stream";const hasRecording = recordingUrls.length > 0;- // A block run keeps the live debug stream as its default view (while running and- // once parked on the final page), unless the user scrubs, opens code, or the- // recording. A full run shows its live stream only while running, then the- // recording or its last screenshot.- const center: CenterView = codeOpen- ? "code"- : scrubbing- ? "screenshot"- : showDebugStream- ? recordingOpen && hasRecording- ? "recording"- : "stream"- : running- ? "stream"- : hasRecording && !failed- ? "recording"- : "screenshot";+ // An explicit tab wins; otherwise a block run defaults to the live debug+ // stream and a full run to its stream (running) / recording / screenshot.+ const center: CenterView =+ centerView === "code"+ ? "code"+ : centerView === "inputs" && inputs+ ? "inputs"+ : centerView === "outputs" && outputs+ ? "outputs"+ : scrubbing+ ? "screenshot"+ : showDebugStream+ ? recordingOpen && hasRecording+ ? "recording"+ : "stream"+ : running+ ? "stream"+ : hasRecording && !failed+ ? "recording"+ : "screenshot";const headerLabel =center === "stream"@@ -144,20 +181,34 @@ export function RunHero({? "Recording": center === "code"? "Generated code"- : (shownFrame?.label ?? "Screenshot");+ : center === "inputs"+ ? "Inputs"+ : center === "outputs"+ ? "Outputs"+ : (shownFrame?.label ?? "Screenshot");const headerIcon =center === "recording" ? (<PlayIcon className="h-3.5 w-3.5 shrink-0 text-muted-foreground" />) : center === "code" ? (<CodeIcon className="h-3.5 w-3.5 shrink-0 text-muted-foreground" />+ ) : center === "inputs" ? (+ <ListBulletIcon className="h-3.5 w-3.5 shrink-0 text-muted-foreground" />+ ) : center === "outputs" ? (+ <FileTextIcon className="h-3.5 w-3.5 shrink-0 text-muted-foreground" />) : (<GlobeIcon className="h-3.5 w-3.5 shrink-0 text-muted-foreground" />);+ const toggleCenter = (view: "code" | "inputs" | "outputs") =>+ setCenterView(centerView === view ? "default" : view);+return (<div className="flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden rounded-lg border border-border bg-slate-elevation1">- <div className="flex items-center gap-2 border-b border-border px-3 py-2">+ <div+ ref={headerRef}+ className="flex items-center gap-2 border-b border-border px-3 py-2"+ ><div className="flex min-w-0 flex-1 items-center gap-1.5">{headerIcon}<span className="min-w-0 flex-1 truncate text-sm font-medium text-foreground">@@ -173,12 +224,12 @@ export function RunHero({setRecordingOpen(false);pinFrame("stream");}}+ compact={compact}+ label="Live"icon={<span className="h-1.5 w-1.5 animate-pulse rounded-full bg-success" />}- >- Live- </ViewToggle>+ />{hasRecording ? (<ViewToggleactive={center === "recording"}@@ -186,68 +237,69 @@ export function RunHero({setRecordingOpen(true);jumpToLive();}}+ compact={compact}+ label="Recording"icon={<PlayIcon className="h-3 w-3" />}- >- Recording- </ViewToggle>+ />) : null}</>) : running ? (<ViewToggleactive={center === "stream"}onClick={() => pinFrame("stream")}+ compact={compact}+ label="Live"icon={<span className="h-1.5 w-1.5 animate-pulse rounded-full bg-success" />}- >- Live- </ViewToggle>+ />) : hasRecording ? (<ViewToggleactive={center === "recording"}onClick={jumpToLive}+ compact={compact}+ label="Recording"icon={<PlayIcon className="h-3 w-3" />}- >- Recording- </ViewToggle>+ />) : null}<ViewToggleactive={center === "code"}- onClick={() => setCodeOpen(!codeOpen)}+ onClick={() => toggleCenter("code")}+ compact={compact}+ label="Code"icon={<CodeIcon className="h-3 w-3" />}- >- Code- </ViewToggle>- {details ? (- <>- <div className="mx-0.5 h-4 w-px bg-border" />- {details}- </>- ) : null}+ />{inputs ? (- <>- <div className="mx-0.5 h-4 w-px bg-border" />- {inputs}- </>+ <ViewToggle+ active={center === "inputs"}+ onClick={() => toggleCenter("inputs")}+ compact={compact}+ label="Inputs"+ icon={<ListBulletIcon className="h-3 w-3" />}+ />) : null}{outputs ? (- <>- <div className="mx-0.5 h-4 w-px bg-border" />- {outputs}- </>+ <ViewToggle+ active={center === "outputs"}+ onClick={() => toggleCenter("outputs")}+ compact={compact}+ label="Outputs"+ icon={<FileTextIcon className="h-3 w-3" />}+ />) : null}- {actions ? (- <>- <div className="mx-0.5 h-4 w-px bg-border" />- {actions}- </>+ {overview || actions ? (+ <div className="mx-0.5 h-4 w-px bg-border" />) : null}- <span- className="ml-1 whitespace-nowrap font-mono text-[11px] tabular-nums text-muted-foreground"- title="Elapsed"- >- {elapsed}- </span>+ {overview}+ {actions}+ {compact ? null : (+ <span+ className="ml-1 whitespace-nowrap font-mono text-[11px] tabular-nums text-muted-foreground"+ title="Elapsed"+ >+ {elapsed}+ </span>+ )}</div></div>@@ -259,6 +311,14 @@ export function RunHero({showCacheKeyValueSelector/></div>+ ) : center === "inputs" ? (+ <div className="absolute inset-0 overflow-y-auto bg-slate-elevation1 p-4">+ {inputs}+ </div>+ ) : center === "outputs" ? (+ <div className="absolute inset-0 overflow-y-auto bg-slate-elevation1 p-4">+ {outputs}+ </div>) : center === "stream" ? (showDebugStream ? (// The shell re-parents the persistent debug-session stream into thisdiff --git a/skyvern-frontend/src/routes/workflows/studio/runview/RunInputsButton.tsx b/skyvern-frontend/src/routes/workflows/studio/runview/RunInputsButton.tsxdeleted file mode 100644index 2041f0638..000000000--- a/skyvern-frontend/src/routes/workflows/studio/runview/RunInputsButton.tsx+++ /dev/null@@ -1,87 +0,0 @@-import { ListBulletIcon } from "@radix-ui/react-icons";--import {- Popover,- PopoverContent,- PopoverTrigger,-} from "@/components/ui/popover";-import { ScrollArea, ScrollAreaViewport } from "@/components/ui/scroll-area";-import { CodeEditor } from "@/routes/workflows/components/CodeEditor";-import { cn } from "@/util/utils";--export type RunInputMeta = { label: string; value: string };--type RunInputsButtonProps = {- // Ordered [key, value] entries for the agent (workflow) inputs this run used.- parameters: Array<[string, unknown]>;- // Run-level non-parameter inputs (webhook, proxy, headers, …).- meta: RunInputMeta[];-};--export function RunInputsButton({ parameters, meta }: RunInputsButtonProps) {- if (parameters.length === 0 && meta.length === 0) {- return null;- }-- const agentInputs = Object.fromEntries(parameters);-- return (- <Popover>- <PopoverTrigger asChild>- <button- type="button"- className={cn(- "inline-flex items-center gap-1.5 rounded-md px-2 py-1 text-xs font-medium",- "text-muted-foreground hover:bg-slate-elevation3 hover:text-foreground",- "focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",- )}- >- <ListBulletIcon className="h-4 w-4" />- Inputs- </button>- </PopoverTrigger>- <PopoverContent- align="end"- className="flex w-[30rem] max-w-[90vw] flex-col gap-4"- >- {parameters.length > 0 ? (- <div className="flex flex-col gap-2">- <span className="text-xs font-semibold text-foreground">- Agent inputs- </span>- <CodeEditor- language="json"- value={JSON.stringify(agentInputs, null, 2)}- readOnly- maxHeight="220px"- />- </div>- ) : null}- {meta.length > 0 ? (- <div className="flex flex-col gap-2">- <span className="text-xs font-semibold text-foreground">- Other inputs- </span>- <ScrollArea>- <ScrollAreaViewport className="max-h-[180px]">- <div className="flex flex-col gap-2">- {meta.map((entry) => (- <div- key={entry.label}- className="flex flex-col gap-0.5 text-sm"- >- <span className="text-xs text-muted-foreground">- {entry.label}- </span>- <span className="break-all">{entry.value}</span>- </div>- ))}- </div>- </ScrollAreaViewport>- </ScrollArea>- </div>- ) : null}- </PopoverContent>- </Popover>- );-}diff --git a/skyvern-frontend/src/routes/workflows/studio/runview/RunInputsSection.tsx b/skyvern-frontend/src/routes/workflows/studio/runview/RunInputsSection.tsxnew file mode 100644index 000000000..9efbed721--- /dev/null+++ b/skyvern-frontend/src/routes/workflows/studio/runview/RunInputsSection.tsx@@ -0,0 +1,47 @@+import { OverviewCodeBlock } from "./OverviewCodeBlock";+import { OverviewField } from "./OverviewField";++export type RunInputMeta = { label: string; value: string };++type RunInputsSectionProps = {+ // Ordered [key, value] entries for the agent (workflow) inputs this run used.+ parameters: Array<[string, unknown]>;+ // Run-level non-parameter inputs (webhook, proxy, headers, …).+ meta: RunInputMeta[];+};++export function RunInputsSection({ parameters, meta }: RunInputsSectionProps) {+ if (parameters.length === 0 && meta.length === 0) {+ return null;+ }++ const agentInputs = Object.fromEntries(parameters);++ return (+ <div className="flex flex-col gap-5">+ {parameters.length > 0 ? (+ <div className="flex flex-col gap-2">+ <span className="text-xs font-medium text-muted-foreground">+ Agent inputs+ </span>+ <OverviewCodeBlock+ value={JSON.stringify(agentInputs, null, 2)}+ maxHeight="320px"+ />+ </div>+ ) : null}+ {meta.length > 0 ? (+ <div className="flex flex-col gap-3">+ <span className="text-xs font-medium text-muted-foreground">+ Other inputs+ </span>+ {meta.map((entry) => (+ <OverviewField key={entry.label} label={entry.label}>+ <span className="break-all">{entry.value}</span>+ </OverviewField>+ ))}+ </div>+ ) : null}+ </div>+ );+}diff --git a/skyvern-frontend/src/routes/workflows/studio/runview/RunOutputsButton.tsx b/skyvern-frontend/src/routes/workflows/studio/runview/RunOutputsButton.tsxdeleted file mode 100644index 5fb273429..000000000--- a/skyvern-frontend/src/routes/workflows/studio/runview/RunOutputsButton.tsx+++ /dev/null@@ -1,125 +0,0 @@-import { useEffect, useState } from "react";-import { FileIcon, FileTextIcon } from "@radix-ui/react-icons";--import { SummarizeOutput } from "@/components/SummarizeOutput";-import {- Popover,- PopoverContent,- PopoverTrigger,-} from "@/components/ui/popover";-import { ScrollArea, ScrollAreaViewport } from "@/components/ui/scroll-area";-import { CodeEditor } from "@/routes/workflows/components/CodeEditor";-import { cn } from "@/util/utils";--export type RunOutputFile = { url: string; filename: string };--type RunOutputsButtonProps = {- workflowRunId: string;- workflowTitle?: string | null;- extractedInformation: Record<string, unknown> | null;- files: RunOutputFile[];-};--export function RunOutputsButton({- workflowRunId,- workflowTitle,- extractedInformation,- files,-}: RunOutputsButtonProps) {- const [summary, setSummary] = useState<string | null>(null);- useEffect(() => {- setSummary(null);- }, [workflowRunId]);-- const hasExtracted =- extractedInformation != null &&- Object.values(extractedInformation).some((value) => value !== null);- if (!hasExtracted && files.length === 0) {- return null;- }-- const extractedJson = JSON.stringify(extractedInformation ?? {});-- return (- <Popover>- <PopoverTrigger asChild>- <button- type="button"- className={cn(- "inline-flex items-center gap-1.5 rounded-md px-2 py-1 text-xs font-medium",- "text-muted-foreground hover:bg-slate-elevation3 hover:text-foreground",- "focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",- )}- >- <FileTextIcon className="h-4 w-4" />- Outputs- </button>- </PopoverTrigger>- <PopoverContent- align="end"- onOpenAutoFocus={(e) => e.preventDefault()}- className="flex w-[30rem] max-w-[90vw] flex-col gap-4"- >- {hasExtracted ? (- <div className="flex flex-col gap-2">- <div className="flex items-center justify-between">- <span className="text-xs font-semibold text-foreground">- Extracted information- </span>- <SummarizeOutput- contextKey={`run:${workflowRunId}`}- outputJson={extractedJson}- workflowTitle={workflowTitle}- hasSummary={summary !== null}- onSummary={setSummary}- />- </div>- {summary !== null ? (- <div- role="status"- aria-live="polite"- className="whitespace-pre-wrap rounded bg-slate-elevation3 p-3 text-sm"- >- {summary}- </div>- ) : null}- <CodeEditor- language="json"- value={JSON.stringify(extractedInformation, null, 2)}- readOnly- maxHeight="220px"- />- </div>- ) : null}- {files.length > 0 ? (- <div className="flex flex-col gap-2">- <span className="text-xs font-semibold text-foreground">- Downloaded files- </span>- <ScrollArea>- <ScrollAreaViewport className="max-h-[180px]">- <div className="flex flex-col gap-2">- {files.map((file) => (- <div- key={file.url}- title={file.url}- className="flex items-center gap-2 text-sm"- >- <FileIcon className="size-4 shrink-0" />- <a- href={file.url}- className="truncate underline underline-offset-4"- >- {file.filename}- </a>- </div>- ))}- </div>- </ScrollAreaViewport>- </ScrollArea>- </div>- ) : null}- </PopoverContent>- </Popover>- );-}diff --git a/skyvern-frontend/src/routes/workflows/studio/runview/RunOutputsSection.tsx b/skyvern-frontend/src/routes/workflows/studio/runview/RunOutputsSection.tsxnew file mode 100644index 000000000..e00b9f8d8--- /dev/null+++ b/skyvern-frontend/src/routes/workflows/studio/runview/RunOutputsSection.tsx@@ -0,0 +1,92 @@+import { DownloadIcon, FileIcon } from "@radix-ui/react-icons";++import { SummarizeOutput } from "@/components/SummarizeOutput";++import { OverviewCodeBlock } from "./OverviewCodeBlock";++export type RunOutputFile = { url: string; filename: string };++type RunOutputsSectionProps = {+ workflowRunId: string;+ workflowTitle?: string | null;+ extractedInformation: Record<string, unknown> | null;+ files: RunOutputFile[];+ // Owned by RunView so the generated summary survives center-tab switches+ // (this section unmounts when another tab takes the center).+ summary: string | null;+ onSummary: (summary: string | null) => void;+};++export function RunOutputsSection({+ workflowRunId,+ workflowTitle,+ extractedInformation,+ files,+ summary,+ onSummary,+}: RunOutputsSectionProps) {+ const hasExtracted =+ extractedInformation != null &&+ Object.values(extractedInformation).some((value) => value !== null);+ if (!hasExtracted && files.length === 0) {+ return null;+ }++ const extractedJson = JSON.stringify(extractedInformation ?? {});++ return (+ <div className="flex flex-col gap-5">+ {hasExtracted ? (+ <div className="flex flex-col gap-2">+ <div className="flex items-center justify-between">+ <span className="text-xs font-medium text-muted-foreground">+ Extracted information+ </span>+ <SummarizeOutput+ contextKey={`run:${workflowRunId}`}+ outputJson={extractedJson}+ workflowTitle={workflowTitle}+ hasSummary={summary !== null}+ onSummary={onSummary}+ />+ </div>+ {summary !== null ? (+ <div+ role="status"+ aria-live="polite"+ className="whitespace-pre-wrap rounded-md border border-border bg-slate-elevation3 p-3 text-sm"+ >+ {summary}+ </div>+ ) : null}+ <OverviewCodeBlock+ value={JSON.stringify(extractedInformation, null, 2)}+ maxHeight="320px"+ />+ </div>+ ) : null}+ {files.length > 0 ? (+ <div className="flex flex-col gap-2">+ <span className="text-xs font-medium text-muted-foreground">+ Downloaded files+ </span>+ <div className="flex flex-col gap-1">+ {files.map((file) => (+ <a+ key={file.url}+ href={file.url}+ title={file.url}+ aria-label={`Download ${file.filename}`}+ className="group flex items-center gap-2.5 rounded-md border border-border bg-slate-elevation2 px-3 py-2 text-sm text-foreground transition-colors hover:border-studio-accent/40 hover:bg-slate-elevation3"+ >+ <FileIcon className="size-4 shrink-0 text-muted-foreground" />+ <span className="min-w-0 flex-1 truncate">{file.filename}</span>+ <DownloadIcon className="size-4 shrink-0 text-muted-foreground transition-colors group-hover:text-studio-accent-2" />+ </a>+ ))}+ </div>+ </div>+ ) : null}+ </div>+ );+}diff --git a/skyvern-frontend/src/routes/workflows/studio/runview/RunOverviewButton.tsx b/skyvern-frontend/src/routes/workflows/studio/runview/RunOverviewButton.tsxnew file mode 100644index 000000000..ff9f31ddd--- /dev/null+++ b/skyvern-frontend/src/routes/workflows/studio/runview/RunOverviewButton.tsx@@ -0,0 +1,166 @@+import { type ReactNode } from "react";+import {+ ClockIcon,+ ExclamationTriangleIcon,+ ReaderIcon,+} from "@radix-ui/react-icons";+import { Link } from "react-router-dom";++import { type FailureCategory, type Status } from "@/api/types";+import { CopyButton } from "@/components/CopyButton";+import { FailureCategoryBadge } from "@/components/FailureCategoryBadge";+import { StatusBadge } from "@/components/StatusBadge";+import {+ Popover,+ PopoverContent,+ PopoverTrigger,+} from "@/components/ui/popover";+import { useRunViewStore } from "@/store/RunViewStore";+import { basicLocalTimeFormat, basicTimeFormat } from "@/util/timeFormat";+import { cn } from "@/util/utils";++import { OverviewField } from "./OverviewField";++type RunOverviewButtonProps = {+ status: Status;+ elapsed: string;+ startedAt: string | null;+ finishedAt: string | null;+ failureReason: string | null;+ failureCategory: Array<FailureCategory> | null;+ workflowRunId: string;+ browserSessionId: string | null;+ browserProfileId: string | null;+};++function Stat({+ label,+ value,+ title,+ icon,+}: {+ label: string;+ value: string;+ title?: string;+ icon?: ReactNode;+}) {+ return (+ <div className="flex flex-col gap-0.5">+ <span className="text-[10px] font-medium uppercase tracking-wide text-muted-foreground">+ {label}+ </span>+ <span+ title={title}+ className="flex items-center gap-1.5 text-sm font-medium text-foreground"+ >+ {icon ? <span className="text-muted-foreground">{icon}</span> : null}+ {value}+ </span>+ </div>+ );+}++export function RunOverviewButton({+ status,+ elapsed,+ startedAt,+ finishedAt,+ failureReason,+ failureCategory,+ workflowRunId,+ browserSessionId,+ browserProfileId,+}: RunOverviewButtonProps) {+ const compact = useRunViewStore((s) => s.headerCompact);+ return (+ <Popover>+ <PopoverTrigger asChild>+ <button+ type="button"+ title={compact ? "Overview" : undefined}+ aria-label="Overview"+ className={cn(+ "inline-flex items-center gap-1.5 rounded-md px-2 py-1 text-xs font-medium",+ "text-muted-foreground hover:bg-slate-elevation3 hover:text-foreground",+ "focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",+ )}+ >+ <ReaderIcon className="h-4 w-4" />+ {compact ? null : "Overview"}+ </button>+ </PopoverTrigger>+ <PopoverContent+ align="end"+ className="flex w-[26rem] max-w-[90vw] flex-col gap-4"+ >+ <div className="flex flex-wrap items-center gap-x-5 gap-y-3">+ <div className="flex items-center gap-2">+ <StatusBadge status={status} />+ {failureCategory?.length ? (+ <FailureCategoryBadge failureCategory={failureCategory} />+ ) : null}+ </div>+ <Stat+ label="Duration"+ value={elapsed}+ icon={<ClockIcon className="h-3.5 w-3.5" />}+ />+ {startedAt ? (+ <Stat+ label="Started"+ value={basicLocalTimeFormat(startedAt)}+ title={basicTimeFormat(startedAt)}+ />+ ) : null}+ {finishedAt ? (+ <Stat+ label="Finished"+ value={basicLocalTimeFormat(finishedAt)}+ title={basicTimeFormat(finishedAt)}+ />+ ) : null}+ </div>++ {failureReason ? (+ <div className="flex items-start gap-2 rounded-lg border border-destructive/40 bg-destructive/10 p-3 text-sm">+ <ExclamationTriangleIcon className="mt-0.5 h-4 w-4 shrink-0 text-destructive" />+ <span className="whitespace-pre-wrap break-words text-foreground">+ {failureReason}+ </span>+ </div>+ ) : null}++ <div className="flex flex-col gap-3">+ <OverviewField label="Run ID">+ <div className="flex items-center gap-1.5">+ <span className="truncate font-mono text-xs">+ {workflowRunId}+ </span>+ <CopyButton value={workflowRunId} />+ </div>+ </OverviewField>+ {browserSessionId ? (+ <OverviewField label="Browser session">+ <Link+ to={`/browser-session/${browserSessionId}/stream`}+ className="font-mono text-xs text-studio-accent-2 underline-offset-4 hover:underline"+ >+ {browserSessionId}+ </Link>+ </OverviewField>+ ) : null}+ {browserProfileId ? (+ <OverviewField label="Browser profile">+ <Link+ to={`/browser-profiles/${browserProfileId}`}+ className="font-mono text-xs text-studio-accent-2 underline-offset-4 hover:underline"+ >+ {browserProfileId}+ </Link>+ </OverviewField>+ ) : null}+ </div>+ </PopoverContent>+ </Popover>+ );+}diff --git a/skyvern-frontend/src/routes/workflows/studio/runview/RunView.tsx b/skyvern-frontend/src/routes/workflows/studio/runview/RunView.tsxindex 0d16da525..f61d48ad8 100644--- a/skyvern-frontend/src/routes/workflows/studio/runview/RunView.tsx+++ b/skyvern-frontend/src/routes/workflows/studio/runview/RunView.tsx@@ -29,11 +29,11 @@ import {formatElapsed,runOutcomeFromStatus,} from "../runProjections";-import { RunDetailsButton } from "./RunDetailsButton";import { RunHero } from "./RunHero";import { buildRunFixMessage } from "./runFixMessage";-import { RunInputsButton, type RunInputMeta } from "./RunInputsButton";-import { RunOutputsButton, type RunOutputFile } from "./RunOutputsButton";+import { RunInputsSection, type RunInputMeta } from "./RunInputsSection";+import { RunOutputsSection, type RunOutputFile } from "./RunOutputsSection";+import { RunOverviewButton } from "./RunOverviewButton";import { RunPlaceholder } from "./RunPlaceholder";type RunViewProps = {@@ -69,6 +69,7 @@ export function RunView({const pinnedFrameId = useRunViewStore((s) => s.pinnedFrameId);const pinFrame = useRunViewStore((s) => s.pinFrame);const resetRunView = useRunViewStore((s) => s.reset);+ const headerCompact = useRunViewStore((s) => s.headerCompact);const studioTab = useStudioShellStore((s) => s.tab);const [searchParams, setSearchParams] = useSearchParams();const searchParamsRef = useRef(searchParams);@@ -77,6 +78,7 @@ export function RunView({const apiCredential = useApiCredential();const [activeIteration, setActiveIteration] = useState<number | null>(null);const [replayOpen, setReplayOpen] = useState(false);+ const [outputSummary, setOutputSummary] = useState<string | null>(null);const recordingUrls = useMemo(() => getRecordingUrls(workflowRun),@@ -101,6 +103,7 @@ export function RunView({// from ?active= to restore a deep-linked selection.useEffect(() => {resetRunView();+ setOutputSummary(null);const active = searchParamsRef.current.get("active");if (active) {pinFrame(active);@@ -226,11 +229,6 @@ export function RunView({}));}, [workflowRun]);- const hasOutputs =- (extractedInformation != null &&- Object.values(extractedInformation).some((value) => value !== null)) ||- downloadedFiles.length > 0;-const runInputs = useMemo(() => {const definitionParameters =workflowRun?.workflow?.workflow_definition?.parameters;@@ -259,6 +257,13 @@ export function RunView({return { parameters, meta };}, [workflowRun]);+ const hasInputs =+ runInputs.parameters.length > 0 || runInputs.meta.length > 0;+ const hasOutputs =+ (extractedInformation != null &&+ Object.values(extractedInformation).some((value) => value !== null)) ||+ downloadedFiles.length > 0;+if (!workflowRun) {return <RunPlaceholder loading={isLoading || runIdPending} />;}@@ -290,31 +295,36 @@ export function RunView({browserSessionId={workflowRun.browser_session_id ?? null}recordingUrls={recordingUrls}elapsed={elapsed}- details={- <RunDetailsButton- workflowRunId={workflowRun.workflow_run_id}+ overview={+ <RunOverviewButtonstatus={workflowRun.status}+ elapsed={elapsed}startedAt={workflowRun.started_at ?? null}finishedAt={workflowRun.finished_at ?? null}failureReason={workflowRun.failure_reason ?? null}failureCategory={workflowRun.failure_category ?? null}+ workflowRunId={workflowRun.workflow_run_id}browserSessionId={workflowRun.browser_session_id ?? null}browserProfileId={workflowRun.browser_profile_id ?? null}/>}inputs={- <RunInputsButton- parameters={runInputs.parameters}- meta={runInputs.meta}- />+ hasInputs ? (+ <RunInputsSection+ parameters={runInputs.parameters}+ meta={runInputs.meta}+ />+ ) : undefined}outputs={hasOutputs ? (- <RunOutputsButton+ <RunOutputsSectionworkflowRunId={workflowRun.workflow_run_id}workflowTitle={workflowRun.workflow?.title}extractedInformation={extractedInformation}files={downloadedFiles}+ summary={outputSummary}+ onSummary={setOutputSummary}/>) : undefined}@@ -324,6 +334,8 @@ export function RunView({trigger={<buttontype="button"+ title={headerCompact ? "API & Webhooks" : undefined}+ aria-label="API & Webhooks"className={cn("inline-flex items-center gap-1.5 rounded-md px-2 py-1 text-xs font-medium","text-muted-foreground hover:bg-slate-elevation3 hover:text-foreground",@@ -331,7 +343,7 @@ export function RunView({)}><Share1Icon className="h-4 w-4" />- API & Webhooks+ {headerCompact ? null : "API & Webhooks"}</button>}getOptions={() => {diff --git a/skyvern-frontend/src/store/RunViewStore.ts b/skyvern-frontend/src/store/RunViewStore.tsindex f28a97aae..6509e8eda 100644--- a/skyvern-frontend/src/store/RunViewStore.ts+++ b/skyvern-frontend/src/store/RunViewStore.ts@@ -1,23 +1,32 @@import { create } from "zustand";+// Which tab takes over the hero center. "default" leaves the live stream /+// recording / screenshot logic in charge; the rest are explicit center tabs.+export type RunCenterView = "default" | "code" | "inputs" | "outputs";+type RunViewState = {// The frame the user is inspecting. null means "follow the live edge" while// running, or the recording once finalized.pinnedFrameId: string | null;- // Whether the generated-code viewer is taking over the hero center.- codeOpen: boolean;+ centerView: RunCenterView;+ // True when the run-tab header is too narrow for labels (set by RunHero); the+ // toggles and externally-rendered dropdown triggers then collapse to icons.+ headerCompact: boolean;pinFrame: (id: string) => void;jumpToLive: () => void;- setCodeOpen: (open: boolean) => void;+ setCenterView: (view: RunCenterView) => void;+ setHeaderCompact: (compact: boolean) => void;reset: () => void;};export const useRunViewStore = create<RunViewState>((set) => ({pinnedFrameId: null,- codeOpen: false,- // Inspecting a frame or jumping to live/recording always closes the code view.- pinFrame: (id) => set({ pinnedFrameId: id, codeOpen: false }),- jumpToLive: () => set({ pinnedFrameId: null, codeOpen: false }),- setCodeOpen: (open) => set({ codeOpen: open }),- reset: () => set({ pinnedFrameId: null, codeOpen: false }),+ centerView: "default",+ headerCompact: false,+ // Inspecting a frame or jumping to live/recording always drops any override.+ pinFrame: (id) => set({ pinnedFrameId: id, centerView: "default" }),+ jumpToLive: () => set({ pinnedFrameId: null, centerView: "default" }),+ setCenterView: (view) => set({ centerView: view }),+ setHeaderCompact: (compact) => set({ headerCompact: compact }),+ reset: () => set({ pinnedFrameId: null, centerView: "default" }),}));