From 1d89d6db23939618ae8a76b222f700a797ac1003 Mon Sep 17 00:00:00 2001 From: Waleed Latif Date: Thu, 19 Mar 2026 23:12:14 -0700 Subject: [PATCH 1/2] improvement(toast): match notification styling with countdown ring and consistent design --- .../emcn/components/toast/toast.tsx | 94 ++++++++++++------- 1 file changed, 60 insertions(+), 34 deletions(-) diff --git a/apps/sim/components/emcn/components/toast/toast.tsx b/apps/sim/components/emcn/components/toast/toast.tsx index 965f6ede819..88de8eec6f6 100644 --- a/apps/sim/components/emcn/components/toast/toast.tsx +++ b/apps/sim/components/emcn/components/toast/toast.tsx @@ -18,6 +18,9 @@ const AUTO_DISMISS_MS = 0 const EXIT_ANIMATION_MS = 200 const MAX_VISIBLE = 20 +const RING_RADIUS = 5.5 +const RING_CIRCUMFERENCE = 2 * Math.PI * RING_RADIUS + type ToastVariant = 'default' | 'success' | 'error' interface ToastAction { @@ -28,7 +31,6 @@ interface ToastAction { interface ToastData { id: string message: string - description?: string variant: ToastVariant action?: ToastAction duration: number @@ -36,7 +38,6 @@ interface ToastData { type ToastInput = { message: string - description?: string variant?: ToastVariant action?: ToastAction duration?: number @@ -90,12 +91,31 @@ export function useToast() { return ctx } -const VARIANT_STYLES: Record = { - default: 'border-[var(--border)] bg-[var(--bg)] text-[var(--text-primary)]', - success: - 'border-emerald-200 bg-emerald-50 text-emerald-900 dark:border-emerald-800/40 dark:bg-emerald-950/30 dark:text-emerald-200', - error: - 'border-red-200 bg-red-50 text-red-900 dark:border-red-800/40 dark:bg-red-950/30 dark:text-red-200', +function CountdownRing({ duration }: { duration: number }) { + return ( + + + + + ) } function ToastItem({ toast: t, onDismiss }: { toast: ToastData; onDismiss: (id: string) => void }) { @@ -117,38 +137,45 @@ function ToastItem({ toast: t, onDismiss }: { toast: ToastData; onDismiss: (id: return (
-
-

{t.message}

- {t.description && ( -

{t.description}

+
+
+
+ {t.variant === 'error' && ( + + )} + {t.message} +
+
+ {t.duration > 0 && } + +
+
+ {t.action && ( + )}
- {t.action && ( - - )} -
) } @@ -175,7 +202,6 @@ export function ToastProvider({ children }: { children?: ReactNode }) { const data: ToastData = { id, message: input.message, - description: input.description, variant: input.variant ?? 'default', action: input.action, duration: input.duration ?? AUTO_DISMISS_MS, From eeebcb8332d67d6816e41a7e289e8322f5ee91e3 Mon Sep 17 00:00:00 2001 From: Waleed Latif Date: Thu, 19 Mar 2026 23:25:04 -0700 Subject: [PATCH 2/2] fix(toast): add success variant indicator dot --- apps/sim/components/emcn/components/toast/toast.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/sim/components/emcn/components/toast/toast.tsx b/apps/sim/components/emcn/components/toast/toast.tsx index 88de8eec6f6..163f05858b5 100644 --- a/apps/sim/components/emcn/components/toast/toast.tsx +++ b/apps/sim/components/emcn/components/toast/toast.tsx @@ -149,6 +149,9 @@ function ToastItem({ toast: t, onDismiss }: { toast: ToastData; onDismiss: (id: {t.variant === 'error' && ( )} + {t.variant === 'success' && ( + + )} {t.message}