diff --git a/src/components/GroupsOverlay.tsx b/src/components/GroupsOverlay.tsx index 4da29c40..1e9e9a1a 100644 --- a/src/components/GroupsOverlay.tsx +++ b/src/components/GroupsOverlay.tsx @@ -5,8 +5,6 @@ import { useReactFlow, ViewportPortal } from "@xyflow/react"; import { useWorkflowStore, GROUP_COLORS } from "@/store/workflowStore"; import { GroupColor } from "@/types"; -const HEADER_HEIGHT = 32; - const COLOR_OPTIONS: { color: GroupColor; label: string }[] = [ { color: "neutral", label: "Gray" }, { color: "blue", label: "Blue" }, @@ -278,136 +276,155 @@ function GroupControls({ groupId, zoom }: GroupControlsProps) { width: group.size.width, height: group.size.height, pointerEvents: "none", + overflow: "visible", }} > - {/* Header - interactive */} + {/* Floating group name label - top-left, viewport-scaled */}
- {isEditing ? ( - setEditName(e.target.value)} - onBlur={handleNameSubmit} - onKeyDown={handleKeyDown} - className="bg-transparent border-none outline-none text-sm font-medium text-white px-0 py-0" - style={{ minWidth: 60, maxWidth: 200, width: `${Math.max(60, editName.length * 8)}px` }} - /> - ) : ( - setIsEditing(true)} - > - {group.name} - - )} - - {/* Spacer for drag area */} -
- - {/* Color Picker */} -
- - ); - })} -
- - )} -
- - {/* Lock/Unlock Button */} - +
+ - {/* Delete Button */} - + {/* Floating controls - top-right, viewport-scaled */} +
+
+ {/* Color Picker */} +
+ + ); + })} +
+ + )} +
+ + {/* Lock/Unlock Button */} + + + {/* Delete Button */} + +
{/* Resize handles - interactive */} diff --git a/src/store/workflowStore.ts b/src/store/workflowStore.ts index 731ef35b..472206ab 100644 --- a/src/store/workflowStore.ts +++ b/src/store/workflowStore.ts @@ -813,7 +813,6 @@ const workflowStoreImpl: StateCreator = (set, get) => ({ // Add padding around nodes const padding = 20; - const headerHeight = 32; // Match HEADER_HEIGHT in GroupsOverlay // Find next available color const usedColors = new Set(Object.values(groups).map((g) => g.color)); @@ -836,11 +835,11 @@ const workflowStoreImpl: StateCreator = (set, get) => ({ color, position: { x: minX - padding, - y: minY - padding - headerHeight + y: minY - padding, }, size: { width: maxX - minX + padding * 2, - height: maxY - minY + padding * 2 + headerHeight, + height: maxY - minY + padding * 2, }, };