Open-source Grok Bot alternative for named AI teammates. Local-first desktop, web, and mobile clients with per-bot tools, instructions, and memory. Independent fork of T3 Code.
scope toasts per thread
Julius Marminge1f17e9c429c4
diff --git a/apps/web/src/components/GitActionsControl.tsx b/apps/web/src/components/GitActionsControl.tsxindex ec945a595..6d8f6fe1f 100644--- a/apps/web/src/components/GitActionsControl.tsx+++ b/apps/web/src/components/GitActionsControl.tsx@@ -38,6 +38,7 @@ import {gitStatusQueryOptions,invalidateGitQueries,} from "~/lib/gitReactQuery";+import { useStore } from "~/store";import { preferredTerminalEditor, resolvePathLinkTarget } from "~/terminal-links";interface GitActionsControlProps {@@ -136,6 +137,12 @@ function GitQuickActionIcon({ quickAction }: { quickAction: GitQuickAction }) {}export default function GitActionsControl({ api, gitCwd }: GitActionsControlProps) {+ const { state } = useStore();+ const activeThreadId = state.activeThreadId;+ const threadToastData = useMemo(+ () => (activeThreadId ? { threadId: activeThreadId } : undefined),+ [activeThreadId],+ );const queryClient = useQueryClient();const [activeDialogAction, setActiveDialogAction] = useState<GitDialogAction | null>(null);const [dialogCommitMessage, setDialogCommitMessage] = useState("");@@ -190,25 +197,34 @@ export default function GitActionsControl({ api, gitCwd }: GitActionsControlPropconst openExistingPr = useCallback(async () => {if (!api) {- toastManager.add({ type: "error", title: "Link opening is unavailable." });+ toastManager.add({+ type: "error",+ title: "Link opening is unavailable.",+ data: threadToastData,+ });return;}const prUrl = gitStatus?.openPr?.url ?? null;if (!prUrl) {- toastManager.add({ type: "error", title: "No open PR found." });+ toastManager.add({+ type: "error",+ title: "No open PR found.",+ data: threadToastData,+ });return;}const promise = api.shell.openExternal(prUrl);toastManager.promise(promise, {- loading: { title: "Opening PR..." },- success: { title: "PR opened" },+ loading: { title: "Opening PR...", data: threadToastData },+ success: { title: "PR opened", data: threadToastData },error: (err) => ({title: "Unable to open PR link",description: err instanceof Error ? err.message : "An error occurred.",+ data: threadToastData,}),});void promise.catch(() => undefined);- }, [api, gitStatus?.openPr?.url]);+ }, [api, gitStatus?.openPr?.url, threadToastData]);const runGitActionWithToast = useCallback(async ({@@ -238,6 +254,7 @@ export default function GitActionsControl({ api, gitCwd }: GitActionsControlProptype: "loading",title: progressStages[0] ?? "Running git action...",timeout: 0,+ data: threadToastData,});let stageIndex = 0;@@ -247,6 +264,7 @@ export default function GitActionsControl({ api, gitCwd }: GitActionsControlProptitle: progressStages[stageIndex] ?? "Running git action...",type: "loading",timeout: 0,+ data: threadToastData,});}, 1100);@@ -279,6 +297,7 @@ export default function GitActionsControl({ api, gitCwd }: GitActionsControlProptitle: resultToast.title,description: resultToast.description,timeout: 0,+ data: threadToastData,...(shouldOfferPushCta? {actionProps: {@@ -320,6 +339,7 @@ export default function GitActionsControl({ api, gitCwd }: GitActionsControlProptype: "error",title: "Action failed",description: err instanceof Error ? err.message : "An error occurred.",+ data: threadToastData,});}},@@ -332,6 +352,7 @@ export default function GitActionsControl({ api, gitCwd }: GitActionsControlPropmaybeConfirmPushToDefaultBranch,runImmediateGitActionMutation,setActiveDialogAction,+ threadToastData,],);@@ -343,17 +364,19 @@ export default function GitActionsControl({ api, gitCwd }: GitActionsControlPropif (quickAction.kind === "run_pull") {const promise = pullMutation.mutateAsync();toastManager.promise(promise, {- loading: { title: "Pulling..." },+ loading: { title: "Pulling...", data: threadToastData },success: (result) => ({title: result.status === "pulled" ? "Pulled" : "Already up to date",description:result.status === "pulled"? `Updated ${result.branch} from ${result.upstreamBranch ?? "upstream"}`: `${result.branch} is already synchronized.`,+ data: threadToastData,}),error: (err) => ({title: "Pull failed",description: err instanceof Error ? err.message : "An error occurred.",+ data: threadToastData,}),});void promise.catch(() => undefined);@@ -364,13 +387,14 @@ export default function GitActionsControl({ api, gitCwd }: GitActionsControlProptype: "info",title: quickAction.label,description: quickAction.hint,+ data: threadToastData,});return;}if (quickAction.action) {void runGitActionWithToast({ action: quickAction.action });}- }, [openExistingPr, pullMutation, quickAction, runGitActionWithToast]);+ }, [openExistingPr, pullMutation, quickAction, runGitActionWithToast, threadToastData]);const openDialogForMenuItem = useCallback((item: GitActionMenuItem) => {@@ -414,6 +438,7 @@ export default function GitActionsControl({ api, gitCwd }: GitActionsControlProptoastManager.add({type: "error",title: "Editor opening is unavailable.",+ data: threadToastData,});return;}@@ -423,10 +448,11 @@ export default function GitActionsControl({ api, gitCwd }: GitActionsControlProptype: "error",title: "Unable to open file",description: error instanceof Error ? error.message : "An error occurred.",+ data: threadToastData,});});},- [api, gitCwd],+ [api, gitCwd, threadToastData],);if (!gitCwd) return null;diff --git a/apps/web/src/components/ui/toast.tsx b/apps/web/src/components/ui/toast.tsxindex 8c406bcbe..6c9614a91 100644--- a/apps/web/src/components/ui/toast.tsx+++ b/apps/web/src/components/ui/toast.tsx@@ -11,9 +11,15 @@ import {import { cn } from "~/lib/utils";import { buttonVariants } from "~/components/ui/button";+import { useStore } from "~/store";-const toastManager = Toast.createToastManager();-const anchoredToastManager = Toast.createToastManager();+type ThreadToastData = {+ threadId?: string | null;+ tooltipStyle?: boolean;+};++const toastManager = Toast.createToastManager<ThreadToastData>();+const anchoredToastManager = Toast.createToastManager<ThreadToastData>();const TOAST_ICONS = {error: CircleAlertIcon,@@ -35,6 +41,15 @@ interface ToastProviderProps extends Toast.Provider.Props {position?: ToastPosition;}+function shouldRenderForActiveThread(+ data: ThreadToastData | undefined,+ activeThreadId: string | null,+): boolean {+ const toastThreadId = data?.threadId;+ if (!toastThreadId) return true;+ return toastThreadId === activeThreadId;+}+function ToastProvider({ children, position = "top-right", ...props }: ToastProviderProps) {return (<Toast.Provider toastManager={toastManager} {...props}>@@ -45,7 +60,9 @@ function ToastProvider({ children, position = "top-right", ...props }: ToastProv}function Toasts({ position = "top-right" }: { position: ToastPosition }) {- const { toasts } = Toast.useToastManager();+ const { state } = useStore();+ const { toasts } = Toast.useToastManager<ThreadToastData>();+ const activeThreadId = state.activeThreadId;const isTop = position.startsWith("top");return (@@ -64,91 +81,96 @@ function Toasts({ position = "top-right" }: { position: ToastPosition }) {data-position={position}data-slot="toast-viewport">- {toasts.map((toast) => {- const Icon = toast.type ? TOAST_ICONS[toast.type as keyof typeof TOAST_ICONS] : null;-- return (- <Toast.Root- className={cn(- "absolute z-[calc(9999-var(--toast-index))] h-(--toast-calc-height) w-full select-none rounded-lg border bg-popover not-dark:bg-clip-padding text-popover-foreground shadow-lg/5 [transition:transform_.5s_cubic-bezier(.22,1,.36,1),opacity_.5s,height_.15s] before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] dark:before:shadow-[0_-1px_--theme(--color-white/6%)]",- // Base positioning using data-position- "data-[position*=right]:right-0 data-[position*=right]:left-auto",- "data-[position*=left]:right-auto data-[position*=left]:left-0",- "data-[position*=center]:right-0 data-[position*=center]:left-0",- "data-[position*=top]:top-0 data-[position*=top]:bottom-auto data-[position*=top]:origin-top",- "data-[position*=bottom]:top-auto data-[position*=bottom]:bottom-0 data-[position*=bottom]:origin-bottom",- // Gap fill for hover- "after:absolute after:left-0 after:h-[calc(var(--toast-gap)+1px)] after:w-full",- "data-[position*=top]:after:top-full",- "data-[position*=bottom]:after:bottom-full",- // Define some variables- "[--toast-calc-height:var(--toast-frontmost-height,var(--toast-height))] [--toast-gap:--spacing(3)] [--toast-peek:--spacing(3)] [--toast-scale:calc(max(0,1-(var(--toast-index)*.1)))] [--toast-shrink:calc(1-var(--toast-scale))]",- // Define offset-y variable- "data-[position*=top]:[--toast-calc-offset-y:calc(var(--toast-offset-y)+var(--toast-index)*var(--toast-gap)+var(--toast-swipe-movement-y))]",- "data-[position*=bottom]:[--toast-calc-offset-y:calc(var(--toast-offset-y)*-1+var(--toast-index)*var(--toast-gap)*-1+var(--toast-swipe-movement-y))]",- // Default state transform- "data-[position*=top]:transform-[translateX(var(--toast-swipe-movement-x))_translateY(calc(var(--toast-swipe-movement-y)+(var(--toast-index)*var(--toast-peek))+(var(--toast-shrink)*var(--toast-calc-height))))_scale(var(--toast-scale))]",- "data-[position*=bottom]:transform-[translateX(var(--toast-swipe-movement-x))_translateY(calc(var(--toast-swipe-movement-y)-(var(--toast-index)*var(--toast-peek))-(var(--toast-shrink)*var(--toast-calc-height))))_scale(var(--toast-scale))]",- // Limited state- "data-limited:opacity-0",- // Expanded state- "data-expanded:h-(--toast-height)",- "data-position:data-expanded:transform-[translateX(var(--toast-swipe-movement-x))_translateY(var(--toast-calc-offset-y))]",- // Starting and ending animations- "data-[position*=top]:data-starting-style:transform-[translateY(calc(-100%-var(--toast-inset)))]",- "data-[position*=bottom]:data-starting-style:transform-[translateY(calc(100%+var(--toast-inset)))]",- "data-ending-style:opacity-0",- // Ending animations (direction-aware)- "data-ending-style:not-data-limited:not-data-swipe-direction:transform-[translateY(calc(100%+var(--toast-inset)))]",- "data-ending-style:data-[swipe-direction=left]:transform-[translateX(calc(var(--toast-swipe-movement-x)-100%-var(--toast-inset)))_translateY(var(--toast-calc-offset-y))]",- "data-ending-style:data-[swipe-direction=right]:transform-[translateX(calc(var(--toast-swipe-movement-x)+100%+var(--toast-inset)))_translateY(var(--toast-calc-offset-y))]",- "data-ending-style:data-[swipe-direction=up]:transform-[translateY(calc(var(--toast-swipe-movement-y)-100%-var(--toast-inset)))]",- "data-ending-style:data-[swipe-direction=down]:transform-[translateY(calc(var(--toast-swipe-movement-y)+100%+var(--toast-inset)))]",- // Ending animations (expanded)- "data-expanded:data-ending-style:data-[swipe-direction=left]:transform-[translateX(calc(var(--toast-swipe-movement-x)-100%-var(--toast-inset)))_translateY(var(--toast-calc-offset-y))]",- "data-expanded:data-ending-style:data-[swipe-direction=right]:transform-[translateX(calc(var(--toast-swipe-movement-x)+100%+var(--toast-inset)))_translateY(var(--toast-calc-offset-y))]",- "data-expanded:data-ending-style:data-[swipe-direction=up]:transform-[translateY(calc(var(--toast-swipe-movement-y)-100%-var(--toast-inset)))]",- "data-expanded:data-ending-style:data-[swipe-direction=down]:transform-[translateY(calc(var(--toast-swipe-movement-y)+100%+var(--toast-inset)))]",- )}- data-position={position}- key={toast.id}- swipeDirection={- position.includes("center")- ? [isTop ? "up" : "down"]- : position.includes("left")- ? ["left", isTop ? "up" : "down"]- : ["right", isTop ? "up" : "down"]- }- toast={toast}- >- <Toast.Content className="pointer-events-auto flex items-center justify-between gap-1.5 overflow-hidden px-3.5 py-3 text-sm transition-opacity duration-250 data-behind:not-data-expanded:pointer-events-none data-behind:opacity-0 data-expanded:opacity-100">- <div className="flex gap-2">- {Icon && (- <div- className="[&>svg]:h-lh [&>svg]:w-4 [&_svg]:pointer-events-none [&_svg]:shrink-0"- data-slot="toast-icon"- >- <Icon className="in-data-[type=loading]:animate-spin in-data-[type=error]:text-destructive in-data-[type=info]:text-info in-data-[type=success]:text-success in-data-[type=warning]:text-warning in-data-[type=loading]:opacity-80" />- </div>- )}+ {toasts+ .filter((toast) => shouldRenderForActiveThread(toast.data, activeThreadId))+ .map((toast) => {+ const Icon = toast.type ? TOAST_ICONS[toast.type as keyof typeof TOAST_ICONS] : null;- <div className="flex flex-col gap-0.5">- <Toast.Title className="font-medium" data-slot="toast-title" />- <Toast.Description- className="text-muted-foreground"- data-slot="toast-description"- />- </div>- </div>- {toast.actionProps && (- <Toast.Action className={buttonVariants({ size: "xs" })} data-slot="toast-action">- {toast.actionProps.children}- </Toast.Action>+ return (+ <Toast.Root+ className={cn(+ "absolute z-[calc(9999-var(--toast-index))] h-(--toast-calc-height) w-full select-none rounded-lg border bg-popover not-dark:bg-clip-padding text-popover-foreground shadow-lg/5 [transition:transform_.5s_cubic-bezier(.22,1,.36,1),opacity_.5s,height_.15s] before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] dark:before:shadow-[0_-1px_--theme(--color-white/6%)]",+ // Base positioning using data-position+ "data-[position*=right]:right-0 data-[position*=right]:left-auto",+ "data-[position*=left]:right-auto data-[position*=left]:left-0",+ "data-[position*=center]:right-0 data-[position*=center]:left-0",+ "data-[position*=top]:top-0 data-[position*=top]:bottom-auto data-[position*=top]:origin-top",+ "data-[position*=bottom]:top-auto data-[position*=bottom]:bottom-0 data-[position*=bottom]:origin-bottom",+ // Gap fill for hover+ "after:absolute after:left-0 after:h-[calc(var(--toast-gap)+1px)] after:w-full",+ "data-[position*=top]:after:top-full",+ "data-[position*=bottom]:after:bottom-full",+ // Define some variables+ "[--toast-calc-height:var(--toast-frontmost-height,var(--toast-height))] [--toast-gap:--spacing(3)] [--toast-peek:--spacing(3)] [--toast-scale:calc(max(0,1-(var(--toast-index)*.1)))] [--toast-shrink:calc(1-var(--toast-scale))]",+ // Define offset-y variable+ "data-[position*=top]:[--toast-calc-offset-y:calc(var(--toast-offset-y)+var(--toast-index)*var(--toast-gap)+var(--toast-swipe-movement-y))]",+ "data-[position*=bottom]:[--toast-calc-offset-y:calc(var(--toast-offset-y)*-1+var(--toast-index)*var(--toast-gap)*-1+var(--toast-swipe-movement-y))]",+ // Default state transform+ "data-[position*=top]:transform-[translateX(var(--toast-swipe-movement-x))_translateY(calc(var(--toast-swipe-movement-y)+(var(--toast-index)*var(--toast-peek))+(var(--toast-shrink)*var(--toast-calc-height))))_scale(var(--toast-scale))]",+ "data-[position*=bottom]:transform-[translateX(var(--toast-swipe-movement-x))_translateY(calc(var(--toast-swipe-movement-y)-(var(--toast-index)*var(--toast-peek))-(var(--toast-shrink)*var(--toast-calc-height))))_scale(var(--toast-scale))]",+ // Limited state+ "data-limited:opacity-0",+ // Expanded state+ "data-expanded:h-(--toast-height)",+ "data-position:data-expanded:transform-[translateX(var(--toast-swipe-movement-x))_translateY(var(--toast-calc-offset-y))]",+ // Starting and ending animations+ "data-[position*=top]:data-starting-style:transform-[translateY(calc(-100%-var(--toast-inset)))]",+ "data-[position*=bottom]:data-starting-style:transform-[translateY(calc(100%+var(--toast-inset)))]",+ "data-ending-style:opacity-0",+ // Ending animations (direction-aware)+ "data-ending-style:not-data-limited:not-data-swipe-direction:transform-[translateY(calc(100%+var(--toast-inset)))]",+ "data-ending-style:data-[swipe-direction=left]:transform-[translateX(calc(var(--toast-swipe-movement-x)-100%-var(--toast-inset)))_translateY(var(--toast-calc-offset-y))]",+ "data-ending-style:data-[swipe-direction=right]:transform-[translateX(calc(var(--toast-swipe-movement-x)+100%+var(--toast-inset)))_translateY(var(--toast-calc-offset-y))]",+ "data-ending-style:data-[swipe-direction=up]:transform-[translateY(calc(var(--toast-swipe-movement-y)-100%-var(--toast-inset)))]",+ "data-ending-style:data-[swipe-direction=down]:transform-[translateY(calc(var(--toast-swipe-movement-y)+100%+var(--toast-inset)))]",+ // Ending animations (expanded)+ "data-expanded:data-ending-style:data-[swipe-direction=left]:transform-[translateX(calc(var(--toast-swipe-movement-x)-100%-var(--toast-inset)))_translateY(var(--toast-calc-offset-y))]",+ "data-expanded:data-ending-style:data-[swipe-direction=right]:transform-[translateX(calc(var(--toast-swipe-movement-x)+100%+var(--toast-inset)))_translateY(var(--toast-calc-offset-y))]",+ "data-expanded:data-ending-style:data-[swipe-direction=up]:transform-[translateY(calc(var(--toast-swipe-movement-y)-100%-var(--toast-inset)))]",+ "data-expanded:data-ending-style:data-[swipe-direction=down]:transform-[translateY(calc(var(--toast-swipe-movement-y)+100%+var(--toast-inset)))]",)}- </Toast.Content>- </Toast.Root>- );- })}+ data-position={position}+ key={toast.id}+ swipeDirection={+ position.includes("center")+ ? [isTop ? "up" : "down"]+ : position.includes("left")+ ? ["left", isTop ? "up" : "down"]+ : ["right", isTop ? "up" : "down"]+ }+ toast={toast}+ >+ <Toast.Content className="pointer-events-auto flex items-center justify-between gap-1.5 overflow-hidden px-3.5 py-3 text-sm transition-opacity duration-250 data-behind:not-data-expanded:pointer-events-none data-behind:opacity-0 data-expanded:opacity-100">+ <div className="flex gap-2">+ {Icon && (+ <div+ className="[&>svg]:h-lh [&>svg]:w-4 [&_svg]:pointer-events-none [&_svg]:shrink-0"+ data-slot="toast-icon"+ >+ <Icon className="in-data-[type=loading]:animate-spin in-data-[type=error]:text-destructive in-data-[type=info]:text-info in-data-[type=success]:text-success in-data-[type=warning]:text-warning in-data-[type=loading]:opacity-80" />+ </div>+ )}++ <div className="flex flex-col gap-0.5">+ <Toast.Title className="font-medium" data-slot="toast-title" />+ <Toast.Description+ className="text-muted-foreground"+ data-slot="toast-description"+ />+ </div>+ </div>+ {toast.actionProps && (+ <Toast.Action+ className={buttonVariants({ size: "xs" })}+ data-slot="toast-action"+ >+ {toast.actionProps.children}+ </Toast.Action>+ )}+ </Toast.Content>+ </Toast.Root>+ );+ })}</Toast.Viewport></Toast.Portal>);@@ -164,76 +186,80 @@ function AnchoredToastProvider({ children, ...props }: Toast.Provider.Props) {}function AnchoredToasts() {- const { toasts } = Toast.useToastManager();+ const { state } = useStore();+ const { toasts } = Toast.useToastManager<ThreadToastData>();+ const activeThreadId = state.activeThreadId;return (<Toast.Portal data-slot="toast-portal-anchored"><Toast.Viewport className="outline-none" data-slot="toast-viewport-anchored">- {toasts.map((toast) => {- const Icon = toast.type ? TOAST_ICONS[toast.type as keyof typeof TOAST_ICONS] : null;- const tooltipStyle = (toast.data as { tooltipStyle?: boolean })?.tooltipStyle ?? false;- const positionerProps = toast.positionerProps;-- if (!positionerProps?.anchor) {- return null;- }-- return (- <Toast.Positioner- className="z-50 max-w-[min(--spacing(64),var(--available-width))]"- data-slot="toast-positioner"- key={toast.id}- sideOffset={positionerProps.sideOffset ?? 4}- toast={toast}- >- <Toast.Root- className={cn(- "relative text-balance border bg-popover not-dark:bg-clip-padding text-popover-foreground text-xs transition-[scale,opacity] before:pointer-events-none before:absolute before:inset-0 before:shadow-[0_1px_--theme(--color-black/4%)] data-ending-style:scale-98 data-starting-style:scale-98 data-ending-style:opacity-0 data-starting-style:opacity-0 dark:before:shadow-[0_-1px_--theme(--color-white/6%)]",- tooltipStyle- ? "rounded-md shadow-md/5 before:rounded-[calc(var(--radius-md)-1px)]"- : "rounded-lg shadow-lg/5 before:rounded-[calc(var(--radius-lg)-1px)]",- )}- data-slot="toast-popup"+ {toasts+ .filter((toast) => shouldRenderForActiveThread(toast.data, activeThreadId))+ .map((toast) => {+ const Icon = toast.type ? TOAST_ICONS[toast.type as keyof typeof TOAST_ICONS] : null;+ const tooltipStyle = toast.data?.tooltipStyle ?? false;+ const positionerProps = toast.positionerProps;++ if (!positionerProps?.anchor) {+ return null;+ }++ return (+ <Toast.Positioner+ className="z-50 max-w-[min(--spacing(64),var(--available-width))]"+ data-slot="toast-positioner"+ key={toast.id}+ sideOffset={positionerProps.sideOffset ?? 4}toast={toast}>- {tooltipStyle ? (- <Toast.Content className="pointer-events-auto px-2 py-1">- <Toast.Title data-slot="toast-title" />- </Toast.Content>- ) : (- <Toast.Content className="pointer-events-auto flex items-center justify-between gap-1.5 overflow-hidden px-3.5 py-3 text-sm">- <div className="flex gap-2">- {Icon && (- <div- className="[&>svg]:h-lh [&>svg]:w-4 [&_svg]:pointer-events-none [&_svg]:shrink-0"- data-slot="toast-icon"- >- <Icon className="in-data-[type=loading]:animate-spin in-data-[type=error]:text-destructive in-data-[type=info]:text-info in-data-[type=success]:text-success in-data-[type=warning]:text-warning in-data-[type=loading]:opacity-80" />- </div>- )}+ <Toast.Root+ className={cn(+ "relative text-balance border bg-popover not-dark:bg-clip-padding text-popover-foreground text-xs transition-[scale,opacity] before:pointer-events-none before:absolute before:inset-0 before:shadow-[0_1px_--theme(--color-black/4%)] data-ending-style:scale-98 data-starting-style:scale-98 data-ending-style:opacity-0 data-starting-style:opacity-0 dark:before:shadow-[0_-1px_--theme(--color-white/6%)]",+ tooltipStyle+ ? "rounded-md shadow-md/5 before:rounded-[calc(var(--radius-md)-1px)]"+ : "rounded-lg shadow-lg/5 before:rounded-[calc(var(--radius-lg)-1px)]",+ )}+ data-slot="toast-popup"+ toast={toast}+ >+ {tooltipStyle ? (+ <Toast.Content className="pointer-events-auto px-2 py-1">+ <Toast.Title data-slot="toast-title" />+ </Toast.Content>+ ) : (+ <Toast.Content className="pointer-events-auto flex items-center justify-between gap-1.5 overflow-hidden px-3.5 py-3 text-sm">+ <div className="flex gap-2">+ {Icon && (+ <div+ className="[&>svg]:h-lh [&>svg]:w-4 [&_svg]:pointer-events-none [&_svg]:shrink-0"+ data-slot="toast-icon"+ >+ <Icon className="in-data-[type=loading]:animate-spin in-data-[type=error]:text-destructive in-data-[type=info]:text-info in-data-[type=success]:text-success in-data-[type=warning]:text-warning in-data-[type=loading]:opacity-80" />+ </div>+ )}- <div className="flex flex-col gap-0.5">- <Toast.Title className="font-medium" data-slot="toast-title" />- <Toast.Description- className="text-muted-foreground"- data-slot="toast-description"- />+ <div className="flex flex-col gap-0.5">+ <Toast.Title className="font-medium" data-slot="toast-title" />+ <Toast.Description+ className="text-muted-foreground"+ data-slot="toast-description"+ />+ </div></div>- </div>- {toast.actionProps && (- <Toast.Action- className={buttonVariants({ size: "xs" })}- data-slot="toast-action"- >- {toast.actionProps.children}- </Toast.Action>- )}- </Toast.Content>- )}- </Toast.Root>- </Toast.Positioner>- );- })}+ {toast.actionProps && (+ <Toast.Action+ className={buttonVariants({ size: "xs" })}+ data-slot="toast-action"+ >+ {toast.actionProps.children}+ </Toast.Action>+ )}+ </Toast.Content>+ )}+ </Toast.Root>+ </Toast.Positioner>+ );+ })}</Toast.Viewport></Toast.Portal>);