From 789f4373de2ee7f59746acb3f4bbf29d3a37c80e Mon Sep 17 00:00:00 2001 From: chihlasm Date: Sat, 7 Mar 2026 15:42:10 -0500 Subject: [PATCH] fix: AI Copilot panel as in-flow flex sibling in session navigation pages Changed CopilotPanel from fixed overlay to flex layout sibling so it pushes main content instead of covering it during active sessions. Co-Authored-By: Claude Opus 4.6 --- .../src/components/copilot/CopilotPanel.tsx | 4 +-- .../src/pages/ProceduralNavigationPage.tsx | 26 +++++++++-------- frontend/src/pages/TreeNavigationPage.tsx | 28 ++++++++++--------- 3 files changed, 31 insertions(+), 27 deletions(-) diff --git a/frontend/src/components/copilot/CopilotPanel.tsx b/frontend/src/components/copilot/CopilotPanel.tsx index c5848516..0e90a32b 100644 --- a/frontend/src/components/copilot/CopilotPanel.tsx +++ b/frontend/src/components/copilot/CopilotPanel.tsx @@ -88,9 +88,9 @@ export function CopilotPanel({ isOpen, onClose, treeId, sessionId, currentNodeId return (
- {/* Right panel - step detail */} + {/* Right panel - step detail + copilot */}
{currentStep && ( )}
+ + {/* AI Copilot - in-flow panel */} + {treeId && copilotOpen && ( + setCopilotOpen(false)} + treeId={treeId} + sessionId={session?.id} + currentNodeId={runtimeSteps[currentStepIndex]?.id} + /> + )}
{/* CSAT Modal */} @@ -708,18 +719,9 @@ export function ProceduralNavigationPage() { /> )} - {/* AI Copilot */} + {/* AI Copilot toggle button */} {treeId && ( - <> - setCopilotOpen(true)} /> - setCopilotOpen(false)} - treeId={treeId} - sessionId={session?.id} - currentNodeId={runtimeSteps[currentStepIndex]?.id} - /> - + setCopilotOpen(true)} /> )} ) diff --git a/frontend/src/pages/TreeNavigationPage.tsx b/frontend/src/pages/TreeNavigationPage.tsx index d71908cc..3b3b1704 100644 --- a/frontend/src/pages/TreeNavigationPage.tsx +++ b/frontend/src/pages/TreeNavigationPage.tsx @@ -626,9 +626,9 @@ export function TreeNavigationPage() { } return ( -
+
{/* Main Content */} -
+
{/* Header */}
@@ -1264,6 +1264,17 @@ export function TreeNavigationPage() {
+ {/* AI Copilot - in-flow panel */} + {treeId && copilotOpen && ( + setCopilotOpen(false)} + treeId={treeId} + sessionId={session?.id} + currentNodeId={currentNodeId} + /> + )} + {/* Scratchpad Sidebar */} {session && ( )} - {/* AI Copilot */} + {/* AI Copilot toggle button */} {treeId && ( - <> - setCopilotOpen(true)} /> - setCopilotOpen(false)} - treeId={treeId} - sessionId={session?.id} - currentNodeId={currentNodeId} - /> - + setCopilotOpen(true)} /> )}
)