diff --git a/src/App.css b/src/App.css index 456f36f7..39df78c4 100644 --- a/src/App.css +++ b/src/App.css @@ -1,5 +1,4 @@ @import "tailwindcss"; -@import "@xyflow/react/dist/style.css"; @theme { --color-bg: #1f2326; diff --git a/src/components/GraphCanvasEditor.tsx b/src/components/GraphCanvasEditor.tsx index f16c1c21..df540be6 100644 --- a/src/components/GraphCanvasEditor.tsx +++ b/src/components/GraphCanvasEditor.tsx @@ -15,6 +15,7 @@ import { type ReactFlowInstance, type Viewport, } from "@xyflow/react"; +import "@xyflow/react/dist/style.css"; import { Boxes, Check, diff --git a/src/components/Pane.tsx b/src/components/Pane.tsx index c1c5633a..1023cdce 100644 --- a/src/components/Pane.tsx +++ b/src/components/Pane.tsx @@ -26,6 +26,8 @@ import { X, } from "lucide-react"; import { + Suspense, + lazy, useCallback, useMemo, useRef, @@ -39,7 +41,6 @@ import { FileViewer } from "./FileViewer"; import { mediaKindFromPath } from "../lib/mediaFiles"; import { writeClipboardText } from "../lib/clipboardText"; import { ChatPane } from "./ChatPane"; -import { GraphSessionView } from "./GraphSessionView"; import { WorkSummaryView } from "./WorkSummaryView"; import { api } from "../lib/api"; import { @@ -123,6 +124,11 @@ import { type WorkspaceTabDragSession, } from "../lib/workspaceTabDrag"; +const GraphSessionView = lazy(async () => { + const module = await import("./GraphSessionView"); + return { default: module.GraphSessionView }; +}); + const SESSION_STATUS_TONE: Record = { ready: "neutral", working: "accent", @@ -606,7 +612,9 @@ export function Pane({ paneId }: PaneProps) { a frontend-owned file tab instead of a PTY session. */} {activeSession?.graph ? ( - + + + ) : activeSession?.mode === "chat" ? ( { + const module = await import("./GraphSessionDialog"); + return { default: module.GraphSessionDialog }; +}); + const PROJECT_DRAG_PREFIX = "project:"; const FOLDER_DRAG_PREFIX = "folder:"; const SESSION_DRAG_PREFIX = "session:"; @@ -1584,14 +1590,18 @@ export function Sidebar() { open={addProjectOpen} onClose={() => setAddProjectOpen(false)} /> - { - setGraphSessionOpen(false); - setGraphSessionScope(null); - }} - /> + {graphSessionOpen ? ( + + { + setGraphSessionOpen(false); + setGraphSessionScope(null); + }} + /> + + ) : null} setNewProjectOpen(false)}