From e5544932e74c0eff622ec471d168bd141127c792 Mon Sep 17 00:00:00 2001 From: Sim Pi Agent Date: Tue, 28 Jul 2026 20:40:46 +0000 Subject: [PATCH 1/2] fix: persist Copilot drafts per workflow --- .../[workspaceId]/w/[workflowId]/components/panel/panel.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/panel.tsx b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/panel.tsx index 1a997731fd8..eab7b1a366f 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/panel.tsx +++ b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/panel.tsx @@ -116,6 +116,8 @@ export const Panel = memo(function Panel() { const router = useRouter() const params = useParams() const workspaceId = params.workspaceId as string + const workflowId = params.workflowId as string + const copilotDraftScopeKey = `${workspaceId}:copilot:${workflowId}` const posthog = usePostHog() const posthogRef = useRef(posthog) @@ -898,6 +900,7 @@ export const Panel = memo(function Panel() { onCancelQueueEdit={copilotCancelQueueEdit} userId={session?.user?.id} chatId={copilotResolvedChatId} + draftScopeKey={copilotDraftScopeKey} layout='copilot-view' /> From c718f0b1f12f6029e42a44ec1a47865b6bcdd14c Mon Sep 17 00:00:00 2001 From: Bill Leoutsakos <157128530+BillLeoutsakosvl346@users.noreply.github.com> Date: Tue, 28 Jul 2026 13:48:26 -0700 Subject: [PATCH 2/2] fix: isolate Copilot drafts when switching workflows --- .../[workspaceId]/w/[workflowId]/components/panel/panel.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/panel.tsx b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/panel.tsx index eab7b1a366f..94454832fd1 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/panel.tsx +++ b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/panel.tsx @@ -116,8 +116,6 @@ export const Panel = memo(function Panel() { const router = useRouter() const params = useParams() const workspaceId = params.workspaceId as string - const workflowId = params.workflowId as string - const copilotDraftScopeKey = `${workspaceId}:copilot:${workflowId}` const posthog = usePostHog() const posthogRef = useRef(posthog) @@ -153,6 +151,9 @@ export const Panel = memo(function Panel() { const { data: workflows = {} } = useWorkflowMap(workspaceId) const { data: folders = {} } = useFolderMap(workspaceId) const activeWorkflowId = useWorkflowRegistry((state) => state.activeWorkflowId) + const copilotDraftScopeKey = activeWorkflowId + ? `${workspaceId}:copilot:${activeWorkflowId}` + : undefined const { handleAutoLayout: autoLayoutWithFitView } = useAutoLayout(activeWorkflowId || null) // Check for locked blocks (disables auto-layout) @@ -885,6 +886,7 @@ export const Panel = memo(function Panel() {