Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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}`
Comment on lines +119 to +120

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Draft key omits chatId

copilotDraftScopeKey is ${workspaceId}:copilot:${workflowId} while home scopes drafts as ${workspaceId}:${chatId ?? 'new'}. Panel copilot still switches chats via chatId without remounting MothershipChat, so unsubmitted text, attachments, and contexts are shared across every chat in that workflow, and submit clears that shared draft for all of them. Include the active/resolved copilot chat id (or 'new') in the key for per-chat isolation.


const posthog = usePostHog()
const posthogRef = useRef(posthog)
Expand Down Expand Up @@ -898,6 +900,7 @@ export const Panel = memo(function Panel() {
onCancelQueueEdit={copilotCancelQueueEdit}
userId={session?.user?.id}
chatId={copilotResolvedChatId}
draftScopeKey={copilotDraftScopeKey}
layout='copilot-view'
/>
</div>
Expand Down
Loading