Skip to content

Automate browser based workflows with AI

SKY-9954: polish toast action button into a frosted pill (#6379)

Celal Zamanoğlud71a50aeee97
diff --git a/skyvern-frontend/src/components/ui/toast.tsx b/skyvern-frontend/src/components/ui/toast.tsx
index b695405d1..9fa618f3c 100644
--- a/skyvern-frontend/src/components/ui/toast.tsx
+++ b/skyvern-frontend/src/components/ui/toast.tsx
@@ -65,7 +65,7 @@ const ToastAction = React.forwardRef<
<ToastPrimitives.Action
ref={ref}
className={cn(
- "inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",
+ "inline-flex h-9 shrink-0 items-center justify-center rounded-full border-0 bg-secondary px-4 text-sm font-medium transition-colors hover:bg-secondary/80 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-current focus-visible:ring-offset-0 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:bg-white/15 group-[.success]:bg-white/15 group-[.warning]:bg-white/15 group-[.destructive]:hover:bg-white/25 group-[.success]:hover:bg-white/25 group-[.warning]:hover:bg-white/25",
className,
)}
{...props}
diff --git a/skyvern-frontend/src/routes/tasks/create/CreateNewTaskForm.tsx b/skyvern-frontend/src/routes/tasks/create/CreateNewTaskForm.tsx
index f7e045879..4371eef83 100644
--- a/skyvern-frontend/src/routes/tasks/create/CreateNewTaskForm.tsx
+++ b/skyvern-frontend/src/routes/tasks/create/CreateNewTaskForm.tsx
@@ -28,7 +28,7 @@ import { type ApiCommandOptions } from "@/util/apiCommands";
import { buildTaskRunPayload } from "@/util/taskRunPayload";
import { zodResolver } from "@hookform/resolvers/zod";
import { PlayIcon, ReloadIcon } from "@radix-ui/react-icons";
-import { ToastAction } from "@radix-ui/react-toast";
+import { ToastAction } from "@/components/ui/toast";
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
import { AxiosError } from "axios";
import { useState } from "react";
@@ -162,10 +162,8 @@ function CreateNewTaskForm({ initialValues }: Props) {
description:
"You don't have enough credits to run this task. Go to billing to see your credit balance.",
action: (
- <ToastAction altText="Go to Billing">
- <Button asChild>
- <Link to="billing">Go to Billing</Link>
- </Button>
+ <ToastAction altText="Go to Billing" asChild>
+ <Link to="billing">Go to Billing</Link>
</ToastAction>
),
});
@@ -183,10 +181,8 @@ function CreateNewTaskForm({ initialValues }: Props) {
title: "Task Created",
description: `${response.data.task_id} created successfully.`,
action: (
- <ToastAction altText="View">
- <Button asChild>
- <Link to={`/tasks/${response.data.task_id}`}>View</Link>
- </Button>
+ <ToastAction altText="View" asChild>
+ <Link to={`/tasks/${response.data.task_id}`}>View</Link>
</ToastAction>
),
});
diff --git a/skyvern-frontend/src/routes/tasks/create/SavedTaskForm.tsx b/skyvern-frontend/src/routes/tasks/create/SavedTaskForm.tsx
index 6662e0f20..076f67607 100644
--- a/skyvern-frontend/src/routes/tasks/create/SavedTaskForm.tsx
+++ b/skyvern-frontend/src/routes/tasks/create/SavedTaskForm.tsx
@@ -22,7 +22,7 @@ import { type ApiCommandOptions } from "@/util/apiCommands";
import { buildTaskRunPayload } from "@/util/taskRunPayload";
import { zodResolver } from "@hookform/resolvers/zod";
import { PlayIcon, ReloadIcon } from "@radix-ui/react-icons";
-import { ToastAction } from "@radix-ui/react-toast";
+import { ToastAction } from "@/components/ui/toast";
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
import { AxiosError } from "axios";
import { useState } from "react";
@@ -191,10 +191,8 @@ function SavedTaskForm({ initialValues }: Props) {
description:
"You don't have enough credits to run this task. Go to billing to see your credit balance.",
action: (
- <ToastAction altText="Go to Billing">
- <Button asChild>
- <Link to="billing">Go to Billing</Link>
- </Button>
+ <ToastAction altText="Go to Billing" asChild>
+ <Link to="billing">Go to Billing</Link>
</ToastAction>
),
});
@@ -212,10 +210,8 @@ function SavedTaskForm({ initialValues }: Props) {
title: "Task Created",
description: `${response.data.task_id} created successfully.`,
action: (
- <ToastAction altText="View">
- <Button asChild>
- <Link to={`/tasks/${response.data.task_id}`}>View</Link>
- </Button>
+ <ToastAction altText="View" asChild>
+ <Link to={`/tasks/${response.data.task_id}`}>View</Link>
</ToastAction>
),
});