Skip to content

Automate browser based workflows with AI

Move navigation payload to base content (#894)

Kerem Yilmaz054de55b11bf
diff --git a/skyvern-frontend/src/routes/tasks/create/CreateNewTaskForm.tsx b/skyvern-frontend/src/routes/tasks/create/CreateNewTaskForm.tsx
index 1e7a3c2b0..7f3696ca3 100644
--- a/skyvern-frontend/src/routes/tasks/create/CreateNewTaskForm.tsx
+++ b/skyvern-frontend/src/routes/tasks/create/CreateNewTaskForm.tsx
@@ -87,6 +87,7 @@ function CreateNewTaskForm({ initialValues }: Props) {
const [section, setSection] = useState<"base" | "extraction" | "advanced">(
"base",
);
+ const [showAdvancedBaseContent, setShowAdvancedBaseContent] = useState(false);
const form = useForm<CreateNewTaskFormValues>({
resolver: zodResolver(createNewTaskFormSchema),
@@ -233,6 +234,67 @@ function CreateNewTaskForm({ initialValues }: Props) {
</FormItem>
)}
/>
+ {showAdvancedBaseContent ? (
+ <div className="border-t border-dashed pt-4">
+ <FormField
+ control={form.control}
+ name="navigationPayload"
+ render={({ field }) => (
+ <FormItem>
+ <div className="flex gap-16">
+ <FormLabel>
+ <div className="w-72">
+ <h1 className="text-lg">Navigation Payload</h1>
+ <h2 className="text-base text-slate-400">
+ Specify important parameters, routes, or
+ states
+ </h2>
+ </div>
+ <Button
+ className="mt-4"
+ type="button"
+ variant="tertiary"
+ onClick={() => {
+ setShowAdvancedBaseContent(false);
+ }}
+ size="sm"
+ >
+ Hide Advanced Settings
+ </Button>
+ </FormLabel>
+ <div className="w-full">
+ <FormControl>
+ <CodeEditor
+ {...field}
+ language="json"
+ fontSize={12}
+ minHeight="96px"
+ value={
+ field.value === null ? "" : field.value
+ }
+ />
+ </FormControl>
+ <FormMessage />
+ </div>
+ </div>
+ </FormItem>
+ )}
+ />
+ </div>
+ ) : (
+ <div>
+ <Button
+ type="button"
+ variant="tertiary"
+ onClick={() => {
+ setShowAdvancedBaseContent(true);
+ }}
+ size="sm"
+ >
+ Show Advanced Settings
+ </Button>
+ </div>
+ )}
</div>
</div>
)}
@@ -331,36 +393,6 @@ function CreateNewTaskForm({ initialValues }: Props) {
{section === "advanced" && (
<div className="space-y-6">
<div className="space-y-4">
- <FormField
- control={form.control}
- name="navigationPayload"
- render={({ field }) => (
- <FormItem>
- <div className="flex gap-16">
- <FormLabel>
- <div className="w-72">
- <h1 className="text-lg">Navigation Payload</h1>
- <h2 className="text-base text-slate-400">
- Specify important parameters, routes, or states
- </h2>
- </div>
- </FormLabel>
- <div className="w-full">
- <FormControl>
- <CodeEditor
- {...field}
- language="json"
- fontSize={12}
- minHeight="96px"
- value={field.value === null ? "" : field.value}
- />
- </FormControl>
- <FormMessage />
- </div>
- </div>
- </FormItem>
- )}
- />
<FormField
control={form.control}
name="maxStepsOverride"
diff --git a/skyvern-frontend/src/routes/tasks/create/SavedTaskForm.tsx b/skyvern-frontend/src/routes/tasks/create/SavedTaskForm.tsx
index 2c19e0bd0..5a270b866 100644
--- a/skyvern-frontend/src/routes/tasks/create/SavedTaskForm.tsx
+++ b/skyvern-frontend/src/routes/tasks/create/SavedTaskForm.tsx
@@ -138,6 +138,7 @@ function SavedTaskForm({ initialValues }: Props) {
const [section, setSection] = useState<"base" | "extraction" | "advanced">(
"base",
);
+ const [showAdvancedBaseContent, setShowAdvancedBaseContent] = useState(false);
const form = useForm<SavedTaskFormValues>({
resolver: zodResolver(savedTaskFormSchema),
@@ -398,6 +399,67 @@ function SavedTaskForm({ initialValues }: Props) {
</FormItem>
)}
/>
+ {showAdvancedBaseContent ? (
+ <div className="border-t border-dashed pt-4">
+ <FormField
+ control={form.control}
+ name="navigationPayload"
+ render={({ field }) => (
+ <FormItem>
+ <div className="flex gap-16">
+ <FormLabel>
+ <div className="w-72">
+ <h1 className="text-lg">Navigation Payload</h1>
+ <h2 className="text-base text-slate-400">
+ Specify important parameters, routes, or
+ states
+ </h2>
+ </div>
+ <Button
+ className="mt-4"
+ type="button"
+ variant="tertiary"
+ onClick={() => {
+ setShowAdvancedBaseContent(false);
+ }}
+ size="sm"
+ >
+ Hide Advanced Settings
+ </Button>
+ </FormLabel>
+ <div className="w-full">
+ <FormControl>
+ <CodeEditor
+ {...field}
+ language="json"
+ fontSize={12}
+ minHeight="96px"
+ value={
+ field.value === null ? "" : field.value
+ }
+ />
+ </FormControl>
+ <FormMessage />
+ </div>
+ </div>
+ </FormItem>
+ )}
+ />
+ </div>
+ ) : (
+ <div>
+ <Button
+ type="button"
+ variant="tertiary"
+ onClick={() => {
+ setShowAdvancedBaseContent(true);
+ }}
+ size="sm"
+ >
+ Show Advanced Settings
+ </Button>
+ </div>
+ )}
</div>
</div>
)}
@@ -497,41 +559,6 @@ function SavedTaskForm({ initialValues }: Props) {
{section === "advanced" && (
<div className="space-y-6">
<div className="space-y-4">
- <FormField
- control={form.control}
- name="navigationPayload"
- render={({ field }) => (
- <FormItem>
- <div className="flex gap-16">
- <FormLabel>
- <div className="w-72">
- <h1 className="text-lg">Navigation Payload</h1>
- <h2 className="text-base text-slate-400">
- Specify important parameters, routes, or states
- </h2>
- </div>
- </FormLabel>
- <div className="w-full">
- <FormControl>
- <CodeEditor
- {...field}
- language="json"
- fontSize={12}
- minHeight="96px"
- value={
- field.value === null ||
- typeof field.value === "undefined"
- ? ""
- : field.value
- }
- />
- </FormControl>
- <FormMessage />
- </div>
- </div>
- </FormItem>
- )}
- />
<FormField
control={form.control}
name="maxStepsOverride"