Skip to content

Commit fc3aa8f

Browse files
Bill LeoutsakosBill Leoutsakos
authored andcommitted
fix(copilot): persist workflow drafts across navigation
1 parent edc25aa commit fc3aa8f

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

apps/sim/app/workspace/[workspaceId]/home/components/mothership-chat/mothership-chat.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,7 @@ export function MothershipChat({
764764
onCancelEdit={onCancelQueueEdit}
765765
/>
766766
<UserInput
767+
key={draftScopeKey}
767768
ref={userInputRef}
768769
onSubmit={onSubmit}
769770
isSending={isStreamActive}

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/panel.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,9 @@ export const Panel = memo(function Panel() {
396396
},
397397
})
398398
)
399+
const copilotDraftScopeKey = activeWorkflowId
400+
? `${workspaceId}:workflow-copilot:${activeWorkflowId}`
401+
: undefined
399402

400403
const handleCopilotNewChat = useCallback(() => {
401404
if (!activeWorkflowId || !workspaceId) return
@@ -943,6 +946,7 @@ export const Panel = memo(function Panel() {
943946
onCancelQueueEdit={copilotCancelQueueEdit}
944947
userId={session?.user?.id}
945948
chatId={copilotResolvedChatId}
949+
draftScopeKey={copilotDraftScopeKey}
946950
layout='copilot-view'
947951
/>
948952
</div>

0 commit comments

Comments
 (0)