From d6d937e53b314bdeb4842d040dee41157db35a1d Mon Sep 17 00:00:00 2001 From: Lum1104 Date: Sat, 14 Mar 2026 19:36:48 +0800 Subject: [PATCH] fix(dashboard): extract shared node dimension constants to layout utility Co-Authored-By: Claude Opus 4.6 --- packages/dashboard/src/components/GraphView.tsx | 4 +--- packages/dashboard/src/utils/layout.ts | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/dashboard/src/components/GraphView.tsx b/packages/dashboard/src/components/GraphView.tsx index fd36042..bf27d30 100644 --- a/packages/dashboard/src/components/GraphView.tsx +++ b/packages/dashboard/src/components/GraphView.tsx @@ -13,11 +13,9 @@ import "@xyflow/react/dist/style.css"; import CustomNode from "./CustomNode"; import type { CustomFlowNode } from "./CustomNode"; import { useDashboardStore } from "../store"; -import { applyDagreLayout } from "../utils/layout"; +import { applyDagreLayout, NODE_WIDTH, NODE_HEIGHT } from "../utils/layout"; import { getLayerColor, getLayerBorderColor } from "./LayerLegend"; -const NODE_WIDTH = 280; -const NODE_HEIGHT = 120; const LAYER_PADDING = 40; const nodeTypes = { custom: CustomNode }; diff --git a/packages/dashboard/src/utils/layout.ts b/packages/dashboard/src/utils/layout.ts index fbec2d3..9d451ee 100644 --- a/packages/dashboard/src/utils/layout.ts +++ b/packages/dashboard/src/utils/layout.ts @@ -1,8 +1,8 @@ import dagre from "@dagrejs/dagre"; import type { Node, Edge } from "@xyflow/react"; -const NODE_WIDTH = 280; -const NODE_HEIGHT = 120; +export const NODE_WIDTH = 280; +export const NODE_HEIGHT = 120; export function applyDagreLayout( nodes: Node[],