Skip to content

Automate browser based workflows with AI

refactor(SKY-11967): remove internal run-viewing toggle + orphaned compact action list (#7231)

Celal Zamanoğlu59fd1982d83a
diff --git a/skyvern-frontend/src/hooks/useWorkflowRunViewingV2.ts b/skyvern-frontend/src/hooks/useWorkflowRunViewingV2.ts
deleted file mode 100644
index 28ab88fa9..000000000
--- a/skyvern-frontend/src/hooks/useWorkflowRunViewingV2.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-import { useFeatureFlagEnabled } from "posthog-js/react";
-
-// Read client-side so the flag reflects per-user opt-in (a PostHog person
-// property) rather than the per-org server-evaluated path.
-export function useWorkflowRunViewingV2(): boolean {
- return useFeatureFlagEnabled("workflow_run_viewing_v2") ?? false;
-}
diff --git a/skyvern-frontend/src/routes/tasks/detail/ActionCardCompact.test.tsx b/skyvern-frontend/src/routes/tasks/detail/ActionCardCompact.test.tsx
deleted file mode 100644
index c949db070..000000000
--- a/skyvern-frontend/src/routes/tasks/detail/ActionCardCompact.test.tsx
+++ /dev/null
@@ -1,141 +0,0 @@
-// @vitest-environment jsdom
-
-import { cleanup, fireEvent, render, screen } from "@testing-library/react";
-import { afterEach, describe, expect, it, vi } from "vitest";
-
-import { type ActionsApiResponse, Status } from "@/api/types";
-import { ActionCardCompact } from "./ActionCardCompact";
-
-function buildAction(
- overrides: Partial<ActionsApiResponse> = {},
-): ActionsApiResponse {
- return {
- action_id: "act_1",
- action_type: "click",
- status: Status.Completed,
- task_id: "task_1",
- step_id: "step_1",
- step_order: 0,
- action_order: 0,
- confidence_float: 0.87,
- description: null,
- reasoning: "Click the submit button",
- intention: null,
- response: null,
- created_by: null,
- text: null,
- ...overrides,
- };
-}
-
-afterEach(() => {
- cleanup();
-});
-
-describe("ActionCardCompact", () => {
- it("renders the action type label and reasoning preview", () => {
- render(
- <ActionCardCompact
- action={buildAction()}
- index={3}
- active={false}
- expanded={false}
- onSelect={() => {}}
- onToggleExpanded={() => {}}
- />,
- );
-
- expect(screen.getByText("Click")).toBeDefined();
- expect(screen.getByText("#3")).toBeDefined();
- expect(screen.getByText("Click the submit button")).toBeDefined();
- });
-
- it("fires onToggleExpanded when the chevron is clicked and does not fire onSelect", () => {
- const onSelect = vi.fn();
- const onToggleExpanded = vi.fn();
- render(
- <ActionCardCompact
- // chevron only renders when there is hideable detail (input value)
- action={buildAction({
- action_type: "input_text",
- })}
- index={1}
- active={false}
- expanded={false}
- onSelect={onSelect}
- onToggleExpanded={onToggleExpanded}
- />,
- );
-
- fireEvent.click(screen.getByRole("button", { name: /expand details/i }));
-
- expect(onToggleExpanded).toHaveBeenCalledTimes(1);
- expect(onSelect).not.toHaveBeenCalled();
- });
-
- it("fires onSelect when the row body is clicked", () => {
- const onSelect = vi.fn();
- const onToggleExpanded = vi.fn();
- render(
- <ActionCardCompact
- action={buildAction()}
- index={1}
- active={false}
- expanded={false}
- onSelect={onSelect}
- onToggleExpanded={onToggleExpanded}
- />,
- );
-
- fireEvent.click(screen.getByText("Click"));
-
- expect(onSelect).toHaveBeenCalledTimes(1);
- expect(onToggleExpanded).not.toHaveBeenCalled();
- });
-
- it("renders reasoning inline, input in the expanded panel, and confidence as a chip", () => {
- render(
- <ActionCardCompact
- action={buildAction({
- action_type: "input_text",
- reasoning: "Type the email address",
- confidence_float: 0.92,
- })}
- index={2}
- active={false}
- expanded={true}
- onSelect={() => {}}
- onToggleExpanded={() => {}}
- />,
- );
-
- // Reasoning is always inline now (not duplicated under a "Reasoning" heading)
- expect(screen.getAllByText("Type the email address").length).toBe(1);
- // Input value lives inside the expanded panel
- expect(screen.getByText("Input")).toBeDefined();
- expect(screen.getByText("[email protected]")).toBeDefined();
- // Confidence renders as an inline chip in the top strip — no heading
- expect(screen.getByText("92%")).toBeDefined();
- });
-
- it("uses response as the input fallback when text is null for input_text", () => {
- render(
- <ActionCardCompact
- action={buildAction({
- action_type: "input_text",
- text: null,
- response: "from-script-value",
- })}
- index={4}
- active={false}
- expanded={true}
- onSelect={() => {}}
- onToggleExpanded={() => {}}
- />,
- );
-
- expect(screen.getByText("from-script-value")).toBeDefined();
- });
-});
diff --git a/skyvern-frontend/src/routes/tasks/detail/ActionCardCompact.tsx b/skyvern-frontend/src/routes/tasks/detail/ActionCardCompact.tsx
deleted file mode 100644
index 6006ffb13..000000000
--- a/skyvern-frontend/src/routes/tasks/detail/ActionCardCompact.tsx
+++ /dev/null
@@ -1,187 +0,0 @@
-import {
- type ActionsApiResponse,
- type ActionType,
- ActionTypes,
- ReadableActionTypes,
-} from "@/api/types";
-import { getActionDisplayKind } from "@/routes/workflows/components/actionStatus";
-import { terminatedDot } from "@/components/terminatedVisual";
-import { Collapsible, CollapsibleContent } from "@/components/ui/collapsible";
-import {
- Tooltip,
- TooltipContent,
- TooltipProvider,
- TooltipTrigger,
-} from "@/components/ui/tooltip";
-import { cn } from "@/util/utils";
-import {
- ChevronDownIcon,
- ChevronRightIcon,
- CursorArrowIcon,
- DoubleArrowDownIcon,
- DownloadIcon,
- DropdownMenuIcon,
- HandIcon,
- InputIcon,
- KeyboardIcon,
- LightningBoltIcon,
- TimerIcon,
- UploadIcon,
-} from "@radix-ui/react-icons";
-
-const actionIcons: Partial<Record<ActionType, React.ReactNode>> = {
- [ActionTypes.Click]: <CursorArrowIcon className="h-4 w-4" />,
- [ActionTypes.Hover]: <HandIcon className="h-4 w-4" />,
- [ActionTypes.InputText]: <InputIcon className="h-4 w-4" />,
- [ActionTypes.DownloadFile]: <DownloadIcon className="h-4 w-4" />,
- [ActionTypes.UploadFile]: <UploadIcon className="h-4 w-4" />,
- [ActionTypes.SelectOption]: <DropdownMenuIcon className="h-4 w-4" />,
- [ActionTypes.wait]: <TimerIcon className="h-4 w-4" />,
- [ActionTypes.Scroll]: <DoubleArrowDownIcon className="h-4 w-4" />,
- [ActionTypes.KeyPress]: <KeyboardIcon className="h-4 w-4" />,
-};
-
-type Props = {
- action: ActionsApiResponse;
- index: number;
- active: boolean;
- expanded: boolean;
- onSelect: () => void;
- onToggleExpanded: () => void;
- cardClassName?: string;
-};
-
-function ActionCardCompact({
- action,
- index,
- active,
- expanded,
- onSelect,
- onToggleExpanded,
- cardClassName,
-}: Props) {
- const kind = getActionDisplayKind(action);
-
- const reasoningPreview = action.reasoning?.trim() ?? "";
- const fromScript = action.created_by === "script";
- const icon = actionIcons[action.action_type] ?? null;
- const label = ReadableActionTypes[action.action_type];
- const confidencePct =
- action.confidence_float != null
- ? Math.round(action.confidence_float * 100)
- : null;
- // script-generated input text lives in action.response, not action.text
- const inputValue =
- action.action_type === ActionTypes.InputText
- ? (action.text ?? action.response)
- : null;
-
- // Only the input value is worth hiding behind a chevron — it can be long
- // or sensitive. Confidence is short metadata so we render it inline.
- const hasExpandableDetail = inputValue != null && inputValue.length > 0;
-
- return (
- <Collapsible open={expanded} asChild>
- <div
- data-slot="action-card-compact"
- data-active={active ? "true" : "false"}
- data-status={kind}
- className={cn(
- "group relative rounded-md bg-slate-elevation4 ring-1 ring-transparent transition-all duration-200",
- {
- "ring-1 ring-white/40 hover:ring-white/40": active,
- "hover:ring-white/25": !active,
- },
- cardClassName,
- )}
- >
- <button
- type="button"
- onClick={onSelect}
- className={cn(
- "flex w-full cursor-pointer flex-col gap-1 rounded-md px-3 py-2 text-left outline-none focus-visible:ring-1 focus-visible:ring-white/40",
- // Reserve room for the absolutely-positioned chevron so the
- // confidence chip doesn't end up under it.
- hasExpandableDetail && "pr-10",
- )}
- >
- <div className="flex min-h-[24px] items-center gap-2">
- <span
- aria-hidden="true"
- className={cn("h-2 w-2 shrink-0", {
- "rounded-full bg-success": kind === "success",
- "rounded-full bg-destructive": kind === "failure",
- [`rounded-[2px] ${terminatedDot}`]: kind === "terminated",
- })}
- />
- <span className="shrink-0 text-xs tabular-nums text-slate-500">
- #{index}
- </span>
- {icon && (
- <span className="shrink-0 text-slate-300" aria-hidden="true">
- {icon}
- </span>
- )}
- <span className="shrink-0 text-xs text-slate-300">{label}</span>
- {fromScript && (
- <TooltipProvider>
- <Tooltip delayDuration={300}>
- <TooltipTrigger asChild>
- <span className="shrink-0" aria-label="Code Execution">
- <LightningBoltIcon className="h-4 w-4 text-[gold]" />
- </span>
- </TooltipTrigger>
- <TooltipContent className="max-w-[250px]">
- Code Execution
- </TooltipContent>
- </Tooltip>
- </TooltipProvider>
- )}
- {confidencePct != null && (
- <span className="ml-auto shrink-0 rounded bg-slate-elevation5 px-1.5 py-0.5 text-[10px] tabular-nums text-slate-400">
- {confidencePct}%
- </span>
- )}
- </div>
- {reasoningPreview.length > 0 && (
- <div className="whitespace-pre-wrap break-words text-xs text-slate-200">
- {reasoningPreview}
- </div>
- )}
- </button>
- {hasExpandableDetail && (
- // Sibling button (not nested) so the outer select button doesn't
- // contain interactive content. Absolute-positioned to keep the
- // visual chevron in the top-right corner of the card.
- <button
- type="button"
- onClick={onToggleExpanded}
- aria-label={expanded ? "Collapse details" : "Expand details"}
- aria-expanded={expanded}
- className="absolute right-3 top-2.5 cursor-pointer rounded p-0.5 text-slate-400 outline-none hover:bg-slate-elevation3 hover:text-slate-200 focus-visible:ring-1 focus-visible:ring-white/40"
- >
- {expanded ? (
- <ChevronDownIcon className="h-4 w-4" />
- ) : (
- <ChevronRightIcon className="h-4 w-4" />
- )}
- </button>
- )}
- <CollapsibleContent className="space-y-2 px-3 pb-3 pt-1 text-xs text-slate-400">
- {inputValue != null && inputValue.length > 0 && (
- <div className="rounded bg-slate-elevation5 p-2">
- <div className="mb-1 text-[10px] uppercase tracking-wide text-slate-500">
- Input
- </div>
- <div className="whitespace-pre-wrap break-words font-mono text-slate-300">
- {inputValue}
- </div>
- </div>
- )}
- </CollapsibleContent>
- </div>
- </Collapsible>
- );
-}
-
-export { ActionCardCompact };
diff --git a/skyvern-frontend/src/routes/tasks/detail/RunViewingModeToggle.tsx b/skyvern-frontend/src/routes/tasks/detail/RunViewingModeToggle.tsx
deleted file mode 100644
index 9bf425ffc..000000000
--- a/skyvern-frontend/src/routes/tasks/detail/RunViewingModeToggle.tsx
+++ /dev/null
@@ -1,73 +0,0 @@
-import {
- Tooltip,
- TooltipContent,
- TooltipProvider,
- TooltipTrigger,
-} from "@/components/ui/tooltip";
-import { useRunViewingPreferenceStore } from "@/store/RunViewingPreferenceStore";
-import { cn } from "@/util/utils";
-import { RowsIcon, ViewVerticalIcon } from "@radix-ui/react-icons";
-
-type ModeButtonProps = {
- active: boolean;
- label: string;
- onClick: () => void;
- children: React.ReactNode;
-};
-
-function ModeButton({ active, label, onClick, children }: ModeButtonProps) {
- return (
- <Tooltip>
- <TooltipTrigger asChild>
- <button
- type="button"
- aria-label={label}
- aria-pressed={active}
- onClick={onClick}
- className={cn(
- "flex h-6 w-7 items-center justify-center rounded-sm text-slate-400 outline-none transition-colors hover:text-slate-100 focus-visible:ring-1 focus-visible:ring-white/40",
- {
- "bg-slate-600 text-slate-50": active,
- },
- )}
- >
- {children}
- </button>
- </TooltipTrigger>
- <TooltipContent>{label}</TooltipContent>
- </Tooltip>
- );
-}
-
-function RunViewingModeToggle() {
- const viewMode = useRunViewingPreferenceStore((s) => s.viewMode);
- const setViewMode = useRunViewingPreferenceStore((s) => s.setViewMode);
-
- return (
- <TooltipProvider delayDuration={300}>
- <div
- role="group"
- aria-label="Action list view density"
- data-slot="run-viewing-mode-toggle"
- className="flex h-7 items-center gap-0.5 rounded-md border border-slate-700 bg-slate-elevation2 p-0.5"
- >
- <ModeButton
- active={viewMode === "compact"}
- label="Compact view"
- onClick={() => setViewMode("compact")}
- >
- <RowsIcon className="h-3.5 w-3.5" />
- </ModeButton>
- <ModeButton
- active={viewMode === "detailed"}
- label="Detailed view"
- onClick={() => setViewMode("detailed")}
- >
- <ViewVerticalIcon className="h-3.5 w-3.5" />
- </ModeButton>
- </div>
- </TooltipProvider>
- );
-}
-
-export { RunViewingModeToggle };
diff --git a/skyvern-frontend/src/routes/tasks/detail/ScrollableActionList.test.tsx b/skyvern-frontend/src/routes/tasks/detail/ScrollableActionList.test.tsx
index e968d6fcd..989d4b299 100644
--- a/skyvern-frontend/src/routes/tasks/detail/ScrollableActionList.test.tsx
+++ b/skyvern-frontend/src/routes/tasks/detail/ScrollableActionList.test.tsx
@@ -1,35 +1,9 @@
// @vitest-environment jsdom
import { cleanup, render, screen } from "@testing-library/react";
-import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
+import { afterEach, describe, it, vi } from "vitest";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
-const { storage } = vi.hoisted(() => {
- const storage = new Map<string, string>();
- const localStorageMock = {
- getItem: (key: string) => storage.get(key) ?? null,
- setItem: (key: string, value: string) => {
- storage.set(key, value);
- },
- removeItem: (key: string) => {
- storage.delete(key);
- },
- clear: () => {
- storage.clear();
- },
- key: (index: number) => Array.from(storage.keys())[index] ?? null,
- get length() {
- return storage.size;
- },
- };
- Object.defineProperty(globalThis, "localStorage", {
- value: localStorageMock,
- configurable: true,
- writable: true,
- });
- return { storage };
-});
-
vi.mock("@/api/AxiosClient", () => ({
getClient: async () => ({
get: async () => ({ data: null }),
@@ -40,19 +14,7 @@ vi.mock("@/hooks/useCredentialGetter", () => ({
useCredentialGetter: () => undefined,
}));
-const { isViewingV2Mock } = vi.hoisted(() => ({
- isViewingV2Mock: vi.fn(() => false),
-}));
-
-vi.mock("@/hooks/useWorkflowRunViewingV2", () => ({
- useWorkflowRunViewingV2: () => isViewingV2Mock(),
-}));
-
import { Action, ActionTypes } from "@/api/types";
-import {
- RUN_VIEWING_STORAGE_KEY,
- useRunViewingPreferenceStore,
-} from "@/store/RunViewingPreferenceStore";
import { ScrollableActionList } from "./ScrollableActionList";
function buildAction(overrides: Partial<Action> = {}): Action {
@@ -70,7 +32,7 @@ function buildAction(overrides: Partial<Action> = {}): Action {
};
}
-function renderList(extraProps?: { activeIndex?: number | "stream" }) {
+function renderList() {
const client = new QueryClient({
defaultOptions: { queries: { retry: false } },
});
@@ -78,7 +40,7 @@ function renderList(extraProps?: { activeIndex?: number | "stream" }) {
<QueryClientProvider client={client}>
<ScrollableActionList
data={[buildAction()]}
- activeIndex={extraProps?.activeIndex ?? 0}
+ activeIndex={0}
onActiveIndexChange={() => {}}
showStreamOption={false}
taskDetails={{ actions: 1, steps: 1 }}
@@ -87,43 +49,15 @@ function renderList(extraProps?: { activeIndex?: number | "stream" }) {
);
}
-beforeEach(() => {
- storage.clear();
- useRunViewingPreferenceStore.setState({ viewMode: "compact" }, false);
- isViewingV2Mock.mockReset();
- isViewingV2Mock.mockReturnValue(false);
-});
-
afterEach(() => {
cleanup();
});
-describe("ScrollableActionList view-mode swap", () => {
- it("renders the legacy detailed card when the v2 flag is off", () => {
+describe("ScrollableActionList", () => {
+ it("renders the action card with its reasoning", () => {
renderList();
- expect(screen.queryByLabelText("Compact view")).toBeNull();
- expect(screen.queryByLabelText("Detailed view")).toBeNull();
- expect(
- document.querySelector('[data-slot="action-card-compact"]'),
- ).toBeNull();
// getByText throws if not found, so reaching this line means it rendered
screen.getByText("Click the submit button");
});
-
- it("renders compact cards and the toggle when v2 flag on + viewMode=compact", () => {
- isViewingV2Mock.mockReturnValue(true);
- useRunViewingPreferenceStore.setState({ viewMode: "compact" }, false);
-
- renderList();
-
- // getByLabelText throws if not found
- screen.getByLabelText("Compact view");
- screen.getByLabelText("Detailed view");
- expect(
- document.querySelector('[data-slot="action-card-compact"]'),
- ).not.toBeNull();
- // sanity: persistence path is wired
- expect(RUN_VIEWING_STORAGE_KEY).toBe("skyvern.runViewing");
- });
});
diff --git a/skyvern-frontend/src/routes/tasks/detail/ScrollableActionList.tsx b/skyvern-frontend/src/routes/tasks/detail/ScrollableActionList.tsx
index 81329600c..6a71240c7 100644
--- a/skyvern-frontend/src/routes/tasks/detail/ScrollableActionList.tsx
+++ b/skyvern-frontend/src/routes/tasks/detail/ScrollableActionList.tsx
@@ -1,5 +1,5 @@
import { getClient } from "@/api/AxiosClient";
-import { Action, ActionsApiResponse, ActionTypes, Status } from "@/api/types";
+import { Action, ActionTypes } from "@/api/types";
import { StatusPill } from "@/components/ui/status-pill";
import {
Tooltip,
@@ -10,8 +10,6 @@ import {
import { ScrollArea, ScrollAreaViewport } from "@/components/ui/scroll-area";
import { Separator } from "@/components/ui/separator";
import { useCredentialGetter } from "@/hooks/useCredentialGetter";
-import { useWorkflowRunViewingV2 } from "@/hooks/useWorkflowRunViewingV2";
-import { useRunViewingPreferenceStore } from "@/store/RunViewingPreferenceStore";
import { cn } from "@/util/utils";
import {
CheckCircledIcon,
@@ -20,33 +18,8 @@ import {
LightningBoltIcon,
} from "@radix-ui/react-icons";
import { useQueryClient } from "@tanstack/react-query";
-import { ReactNode, useRef, useState } from "react";
-import { ActionCardCompact } from "./ActionCardCompact";
+import { ReactNode, useRef } from "react";
import { ActionTypePill } from "./ActionTypePill";
-import { RunViewingModeToggle } from "./RunViewingModeToggle";
-
-function toActionsApiResponse(
- action: Action,
- index: number,
-): ActionsApiResponse {
- return {
- action_id: `${action.stepId}-${index}`,
- action_type: action.type,
- status: action.success ? Status.Completed : Status.Failed,
- task_id: null,
- step_id: action.stepId,
- step_order: null,
- action_order: index,
- confidence_float: action.confidence ?? null,
- description: null,
- reasoning: action.reasoning,
- intention: null,
- response: null,
- created_by: action.created_by,
- text: action.input ?? null,
- screenshot_artifact_id: action.screenshotArtifactId ?? null,
- };
-}
type Props = {
data: Array<Action | null>;
@@ -69,15 +42,10 @@ function ScrollableActionList({
}: Props) {
const queryClient = useQueryClient();
const credentialGetter = useCredentialGetter();
- const isViewingV2 = useWorkflowRunViewingV2();
- const viewMode = useRunViewingPreferenceStore((s) => s.viewMode);
- const [expandedActionId, setExpandedActionId] = useState<string | null>(null);
const refs = useRef<Array<HTMLDivElement | null>>(
Array.from({ length: data.length + 1 }),
);
- const useCompact = isViewingV2 && viewMode === "compact";
-
function prefetchStepArtifacts(stepId: string) {
queryClient.prefetchQuery({
queryKey: ["step", stepId, "artifacts"],
@@ -98,34 +66,6 @@ function ScrollableActionList({
continue;
}
const selected = activeIndex === i;
- if (useCompact) {
- const compactAction = toActionsApiResponse(action, i);
- elements.push(
- <div
- key={i}
- ref={(element) => {
- refs.current[i] = element;
- }}
- onMouseEnter={() => prefetchStepArtifacts(action.stepId)}
- >
- <ActionCardCompact
- action={compactAction}
- index={i + 1}
- active={selected}
- expanded={expandedActionId === compactAction.action_id}
- onSelect={() => onActiveIndexChange(i)}
- onToggleExpanded={() =>
- setExpandedActionId((current) =>
- current === compactAction.action_id
- ? null
- : compactAction.action_id,
- )
- }
- />
- </div>,
- );
- continue;
- }
elements.push(
<div
key={i}
@@ -204,7 +144,6 @@ function ScrollableActionList({
<div className="flex h-8 flex-1 items-center justify-center rounded-sm bg-slate-700 px-3 text-xs text-gray-50">
Steps: {taskDetails.steps}
</div>
- {isViewingV2 && <RunViewingModeToggle />}
</div>
<Separator />
<ScrollArea className="p-4">
@@ -217,9 +156,7 @@ function ScrollableActionList({
refs.current[data.length] = element;
}}
className={cn(
- useCompact
- ? "flex cursor-pointer items-center gap-2 rounded-md border-2 bg-slate-elevation3 px-3 py-2 text-xs hover:border-slate-50"
- : "flex cursor-pointer rounded-lg border-2 bg-slate-elevation3 p-4 hover:border-slate-50",
+ "flex cursor-pointer rounded-lg border-2 bg-slate-elevation3 p-4 hover:border-slate-50",
{
"border-slate-50": activeIndex === "stream",
},
@@ -227,15 +164,8 @@ function ScrollableActionList({
onClick={() => onActiveIndexChange("stream")}
>
<div className="flex items-center gap-2">
- <DotFilledIcon
- className={cn(
- "text-destructive",
- useCompact ? "h-3 w-3 animate-pulse" : "h-6 w-6",
- )}
- />
- <span className={cn(useCompact && "text-xs text-slate-200")}>
- Live
- </span>
+ <DotFilledIcon className="h-6 w-6 text-destructive" />
+ <span>Live</span>
</div>
</div>
)}
diff --git a/skyvern-frontend/src/routes/workflows/workflowRun/blockDetail/BlockInspector.tsx b/skyvern-frontend/src/routes/workflows/workflowRun/blockDetail/BlockInspector.tsx
index 392c7bf36..3a8749316 100644
--- a/skyvern-frontend/src/routes/workflows/workflowRun/blockDetail/BlockInspector.tsx
+++ b/skyvern-frontend/src/routes/workflows/workflowRun/blockDetail/BlockInspector.tsx
@@ -384,7 +384,7 @@ function getSummaryFields(block: WorkflowRunBlock): Array<InspectorField> {
}
function getActionInputValue(action: ActionsApiResponse): string | null {
- // Mirror ActionCardCompact: script-generated input text lives in response.
+ // Script-generated input text lives in response, not text.
if (action.action_type === ActionTypes.InputText) {
return action.text ?? action.response;
}
diff --git a/skyvern-frontend/src/routes/workflows/workflowRun/blockDetail/shared.tsx b/skyvern-frontend/src/routes/workflows/workflowRun/blockDetail/shared.tsx
index 66f75f776..0a38a97a0 100644
--- a/skyvern-frontend/src/routes/workflows/workflowRun/blockDetail/shared.tsx
+++ b/skyvern-frontend/src/routes/workflows/workflowRun/blockDetail/shared.tsx
@@ -1,13 +1,11 @@
-import { useState } from "react";
import {
CheckCircledIcon,
CrossCircledIcon,
ReloadIcon,
} from "@radix-ui/react-icons";
-import { Status, type ActionsApiResponse } from "@/api/types";
+import { Status } from "@/api/types";
import { CopyButton } from "@/components/CopyButton";
import { Skeleton } from "@/components/ui/skeleton";
-import { ActionCardCompact } from "@/routes/tasks/detail/ActionCardCompact";
import {
Tooltip,
TooltipContent,
@@ -19,7 +17,6 @@ import { workflowBlockTitle } from "@/routes/workflows/editor/nodes/types";
import { WorkflowBlockIcon } from "@/routes/workflows/editor/nodes/WorkflowBlockIcon";
import { cn } from "@/util/utils";
import {
- isAction,
type ObserverThought,
type WorkflowRunBlock,
} from "../../types/workflowRunTypes";
@@ -320,51 +317,6 @@ function GoalText({ text }: { text: string | null | undefined }) {
);
}
-function BlockActionList({
- block,
- activeItem,
- onActionSelect,
-}: {
- block: WorkflowRunBlock;
- activeItem: WorkflowRunOverviewActiveElement;
- onActionSelect?: (payload: {
- block: WorkflowRunBlock;
- action: ActionsApiResponse;
- }) => void;
-}) {
- const [expandedActionId, setExpandedActionId] = useState<string | null>(null);
- const actions = block.actions ?? [];
- const actionsTopDown = [...actions].reverse();
- if (actions.length === 0) return null;
- return (
- <Section title={`Actions (${actions.length})`}>
- <div className="space-y-2">
- {actionsTopDown.map((action, index) => {
- const isActive =
- isAction(activeItem) && activeItem.action_id === action.action_id;
- return (
- <ActionCardCompact
- key={action.action_id}
- action={action}
- active={isActive}
- index={index + 1}
- expanded={expandedActionId === action.action_id}
- onToggleExpanded={() => {
- setExpandedActionId((prev) =>
- prev === action.action_id ? null : action.action_id,
- );
- }}
- onSelect={() => {
- onActionSelect?.({ block, action });
- }}
- />
- );
- })}
- </div>
- </Section>
- );
-}
-
function BlockThoughtList({
thoughts,
activeItem,
@@ -400,7 +352,6 @@ function BlockThoughtList({
}
export {
- BlockActionList,
BlockDetailFailure,
BlockDetailHeader,
BlockDetailHeaderSkeleton,
diff --git a/skyvern-frontend/src/store/RunViewingPreferenceStore.test.ts b/skyvern-frontend/src/store/RunViewingPreferenceStore.test.ts
deleted file mode 100644
index 0da970824..000000000
--- a/skyvern-frontend/src/store/RunViewingPreferenceStore.test.ts
+++ /dev/null
@@ -1,63 +0,0 @@
-import { beforeEach, describe, expect, it, vi } from "vitest";
-
-const { storage } = vi.hoisted(() => {
- const storage = new Map<string, string>();
- const localStorageMock = {
- getItem: (key: string) => storage.get(key) ?? null,
- setItem: (key: string, value: string) => {
- storage.set(key, value);
- },
- removeItem: (key: string) => {
- storage.delete(key);
- },
- clear: () => {
- storage.clear();
- },
- key: (index: number) => Array.from(storage.keys())[index] ?? null,
- get length() {
- return storage.size;
- },
- };
- Object.defineProperty(globalThis, "localStorage", {
- value: localStorageMock,
- configurable: true,
- writable: true,
- });
- return { storage };
-});
-
-import {
- RUN_VIEWING_STORAGE_KEY,
- useRunViewingPreferenceStore,
-} from "./RunViewingPreferenceStore";
-
-describe("useRunViewingPreferenceStore", () => {
- beforeEach(() => {
- storage.clear();
- useRunViewingPreferenceStore.setState({ viewMode: "compact" }, false);
- });
-
- it("defaults viewMode to 'compact'", () => {
- expect(useRunViewingPreferenceStore.getState().viewMode).toBe("compact");
- });
-
- it("setViewMode persists to localStorage so the value survives a reload", () => {
- useRunViewingPreferenceStore.getState().setViewMode("detailed");
-
- expect(useRunViewingPreferenceStore.getState().viewMode).toBe("detailed");
-
- const raw = storage.get(RUN_VIEWING_STORAGE_KEY);
- expect(raw).toBeDefined();
- expect(JSON.parse(raw as string).state.viewMode).toBe("detailed");
- });
-
- it("reset clears the localStorage entry and reverts viewMode to 'compact'", () => {
- useRunViewingPreferenceStore.getState().setViewMode("detailed");
- expect(storage.has(RUN_VIEWING_STORAGE_KEY)).toBe(true);
-
- useRunViewingPreferenceStore.getState().reset();
-
- expect(useRunViewingPreferenceStore.getState().viewMode).toBe("compact");
- expect(storage.has(RUN_VIEWING_STORAGE_KEY)).toBe(false);
- });
-});
diff --git a/skyvern-frontend/src/store/RunViewingPreferenceStore.ts b/skyvern-frontend/src/store/RunViewingPreferenceStore.ts
deleted file mode 100644
index c505dd3d3..000000000
--- a/skyvern-frontend/src/store/RunViewingPreferenceStore.ts
+++ /dev/null
@@ -1,32 +0,0 @@
-import { create } from "zustand";
-import { persist, createJSONStorage } from "zustand/middleware";
-
-export type RunViewMode = "compact" | "detailed";
-
-type RunViewingPreferenceState = {
- viewMode: RunViewMode;
- setViewMode: (mode: RunViewMode) => void;
- reset: () => void;
-};
-
-const DEFAULT_VIEW_MODE: RunViewMode = "compact";
-
-export const RUN_VIEWING_STORAGE_KEY = "skyvern.runViewing";
-
-export const useRunViewingPreferenceStore = create<RunViewingPreferenceState>()(
- persist(
- (set) => ({
- viewMode: DEFAULT_VIEW_MODE,
- setViewMode: (mode) => set({ viewMode: mode }),
- reset: () => {
- set({ viewMode: DEFAULT_VIEW_MODE });
- useRunViewingPreferenceStore.persist.clearStorage();
- },
- }),
- {
- name: RUN_VIEWING_STORAGE_KEY,
- storage: createJSONStorage(() => localStorage),
- partialize: (state) => ({ viewMode: state.viewMode }),
- },
- ),
-);