From f3940e7338801818da9742d0c38942a8f9823f2f Mon Sep 17 00:00:00 2001 From: Soumyadas15 Date: Tue, 27 May 2025 13:07:03 +0530 Subject: [PATCH] chore(ui): better looking browser screenshot loader --- .../thread/tool-views/BrowserToolView.tsx | 17 ++++++----------- .../thread/tool-views/shared/ImageLoader.tsx | 13 +++++++++++++ 2 files changed, 19 insertions(+), 11 deletions(-) create mode 100644 frontend/src/components/thread/tool-views/shared/ImageLoader.tsx diff --git a/frontend/src/components/thread/tool-views/BrowserToolView.tsx b/frontend/src/components/thread/tool-views/BrowserToolView.tsx index 9fd15ce7..d1126557 100644 --- a/frontend/src/components/thread/tool-views/BrowserToolView.tsx +++ b/frontend/src/components/thread/tool-views/BrowserToolView.tsx @@ -19,6 +19,7 @@ import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; import { Badge } from '@/components/ui/badge'; import { Button } from '@/components/ui/button'; import { Skeleton } from '@/components/ui/skeleton'; +import { ImageLoader } from './shared/ImageLoader'; export function BrowserToolView({ name = 'browser-operation', @@ -186,9 +187,7 @@ export function BrowserToolView({ return (
{imageLoading && ( -
- -
+ )} {imageLoading && ( -
- -
+ )} ) - ) : // For non-last tool calls, only show screenshot if available, otherwise show "No Browser State" + ) : (screenshotUrl || screenshotBase64) ? ( -
+
{imageLoading && ( -
- -
+ )} {screenshotUrl ? ( { + return ( +
+
+ + + +
+
+ ) +} \ No newline at end of file