diff --git a/canvas/src/components/Canvas.tsx b/canvas/src/components/Canvas.tsx index f677862a..ebd8a1d3 100644 --- a/canvas/src/components/Canvas.tsx +++ b/canvas/src/components/Canvas.tsx @@ -13,6 +13,7 @@ import { import "@xyflow/react/dist/style.css"; import { useCanvasStore } from "@/store/canvas"; +import { useTheme } from "@/lib/theme-provider"; import { A2ATopologyOverlay } from "./A2ATopologyOverlay"; import { WorkspaceNode } from "./WorkspaceNode"; import { SidePanel } from "./SidePanel"; @@ -69,6 +70,14 @@ export function Canvas() { } function CanvasInner() { + // ReactFlow's `colorMode` prop drives the styling of every viewport + // primitive it renders directly (background dots, edge defaults, + // selection rings, controls, minimap mask). Pre-fix this was hard-pinned + // to "dark" — so on light theme the chrome (toolbar, side panel) flipped + // to warm-paper but the canvas backplate + edges stayed black, leaving a + // half-themed page. Pull resolvedTheme so the canvas matches the user's + // selected mode (and the system preference when they pick "system"). + const { resolvedTheme } = useTheme(); const rawNodes = useCanvasStore((s) => s.nodes); const edges = useCanvasStore((s) => s.edges); const a2aEdges = useCanvasStore((s) => s.a2aEdges); @@ -250,7 +259,7 @@ function CanvasInner() {
{ // Parents show as a filled region — hierarchy visible at // a glance in the minimap without needing to zoom.