From 6bffd6d2c43695431f5acc8b7a126eda56ae62a6 Mon Sep 17 00:00:00 2001 From: marko-kraemer Date: Wed, 7 May 2025 03:23:23 +0200 Subject: [PATCH] load thread page no-side-panel skeleton fix --- backend/agent/api.py | 4 +- .../(dashboard)/agents/[threadId]/page.tsx | 23 ++++----- .../thread/tool-call-side-panel.tsx | 47 +++++++++++++++++++ 3 files changed, 57 insertions(+), 17 deletions(-) diff --git a/backend/agent/api.py b/backend/agent/api.py index deb2aaf3..6a517658 100644 --- a/backend/agent/api.py +++ b/backend/agent/api.py @@ -40,7 +40,7 @@ MODEL_NAME_ALIASES = { "gpt-4": "openai/gpt-4", "gemini-flash-2.5": "openrouter/google/gemini-2.5-flash-preview", "grok-3": "xai/grok-3-fast-latest", - "deepseek": "deepseek/deepseek-chat", + "deepseek": "openrouter/deepseek/deepseek-chat", "grok-3-mini": "xai/grok-3-mini-fast-beta", "qwen3": "openrouter/qwen/qwen3-235b-a22b", @@ -52,7 +52,7 @@ MODEL_NAME_ALIASES = { "openai/gpt-4": "openai/gpt-4", "openrouter/google/gemini-2.5-flash-preview": "openrouter/google/gemini-2.5-flash-preview", "xai/grok-3-fast-latest": "xai/grok-3-fast-latest", - "deepseek/deepseek-chat": "deepseek/deepseek-chat", + "deepseek/deepseek-chat": "openrouter/deepseek/deepseek-chat", "xai/grok-3-mini-fast-beta": "xai/grok-3-mini-fast-beta", } diff --git a/frontend/src/app/(dashboard)/agents/[threadId]/page.tsx b/frontend/src/app/(dashboard)/agents/[threadId]/page.tsx index 82730b62..6183eef9 100644 --- a/frontend/src/app/(dashboard)/agents/[threadId]/page.tsx +++ b/frontend/src/app/(dashboard)/agents/[threadId]/page.tsx @@ -1370,7 +1370,7 @@ export default function ThreadPage({ return (
{/* Skeleton Header */}
@@ -1465,16 +1465,7 @@ export default function ThreadPage({
- {/* Skeleton Side Panel (closed state) */} -
-
-
- - - -
-
-
+ {/* Skeleton Side Panel (hidden during loading) */}
); } @@ -1483,7 +1474,7 @@ export default function ThreadPage({ return (
setIsSidePanelOpen(false)} toolCalls={[]} currentIndex={0} onNavigate={handleSidePanelNavigate} project={project || undefined} agentStatus="error" + isLoading={!initialLoadCompleted.current || isLoading} />
); @@ -1527,7 +1519,7 @@ export default function ThreadPage({ return (
{ setIsSidePanelOpen(false); userClosedPanelRef.current = true; @@ -1949,6 +1941,7 @@ export default function ThreadPage({ project={project || undefined} renderAssistantMessage={toolViewAssistant} renderToolResult={toolViewResult} + isLoading={!initialLoadCompleted.current || isLoading} /> {sandboxId && ( diff --git a/frontend/src/components/thread/tool-call-side-panel.tsx b/frontend/src/components/thread/tool-call-side-panel.tsx index 65f30d8f..9524e932 100644 --- a/frontend/src/components/thread/tool-call-side-panel.tsx +++ b/frontend/src/components/thread/tool-call-side-panel.tsx @@ -4,6 +4,7 @@ import { Project } from '@/lib/api'; import { getToolIcon } from '@/components/thread/utils'; import React from 'react'; import { Slider } from '@/components/ui/slider'; +import { Skeleton } from '@/components/ui/skeleton'; import { ApiMessageType } from '@/components/thread/types'; import { CircleDashed, X, ChevronLeft, ChevronRight } from 'lucide-react'; import { cn } from '@/lib/utils'; @@ -217,6 +218,7 @@ interface ToolCallSidePanelProps { toolContent?: string, isSuccess?: boolean, ) => React.ReactNode; + isLoading?: boolean; } export function ToolCallSidePanel({ @@ -230,6 +232,7 @@ export function ToolCallSidePanel({ project, renderAssistantMessage, renderToolResult, + isLoading = false, }: ToolCallSidePanelProps) { // Move hooks outside of conditional const [dots, setDots] = React.useState(''); @@ -308,6 +311,50 @@ export function ToolCallSidePanel({ if (!isOpen) return null; + if (isLoading) { + return ( +
+
+
+
+
+
+

+ Suna's Computer +

+
+ +
+
+
+
+ + + + +
+
+
+
+
+ ); + } + const renderContent = () => { if (!currentToolCall) { return (