diff --git a/skyvern-frontend/src/api/types.ts b/skyvern-frontend/src/api/types.ts index 710f7c9b..ee9db596 100644 --- a/skyvern-frontend/src/api/types.ts +++ b/skyvern-frontend/src/api/types.ts @@ -39,9 +39,11 @@ export type ArtifactApiResponse = { export type ActionAndResultApiResponse = [ ActionApiResponse, - { - success: boolean; - }, + [ + { + success: boolean; + }, + ], ]; export type StepApiResponse = { @@ -167,6 +169,16 @@ export const ActionTypes = { export type ActionType = (typeof ActionTypes)[keyof typeof ActionTypes]; +export const ReadableActionTypes: { + [key in ActionType]: string; +} = { + input_text: "Input Text", + click: "Click", + select_option: "Select Option", + upload_file: "Upload File", + complete: "Complete", +}; + export type Option = { label: string; index: number; diff --git a/skyvern-frontend/src/routes/tasks/detail/ScrollableActionList.tsx b/skyvern-frontend/src/routes/tasks/detail/ScrollableActionList.tsx index e2d46aa2..dcb44b7e 100644 --- a/skyvern-frontend/src/routes/tasks/detail/ScrollableActionList.tsx +++ b/skyvern-frontend/src/routes/tasks/detail/ScrollableActionList.tsx @@ -1,12 +1,19 @@ -import { Action } from "@/api/types"; +import { Action, ActionTypes, ReadableActionTypes } from "@/api/types"; import { Button } from "@/components/ui/button"; -import { ArrowLeftIcon, ArrowRightIcon } from "@radix-ui/react-icons"; +import { + ArrowLeftIcon, + ArrowRightIcon, + CheckIcon, + Cross1Icon, +} from "@radix-ui/react-icons"; import { useQueryClient } from "@tanstack/react-query"; import { useParams } from "react-router-dom"; import { useCredentialGetter } from "@/hooks/useCredentialGetter"; import { getClient } from "@/api/AxiosClient"; import { useEffect, useRef } from "react"; import { cn } from "@/util/utils"; +import { Badge } from "@/components/ui/badge"; +import { Separator } from "@/components/ui/separator"; type Props = { data: Array; @@ -40,8 +47,8 @@ function ScrollableActionList({ }, [activeIndex]); return ( -
-
+
+
-
+
{data.map((action, index) => { if (!action) { return null; @@ -92,9 +99,26 @@ function ScrollableActionList({ }); }} > -
-
{`Action ${index + 1}`}
-
{action.type}
+
+
+ #{index + 1} + {ReadableActionTypes[action.type]} +
{action.confidence}
+
+
{action.reasoning}
+ {action.type === ActionTypes.InputText && ( + <> + +
Input: {action.input}
+ + )} +
+
+ {action.success ? ( + + ) : ( + + )}
); diff --git a/skyvern-frontend/src/routes/tasks/detail/TaskActions.tsx b/skyvern-frontend/src/routes/tasks/detail/TaskActions.tsx index b6341878..b0a06b68 100644 --- a/skyvern-frontend/src/routes/tasks/detail/TaskActions.tsx +++ b/skyvern-frontend/src/routes/tasks/detail/TaskActions.tsx @@ -1,7 +1,6 @@ import { useState } from "react"; import { useParams } from "react-router-dom"; import { ActionScreenshot } from "./ActionScreenshot"; -import { InputReasoningCard } from "./InputReasoningCard"; import { ScrollableActionList } from "./ScrollableActionList"; import { useActions } from "./useActions"; import { Skeleton } from "@/components/ui/skeleton"; @@ -33,14 +32,7 @@ function TaskActions() { return (
-
-
- -
+