From 8a4b9ebb05a8b5bde47638e1b645610c52bf88c5 Mon Sep 17 00:00:00 2001 From: Nicole Rappe Date: Thu, 1 May 2025 01:46:18 -0600 Subject: [PATCH] Reworked Node Dragging Behavior --- Data/Server/WebUI/src/Borealis.css | 15 +++++++++++++++ Data/Server/WebUI/src/Flow_Editor.jsx | 11 ++++++++++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/Data/Server/WebUI/src/Borealis.css b/Data/Server/WebUI/src/Borealis.css index a4c9688..6a0c51e 100644 --- a/Data/Server/WebUI/src/Borealis.css +++ b/Data/Server/WebUI/src/Borealis.css @@ -94,6 +94,21 @@ label { font-size: 9px; } +/* Node Header - Shows drag handle cursor */ +.borealis-node-header { + cursor: grab; +} + +/* Optional: when actively dragging */ +.borealis-node-header:active { + cursor: grabbing; +} + +/* Node Body - Just pointer, not draggable */ +.borealis-node-content { + cursor: default; +} + /* ======================================= */ /* FLOW TABS */ /* ======================================= */ diff --git a/Data/Server/WebUI/src/Flow_Editor.jsx b/Data/Server/WebUI/src/Flow_Editor.jsx index 309a76e..4624eec 100644 --- a/Data/Server/WebUI/src/Flow_Editor.jsx +++ b/Data/Server/WebUI/src/Flow_Editor.jsx @@ -65,7 +65,16 @@ export default function FlowEditor({ const position = project({ x: event.clientX - bounds.left, y: event.clientY - bounds.top }); const id = "node-" + Date.now(); const nodeMeta = Object.values(categorizedNodes).flat().find((n) => n.type === type); - const newNode = { id, type, position, data: { label: nodeMeta?.label || type, content: nodeMeta?.content } }; + const newNode = { + id, + type, + position, + data: { + label: nodeMeta?.label || type, + content: nodeMeta?.content + }, + dragHandle: '.borealis-node-header' // <-- Add this line + }; setNodes((nds) => [...nds, newNode]); }, [project, setNodes, categorizedNodes]