diff --git a/apps/web/src/components/WebSocketConnectionSurface.tsx b/apps/web/src/components/WebSocketConnectionSurface.tsx index 7b350e98496..8db2f785157 100644 --- a/apps/web/src/components/WebSocketConnectionSurface.tsx +++ b/apps/web/src/components/WebSocketConnectionSurface.tsx @@ -373,6 +373,9 @@ export function SlowRpcAckToastCoordinator() { timeout: 0, title: "Some requests are slow", type: "warning" as const, + data: { + showCloseButton: true, + }, }; if (toastIdRef.current) { diff --git a/apps/web/src/components/ui/toast.tsx b/apps/web/src/components/ui/toast.tsx index 916f1c5e970..9bcd4d7e8be 100644 --- a/apps/web/src/components/ui/toast.tsx +++ b/apps/web/src/components/ui/toast.tsx @@ -12,6 +12,7 @@ import { InfoIcon, LoaderCircleIcon, TriangleAlertIcon, + XIcon, } from "lucide-react"; import { cn } from "~/lib/utils"; @@ -31,6 +32,7 @@ export type ThreadToastData = { tooltipStyle?: boolean; dismissAfterVisibleMs?: number; hideCopyButton?: boolean; + showCloseButton?: boolean; }; const toastManager = Toast.createToastManager(); @@ -302,9 +304,23 @@ function Toasts({ position = "top-right" }: { position: ToastPosition }) { dismissAfterVisibleMs={toast.data?.dismissAfterVisibleMs} toastId={toast.id} /> + {toast.data?.showCloseButton ? ( + + ) : null} + {toast.data?.showCloseButton ? ( + + ) : null} {tooltipStyle ? ( ) : ( - +
{Icon && (