From d51cf72412cb015a779db6ec7d42b9843cadd350 Mon Sep 17 00:00:00 2001 From: chihlasm Date: Sat, 7 Mar 2026 15:07:07 -0500 Subject: [PATCH] fix: AI Assist panel as in-flow flex sibling (not fixed/overlay) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace fixed positioning with in-flow flex layout. The outermost div is now a horizontal flex row: content column (flex-1 min-w-0) + panel (w-[380px] shrink-0). When the panel opens, the content column automatically shrinks — no padding hacks or z-index stacking needed. This guarantees the content shifts left and stays fully visible. Co-Authored-By: Claude Opus 4.6 --- .../components/editor-ai/EditorAIPanel.tsx | 8 +--- frontend/src/pages/ProceduralEditorPage.tsx | 37 +++++++++-------- frontend/src/pages/TreeEditorPage.tsx | 41 ++++++++++--------- 3 files changed, 43 insertions(+), 43 deletions(-) diff --git a/frontend/src/components/editor-ai/EditorAIPanel.tsx b/frontend/src/components/editor-ai/EditorAIPanel.tsx index feda2b1b..10285ff9 100644 --- a/frontend/src/components/editor-ai/EditorAIPanel.tsx +++ b/frontend/src/components/editor-ai/EditorAIPanel.tsx @@ -6,8 +6,6 @@ import { ChatTab } from './ChatTab' import { SuggestionsTab } from './SuggestionsTab' import type { EditorAIChatMessage, AISuggestion } from '@/types' -const PANEL_WIDTH = 380 - interface EditorAIPanelProps { isOpen: boolean onClose: () => void @@ -25,8 +23,6 @@ interface EditorAIPanelProps { type Tab = 'chat' | 'suggestions' -export { PANEL_WIDTH } - export function EditorAIPanel({ isOpen, onClose, @@ -49,10 +45,8 @@ export function EditorAIPanel({ return (
+
+ {/* Main content column */} +
{/* Toolbar — sticky */}
@@ -320,21 +322,6 @@ export function ProceduralEditorPage() {
- - {editorAI.contextMenu && ( )} +
{/* end main content column */} + +
) } diff --git a/frontend/src/pages/TreeEditorPage.tsx b/frontend/src/pages/TreeEditorPage.tsx index ac26fc0c..7d35c150 100644 --- a/frontend/src/pages/TreeEditorPage.tsx +++ b/frontend/src/pages/TreeEditorPage.tsx @@ -17,7 +17,7 @@ import { cn, safeGetItem } from '@/lib/utils' import { toast } from '@/lib/toast' import { FlowAnalyticsPanel } from '@/components/analytics/FlowAnalyticsPanel' import { ExportFlowModal } from '@/components/library/ExportFlowModal' -import { EditorAIPanel, PANEL_WIDTH } from '@/components/editor-ai/EditorAIPanel' +import { EditorAIPanel } from '@/components/editor-ai/EditorAIPanel' import { ContextMenu } from '@/components/common/ContextMenu' import { useEditorAI } from '@/hooks/useEditorAI' import { findNodeInTree } from '@/store/treeEditorStore' @@ -522,7 +522,9 @@ export function TreeEditorPage() { } return ( -
+
+ {/* Main content column */} +
{/* Draft Restore Prompt */} {showDraftPrompt && ( @@ -876,23 +878,6 @@ export function TreeEditorPage() { /> )} - - {/* AI Context Menu */} {editorAI.contextMenu && ( )} +
{/* end main content column */} + +
) }