From 875fff825c0efc9b7184b5cef3bfa89af822a10d Mon Sep 17 00:00:00 2001 From: liangxu Date: Fri, 10 Jul 2026 23:09:42 +0800 Subject: [PATCH] feat(canvas): add loading state for agent history retrieval --- frontend/src/ui/pages/CanvasWorkspace/index.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frontend/src/ui/pages/CanvasWorkspace/index.tsx b/frontend/src/ui/pages/CanvasWorkspace/index.tsx index 33bbe22..b04de59 100644 --- a/frontend/src/ui/pages/CanvasWorkspace/index.tsx +++ b/frontend/src/ui/pages/CanvasWorkspace/index.tsx @@ -2682,6 +2682,7 @@ export function CanvasWorkspace({ projectId, shareAccess = ownerWorkspaceAccess setAgentHistoryOpen(false); const currentProject = projectRef.current; if (currentProject) { + setAgentHistoryLoading(true); setMessages(visibleAgentMessagesForThread(currentProject, imageGeneratorThreadIdsRef.current, threadId)); void designGateway .getProjectHistory(currentProject.id, threadId) @@ -2698,6 +2699,9 @@ export function CanvasWorkspace({ projectId, shareAccess = ownerWorkspaceAccess }) .catch((err) => { console.warn("Failed to load agent thread history", err); + }) + .finally(() => { + if (selectedAgentThreadIdRef.current === threadId) setAgentHistoryLoading(false); }); } };