From 6933b793a250a2cb4d1d8ff0773ffe03403c2042 Mon Sep 17 00:00:00 2001 From: Abhijay007 Date: Sun, 23 Nov 2025 14:43:54 +0000 Subject: [PATCH 1/2] feat : add ability to see error message in toast Signed-off-by: Abhijay007 --- ui/desktop/src/App.tsx | 2 +- ui/desktop/src/styles/main.css | 6 +++--- ui/desktop/src/toasts.tsx | 37 +++++++++++++++++++++++++++++----- 3 files changed, 36 insertions(+), 9 deletions(-) diff --git a/ui/desktop/src/App.tsx b/ui/desktop/src/App.tsx index 08349f84087b..33a8d222f4d8 100644 --- a/ui/desktop/src/App.tsx +++ b/ui/desktop/src/App.tsx @@ -625,7 +625,7 @@ export function AppInner() { text-text-on-accent bg-background-inverse ` } - style={{ width: '380px' }} + style={{ width: '450px' }} className="mt-6" position="top-right" autoClose={3000} diff --git a/ui/desktop/src/styles/main.css b/ui/desktop/src/styles/main.css index f5432134e036..f76417a52cf2 100644 --- a/ui/desktop/src/styles/main.css +++ b/ui/desktop/src/styles/main.css @@ -373,9 +373,9 @@ .Toastify__close-button { color: var(--text-prominent-inverse) !important; opacity: 0.7; - align-self: flex-start; - margin-top: 4px; - margin-right: 4px; + align-self: center; + margin-top: 0; + margin-right: 8px; padding: 4px; border-radius: 4px; transition: diff --git a/ui/desktop/src/toasts.tsx b/ui/desktop/src/toasts.tsx index d75cb12506b8..b3b44ce3157a 100644 --- a/ui/desktop/src/toasts.tsx +++ b/ui/desktop/src/toasts.tsx @@ -1,5 +1,7 @@ import { toast, ToastOptions } from 'react-toastify'; import { Button } from './components/ui/button'; +import { Tooltip, TooltipContent, TooltipTrigger } from './components/ui/Tooltip'; +import Copy from './components/icons/Copy'; import { startNewSession } from './sessions'; import { useNavigation } from './hooks/useNavigation'; import { @@ -173,19 +175,44 @@ function ToastErrorContent({ }: Omit) { const setView = useNavigation(); const showRecovery = recoverHints && setView; + const hasBoth = traceback && showRecovery; + + const handleCopyError = async () => { + if (traceback) { + try { + await navigator.clipboard.writeText(traceback); + setTimeout(() => { + toast.dismiss(); + }, 1500); + } catch (error) { + console.error('Failed to copy error:', error); + } + } + }; return ( -
+
{title && {title}} {msg &&
{msg}
}
- {showRecovery ? ( + {showRecovery && ( - ) : traceback ? ( - - ) : null} + )} + {hasBoth && ( + + + + + + Copy error + + + )} + {traceback && !hasBoth && }
); From c1fd3ab8450ca6529439867438a1f0e641c7554e Mon Sep 17 00:00:00 2001 From: Abhijay007 Date: Mon, 24 Nov 2025 07:11:50 +0000 Subject: [PATCH 2/2] refactor : removed auto-dismiss as it getting handled by toast Signed-off-by: Abhijay007 --- ui/desktop/src/toasts.tsx | 3 --- 1 file changed, 3 deletions(-) diff --git a/ui/desktop/src/toasts.tsx b/ui/desktop/src/toasts.tsx index b3b44ce3157a..6e3754e26579 100644 --- a/ui/desktop/src/toasts.tsx +++ b/ui/desktop/src/toasts.tsx @@ -181,9 +181,6 @@ function ToastErrorContent({ if (traceback) { try { await navigator.clipboard.writeText(traceback); - setTimeout(() => { - toast.dismiss(); - }, 1500); } catch (error) { console.error('Failed to copy error:', error); }