A modern platform for visual, flexible, and extensible graph-based investigations. For cybersecurity analysts and investigators.
feat(app): rectangle selection + minor updates
dextmorgn3ed1562de9c4
diff --git a/flowsint-app/src/components/graphs/details-panel/edge-details-panel.tsx b/flowsint-app/src/components/graphs/details-panel/edge-details-panel.tsxindex a1d30528..55a9796c 100644--- a/flowsint-app/src/components/graphs/details-panel/edge-details-panel.tsx+++ b/flowsint-app/src/components/graphs/details-panel/edge-details-panel.tsx@@ -1,6 +1,6 @@import { memo, useCallback } from 'react'import { Button } from '@/components/ui/button'-import { Trash2, ArrowRight, MousePointer } from 'lucide-react'+import { Trash2, ArrowRight, MousePointer, Link2 } from 'lucide-react'import { useGraphStore } from '@/stores/graph-store'import { useParams } from '@tanstack/react-router'import { toast } from 'sonner'@@ -10,6 +10,8 @@ import { sketchService } from '@/api/sketch-service'import { CopyButton } from '@/components/copy'import { GraphEdge } from '@/types'import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/components/ui/tooltip'+import { cn } from '@/lib/utils'+import { Badge } from '@/components/ui/badge'const EdgeDetailsPanel = memo(({ edge }: { edge: GraphEdge | null }) => {const { id: sketchId } = useParams({ strict: false })@@ -89,75 +91,170 @@ const EdgeDetailsPanel = memo(({ edge }: { edge: GraphEdge | null }) => {}return (- <div className="flex items-center h-10 bg-card border-b px-3 gap-2">- {/* Source */}- {sourceNode && (- <TooltipProvider>- <Tooltip>- <TooltipTrigger asChild>- <button- onClick={handleJumpToSource}- className="flex items-center justify-center w-6 h-6 rounded-full bg-muted hover:bg-muted/80 flex-shrink-0"- >- <SourceIcon className="h-3 w-3" />- </button>- </TooltipTrigger>- <TooltipContent>- <p>{sourceNode.data.label}</p>- </TooltipContent>- </Tooltip>- </TooltipProvider>- )}-- {/* Arrow */}- <ArrowRight className="h-3 w-3 text-muted-foreground flex-shrink-0" />-- {/* Label */}- <div className="flex-1 min-w-0 flex items-center gap-1">- <span className="text-xs font-medium truncate">{edge.label || 'Relationship'}</span>- {edge.label && <CopyButton content={edge.label} size="icon" className="h-5 w-5 flex-shrink-0" />}+ <div className="flex flex-col h-full overflow-x-hidden overflow-y-auto bg-card">+ {/* Header */}+ <div className="flex items-center bg-card h-10 sticky w-full top-0 border-b justify-start px-3 gap-2 z-1">+ <Link2 className="h-3 w-3 text-muted-foreground flex-shrink-0" />+ <p className="text-sm font-semibold truncate">{edge.label || 'Relationship'}</p>+ <div className="grow" />+ <div className="flex items-center">+ <TooltipProvider>+ <Tooltip>+ <TooltipTrigger asChild>+ <Button+ variant="ghost"+ size="sm"+ onClick={handleDelete}+ className="h-6 w-6 p-0 hover:bg-muted opacity-70 hover:opacity-100 text-destructive hover:text-destructive"+ >+ <Trash2 className="h-3 w-3" strokeWidth={2} />+ </Button>+ </TooltipTrigger>+ <TooltipContent>+ <p>Delete relationship</p>+ </TooltipContent>+ </Tooltip>+ </TooltipProvider>+ </div></div>- {/* Arrow */}- <ArrowRight className="h-3 w-3 text-muted-foreground flex-shrink-0" />-- {/* Target */}- {targetNode && (- <TooltipProvider>- <Tooltip>- <TooltipTrigger asChild>- <button- onClick={handleJumpToTarget}- className="flex items-center justify-center w-6 h-6 rounded-full bg-muted hover:bg-muted/80 flex-shrink-0"- >- <TargetIcon className="h-3 w-3" />- </button>- </TooltipTrigger>- <TooltipContent>- <p>{targetNode.data.label}</p>- </TooltipContent>- </Tooltip>- </TooltipProvider>- )}-- {/* Delete */}- <TooltipProvider>- <Tooltip>- <TooltipTrigger asChild>- <Button- variant="ghost"- size="sm"- onClick={handleDelete}- className="h-6 w-6 p-0 hover:bg-muted opacity-70 hover:opacity-100 text-destructive hover:text-destructive flex-shrink-0"+ {/* Content */}+ <div className="flex-1 overflow-x-hidden">+ {/* Connection Flow */}+ <div className="px-3 py-3 border-b border-border">+ <div className="flex items-center gap-2">+ {/* Source Node */}+ <button+ onClick={handleJumpToSource}+ className="flex-1 flex items-center gap-2 p-2 rounded-lg border bg-muted/30 hover:bg-muted/50 transition-colors group min-w-0">- <Trash2 className="h-3 w-3" strokeWidth={2} />- </Button>- </TooltipTrigger>- <TooltipContent>- <p>Delete relationship</p>- </TooltipContent>- </Tooltip>- </TooltipProvider>+ <div className="flex items-center justify-center w-6 h-6 rounded-full bg-background flex-shrink-0">+ <SourceIcon className="h-3 w-3" />+ </div>+ <div className="flex-1 min-w-0 text-left">+ <p className="text-[10px] text-muted-foreground mb-0.5">Source</p>+ <p className="text-xs font-medium truncate group-hover:text-primary transition-colors">+ {sourceNode?.data?.label || 'Unknown'}+ </p>+ </div>+ </button>++ <ArrowRight className="h-4 w-4 text-muted-foreground flex-shrink-0" />++ {/* Target Node */}+ <button+ onClick={handleJumpToTarget}+ className="flex-1 flex items-center gap-2 p-2 rounded-lg border bg-muted/30 hover:bg-muted/50 transition-colors group min-w-0"+ >+ <div className="flex items-center justify-center w-6 h-6 rounded-full bg-background flex-shrink-0">+ <TargetIcon className="h-3 w-3" />+ </div>+ <div className="flex-1 min-w-0 text-left">+ <p className="text-[10px] text-muted-foreground mb-0.5">Target</p>+ <p className="text-xs font-medium truncate group-hover:text-primary transition-colors">+ {targetNode?.data?.label || 'Unknown'}+ </p>+ </div>+ </button>+ </div>+ </div>++ {/* Properties */}+ <div className="w-full overflow-x-hidden">+ {/* Label */}+ <div className="flex w-full bg-card items-center divide-x divide-border border-b border-border p-0">+ <div className="w-1/2 px-3 py-1.5 text-xs text-muted-foreground font-normal truncate">+ Label+ </div>+ <div className="w-1/2 px-3 py-1.5 text-xs font-medium flex items-center justify-between min-w-0 gap-1">+ <div className="truncate font-semibold">+ {edge.label || <span className="italic text-muted-foreground">N/A</span>}+ </div>+ {edge.label && <CopyButton className="h-5 w-5 shrink-0" content={edge.label} />}+ </div>+ </div>++ {/* Type */}+ {edge.type && (+ <div className="flex w-full bg-card items-center divide-x divide-border border-b border-border p-0">+ <div className="w-1/2 px-3 py-1.5 text-xs text-muted-foreground font-normal truncate">+ Type+ </div>+ <div className="w-1/2 px-3 py-1.5 text-xs font-medium flex items-center justify-between min-w-0">+ <Badge variant="secondary" className="truncate text-[10px] px-1.5 py-0">+ {edge.type}+ </Badge>+ </div>+ </div>+ )}++ {/* Caption */}+ {edge.caption && (+ <div className="flex w-full bg-card items-center divide-x divide-border border-b border-border p-0">+ <div className="w-1/2 px-3 py-1.5 text-xs text-muted-foreground font-normal truncate">+ Caption+ </div>+ <div className="w-1/2 px-3 py-1.5 text-xs font-medium flex items-center justify-between min-w-0 gap-1">+ <div className="truncate font-semibold">{edge.caption}</div>+ <CopyButton className="h-5 w-5 shrink-0" content={edge.caption} />+ </div>+ </div>+ )}++ {/* Date */}+ {edge.date && (+ <div className="flex w-full bg-card items-center divide-x divide-border border-b border-border p-0">+ <div className="w-1/2 px-3 py-1.5 text-xs text-muted-foreground font-normal truncate">+ Date+ </div>+ <div className="w-1/2 px-3 py-1.5 text-xs font-medium flex items-center justify-between min-w-0 gap-1">+ <div className="truncate font-semibold">{edge.date}</div>+ <CopyButton className="h-5 w-5 shrink-0" content={edge.date} />+ </div>+ </div>+ )}++ {/* Confidence Level */}+ {edge.confidence_level !== undefined && edge.confidence_level !== null && (+ <div className="flex w-full bg-card items-center divide-x divide-border border-b border-border p-0">+ <div className="w-1/2 px-3 py-1.5 text-xs text-muted-foreground font-normal truncate">+ Confidence+ </div>+ <div className="w-1/2 px-3 py-1.5 text-xs font-medium flex items-center justify-between min-w-0 gap-1">+ <div className="flex items-center gap-1.5 min-w-0">+ <div className="h-1.5 flex-1 min-w-[40px] max-w-[60px] bg-muted rounded-full overflow-hidden">+ <div+ className={cn(+ 'h-full rounded-full transition-all',+ Number(edge.confidence_level) >= 70+ ? 'bg-green-500'+ : Number(edge.confidence_level) >= 40+ ? 'bg-yellow-500'+ : 'bg-red-500'+ )}+ style={{ width: `${Number(edge.confidence_level)}%` }}+ />+ </div>+ <span className="font-semibold text-[10px] shrink-0">{edge.confidence_level}%</span>+ </div>+ </div>+ </div>+ )}++ {/* ID */}+ <div className="flex w-full bg-card items-center divide-x divide-border border-b border-border p-0">+ <div className="w-1/2 px-3 py-1.5 text-xs text-muted-foreground font-normal truncate">+ ID+ </div>+ <div className="w-1/2 px-3 py-1.5 text-xs font-medium flex items-center justify-between min-w-0 gap-1">+ <code className="truncate text-[10px] font-mono bg-muted px-1.5 py-0.5 rounded">+ {edge.id}+ </code>+ <CopyButton className="h-5 w-5 shrink-0" content={edge.id} />+ </div>+ </div>+ </div>+ </div></div>)})diff --git a/flowsint-app/src/components/graphs/graph-viewer.tsx b/flowsint-app/src/components/graphs/graph-viewer.tsxindex 74c3f182..1e72004a 100644--- a/flowsint-app/src/components/graphs/graph-viewer.tsx+++ b/flowsint-app/src/components/graphs/graph-viewer.tsx@@ -8,7 +8,8 @@ import ForceGraph2D from 'react-force-graph-2d'import { Button } from '../ui/button'import { useTheme } from '@/components/theme-provider'import { Info, Loader2, Plus, Share2, Type, Upload } from 'lucide-react'-import Lasso from './lasso'+import Lasso from './selectors/lasso'+import Rectangle from './selectors/rectangle'import { GraphNode, GraphEdge } from '@/types'import { useSaveNodePositions } from '@/hooks/use-save-node-positions'import { useLayout } from '@/hooks/use-layout'@@ -136,7 +137,8 @@ const GraphViewer: React.FC<GraphViewerProps> = ({sketchId}) => {const [containerSize, setContainerSize] = useState({ width: 0, height: 0 })- const isLassoActive = useGraphControls((s) => s.isLassoActive)+ const isSelectorModeActive = useGraphControls((s) => s.isSelectorModeActive)+ const selectionMode = useGraphControls((s) => s.selectionMode)// Hover highlighting stateconst [highlightNodes, setHighlightNodes] = useState<Set<string>>(new Set())const [highlightLinks, setHighlightLinks] = useState<Set<string>>(new Set())@@ -1148,18 +1150,31 @@ const GraphViewer: React.FC<GraphViewerProps> = ({onNodeHover={handleNodeHoverWithTooltip}onLinkHover={handleLinkHover}/>- {allowLasso && isLassoActive && (+ {allowLasso && isSelectorModeActive && (<><divclassName="absolute z-20 top-3 flex items-center gap-1 left-3 bg-primary/20 text-primary border border-primary/40 rounded-lg p-1 px-2 text-xs pointer-events-none"- ><Info className='h-3 w-3 ' /> Lasso is active</div>- <Lasso- nodes={graphData.nodes}- graph2ScreenCoords={graph2ScreenCoords}- partial={true}- width={containerSize.width}- height={containerSize.height}- />+ >+ <Info className='h-3 w-3 ' />+ {selectionMode === 'lasso' ? 'Lasso' : 'Rectangle'} selection is active+ </div>+ {selectionMode === 'lasso' ? (+ <Lasso+ nodes={graphData.nodes}+ graph2ScreenCoords={graph2ScreenCoords}+ partial={true}+ width={containerSize.width}+ height={containerSize.height}+ />+ ) : (+ <Rectangle+ nodes={graphData.nodes}+ graph2ScreenCoords={graph2ScreenCoords}+ partial={true}+ width={containerSize.width}+ height={containerSize.height}+ />+ )}</>)}{isRegeneratingLayout && (diff --git a/flowsint-app/src/components/graphs/index.tsx b/flowsint-app/src/components/graphs/index.tsxindex 54cf6a4b..72d4e3ad 100644--- a/flowsint-app/src/components/graphs/index.tsx+++ b/flowsint-app/src/components/graphs/index.tsx@@ -146,7 +146,6 @@ const GraphPanel = ({ graphData, isLoading }: GraphPanelProps) => {<Settings /><KeyboardShortcuts /></div>-)}diff --git a/flowsint-app/src/components/graphs/lasso.tsx b/flowsint-app/src/components/graphs/selectors/lasso.tsxsimilarity index 98%rename from flowsint-app/src/components/graphs/lasso.tsxrename to flowsint-app/src/components/graphs/selectors/lasso.tsxindex 016ee134..d4c2a167 100644--- a/flowsint-app/src/components/graphs/lasso.tsx+++ b/flowsint-app/src/components/graphs/selectors/lasso.tsx@@ -1,7 +1,7 @@import { memo, useRef, type PointerEvent } from 'react'import { useGraphStore } from '@/stores/graph-store'import { GraphNode } from '@/types'-import { GRAPH_COLORS } from './graph-viewer'+import { GRAPH_COLORS } from '../graph-viewer'type NodePoints = ([number, number] | [number, number, number])[]type NodePointObject = Record<string, NodePoints>diff --git a/flowsint-app/src/components/graphs/selectors/rectangle.tsx b/flowsint-app/src/components/graphs/selectors/rectangle.tsxnew file mode 100644index 00000000..436ad80c--- /dev/null+++ b/flowsint-app/src/components/graphs/selectors/rectangle.tsx@@ -0,0 +1,147 @@+import { memo, useRef, type PointerEvent } from 'react'+import { useGraphStore } from '@/stores/graph-store'+import { GraphNode } from '@/types'+import { GRAPH_COLORS } from '../graph-viewer'++type NodePoints = ([number, number] | [number, number, number])[]+type NodePointObject = Record<string, NodePoints>++// Coordonnées relatives au canvas (évite le décalage)+function getRelativeCoordinates(+ e: PointerEvent,+ canvas: HTMLCanvasElement | null+): [number, number] {+ const rect = canvas?.getBoundingClientRect()+ if (!rect) return [0, 0]+ return [e.clientX - rect.left, e.clientY - rect.top]+}++export function Rectangle({+ partial,+ width,+ height,+ graph2ScreenCoords,+ nodes+}: {+ partial: boolean+ width: number+ height: number+ graph2ScreenCoords: (node: GraphNode) => { x: number; y: number }+ nodes: GraphNode[]+}) {+ const setSelectedNodes = useGraphStore((s) => s.setSelectedNodes)+ const selectedNodes = useGraphStore((s) => s.selectedNodes)+ const setCurrentNode = useGraphStore((s) => s.setCurrentNode)+ const canvasRef = useRef<HTMLCanvasElement>(null)+ const ctxRef = useRef<CanvasRenderingContext2D | null>(null)+ const startPointRef = useRef<[number, number] | null>(null)+ const nodePointsRef = useRef<NodePointObject>({})+ const lastSelectedIds = useRef<Set<string>>(new Set())++ function handlePointerDown(e: PointerEvent) {+ const canvas = canvasRef.current+ if (!canvas) return++ canvas.setPointerCapture(e.pointerId)+ startPointRef.current = getRelativeCoordinates(e, canvas)++ nodePointsRef.current = {}+ for (const node of nodes) {+ const { x, y } = graph2ScreenCoords(node)+ const w = 4,+ h = 4+ nodePointsRef.current[node.id] = [+ [x, y],+ [x + w, y],+ [x + w, y + h],+ [x, y + h]+ ]+ }++ const ctx = canvas.getContext('2d')+ if (!ctx) return++ ctxRef.current = ctx+ ctx.lineWidth = 1.5+ ctx.fillStyle = `${GRAPH_COLORS.LASSO_FILL}`+ ctx.strokeStyle = GRAPH_COLORS.LASSO_STROKE+ ctx.setLineDash([5, 5]) // Dashed pattern: 5px dash, 5px gap+ }++ function handlePointerMove(e: PointerEvent) {+ if (e.buttons !== 1) return++ const canvas = canvasRef.current+ const ctx = ctxRef.current+ const startPoint = startPointRef.current+ if (!canvas || !ctx || !startPoint) return++ const currentPoint = getRelativeCoordinates(e, canvas)++ // Calculer les coordonnées du rectangle+ const x = Math.min(startPoint[0], currentPoint[0])+ const y = Math.min(startPoint[1], currentPoint[1])+ const rectWidth = Math.abs(currentPoint[0] - startPoint[0])+ const rectHeight = Math.abs(currentPoint[1] - startPoint[1])++ // Dessiner le rectangle+ ctx.clearRect(0, 0, width, height)+ const path = new Path2D()+ path.rect(x, y, rectWidth, rectHeight)+ ctx.fill(path)+ ctx.stroke(path)++ const localSelectedNodes: GraphNode[] = []++ for (const [nodeId, points] of Object.entries(nodePointsRef.current)) {+ const node = nodes.find((n) => n.id === nodeId)+ if (!node) continue++ const isSelected = partial+ ? points.some(([px, py]) => ctx.isPointInPath(path, px, py))+ : points.every(([px, py]) => ctx.isPointInPath(path, px, py))++ if (isSelected) {+ localSelectedNodes.push(node)+ }+ }+ const newIds = new Set(localSelectedNodes.map((n) => n.id))+ const oldIds = lastSelectedIds.current++ let changed = newIds.size !== oldIds.size+ if (!changed) {+ for (const id of newIds) {+ if (!oldIds.has(id)) {+ changed = true+ break+ }+ }+ }++ if (changed) {+ lastSelectedIds.current = newIds+ setSelectedNodes(localSelectedNodes)+ }+ }++ function handlePointerUp(e: PointerEvent) {+ canvasRef.current?.releasePointerCapture(e.pointerId)+ startPointRef.current = null+ if (selectedNodes.length === 1) setCurrentNode(selectedNodes[0])+ ctxRef.current?.clearRect(0, 0, width, height)+ }++ return (+ <canvas+ ref={canvasRef}+ width={width}+ height={height}+ className="tool-overlay"+ onPointerDown={handlePointerDown}+ onPointerMove={handlePointerMove}+ onPointerUp={handlePointerUp}+ />+ )+}++export default memo(Rectangle)diff --git a/flowsint-app/src/components/graphs/toolbar.tsx b/flowsint-app/src/components/graphs/toolbar.tsxindex cdd38366..b9da3319 100644--- a/flowsint-app/src/components/graphs/toolbar.tsx+++ b/flowsint-app/src/components/graphs/toolbar.tsx@@ -14,7 +14,10 @@ import {Merge,Minus,RotateCw,- ZoomIn+ ZoomIn,+ RectangleHorizontal,+ ChevronDown,+ SquareDashed} from 'lucide-react'import { memo, useCallback } from 'react'import { toast } from 'sonner'@@ -24,6 +27,12 @@ import { Separator } from '../ui/separator'import { ViewToggle } from './view-toggle'import { NetworkIcon } from '../icons/network'import { useKeyboard } from '@/hooks/use-keyboard'+import {+ DropdownMenu,+ DropdownMenuContent,+ DropdownMenuItem,+ DropdownMenuTrigger,+} from '@/components/ui/dropdown-menu'// Tooltip wrapper component to avoid repetitionexport const ToolbarButton = memo(function ToolbarButton({@@ -81,8 +90,10 @@ export const Toolbar = memo(function Toolbar({ isLoading }: { isLoading: booleanconst zoomOut = useGraphControls((s) => s.zoomOut)const regenerateLayout = useGraphControls((s) => s.regenerateLayout)const refetchGraph = useGraphControls((s) => s.refetchGraph)- const isLassoActive = useGraphControls((s) => s.isLassoActive)- const setIsLassoActive = useGraphControls((s) => s.setIsLassoActive)+ const isSelectorModeActive = useGraphControls((s) => s.isSelectorModeActive)+ const setIsSelectorModeActive = useGraphControls((s) => s.setIsSelectorModeActive)+ const selectionMode = useGraphControls((s) => s.selectionMode)+ const setSelectionMode = useGraphControls((s) => s.setSelectionMode)const selectedNodes = useGraphStore((s) => s.selectedNodes)const setOpenAddRelationDialog = useGraphStore((state) => state.setOpenAddRelationDialog)const setOpenMergeDialog = useGraphStore((state) => state.setOpenMergeDialog)@@ -91,8 +102,8 @@ export const Toolbar = memo(function Toolbar({ isLoading }: { isLoading: booleanuseKeyboard("s",- () => setIsLassoActive(true),- () => setIsLassoActive(false),+ () => setIsSelectorModeActive(true),+ () => setIsSelectorModeActive(false),);const handleRefresh = useCallback(() => {@@ -147,9 +158,16 @@ export const Toolbar = memo(function Toolbar({ isLoading }: { isLoading: booleansetOpenMergeDialog(true)}, [setOpenMergeDialog])- const handleLassoSelect = useCallback(() => {- setIsLassoActive(!isLassoActive)- }, [setIsLassoActive, isLassoActive])+ const handleToggleSelector = useCallback(() => {+ setIsSelectorModeActive(!isSelectorModeActive)+ }, [setIsSelectorModeActive, isSelectorModeActive])++ const handleSelectMode = useCallback((mode: 'lasso' | 'rectangle') => {+ setSelectionMode(mode)+ if (!isSelectorModeActive) {+ setIsSelectorModeActive(true)+ }+ }, [setSelectionMode, isSelectorModeActive, setIsSelectorModeActive])const areExactlyTwoSelected = selectedNodes.length === 2const areMergeable =@@ -184,30 +202,89 @@ export const Toolbar = memo(function Toolbar({ isLoading }: { isLoading: booleanicon={<ZoomIn className="h-4 w-4 opacity-70" />}tooltip="Zoom In"onClick={zoomIn}- disabled={view !== 'graph' || isLassoActive}+ disabled={view !== 'graph' || isSelectorModeActive}/><ToolbarButtonicon={<Minus className="h-4 w-4 opacity-70" />}tooltip="Zoom Out"onClick={zoomOut}- disabled={view !== 'graph' || isLassoActive}+ disabled={view !== 'graph' || isSelectorModeActive}/><ToolbarButtonicon={<Maximize className="h-4 w-4 opacity-70" />}tooltip="Fit to View"onClick={zoomToFit}- disabled={view !== 'graph' || isLassoActive}+ disabled={view !== 'graph' || isSelectorModeActive}/></div><Separator decorative orientation="vertical" />- <div className='flex gap-1'>- <ToolbarButton- icon={<LassoSelect className="h-4 w-4 opacity-70" />}- tooltip={'Lasso select (hold S)'}- onClick={handleLassoSelect}- toggled={isLassoActive}- disabled={view !== 'graph'}- />+ <div className='flex gap-0.5'>+ <Tooltip>+ <TooltipTrigger asChild>+ <Button+ variant="ghost"+ size="icon"+ onClick={handleToggleSelector}+ disabled={view !== 'graph'}+ className={cn(+ 'h-7 w-7 rounded relative items-center shadow-none',+ isSelectorModeActive &&+ 'bg-primary/30 border-primary/40 text-primary hover:bg-primary/40 hover:text-primary'+ )}+ >+ {selectionMode === 'lasso' ? (+ <LassoSelect className="h-4 w-4 opacity-70" />+ ) : (+ <SquareDashed className="h-4 w-4 opacity-70" />+ )}+ </Button>+ </TooltipTrigger>+ <TooltipContent>Select (hold S)</TooltipContent>+ </Tooltip>+ <div>+ <DropdownMenu>+ <DropdownMenuTrigger asChild>+ <div>+ <Tooltip>+ <TooltipTrigger asChild>+ <Button+ variant="ghost"+ size="icon"+ disabled={view !== 'graph'}+ className={cn(+ 'h-7 w-5 px-0 rounded relative items-center shadow-none',+ isSelectorModeActive &&+ 'bg-primary/30 border-primary/40 text-primary hover:bg-primary/40 hover:text-primary'+ )}+ >+ <ChevronDown className="h-3 w-3 opacity-50" />+ </Button>+ </TooltipTrigger>+ <TooltipContent>Selection mode</TooltipContent>+ </Tooltip>+ </div>+ </DropdownMenuTrigger>+ <DropdownMenuContent align="start" className="min-w-[140px]">+ <DropdownMenuItem+ onClick={() => handleSelectMode('lasso')}+ className={cn(selectionMode === 'lasso' && 'bg-accent')}+ >+ <LassoSelect className="h-4 w-4 mr-2" />+ Lasso+ </DropdownMenuItem>+ <DropdownMenuItem+ onClick={() => handleSelectMode('rectangle')}+ className={cn(selectionMode === 'rectangle' && 'bg-accent')}+ >+ <SquareDashed className="h-4 w-4 mr-2" />+ Rectangle+ </DropdownMenuItem>+ </DropdownMenuContent>+ </DropdownMenu>+ </div>+ </div>+ <Separator orientation="vertical" />+ <div><Filters><ToolbarButtondisabled={isLoading}diff --git a/flowsint-app/src/components/layout/root.layout.tsx b/flowsint-app/src/components/layout/root.layout.tsxindex 2533e0cc..82b5d946 100644--- a/flowsint-app/src/components/layout/root.layout.tsx+++ b/flowsint-app/src/components/layout/root.layout.tsx@@ -97,11 +97,11 @@ export default function RootLayout({ children }: LayoutProps) {{hasNode && hasEdge ? (// Both node and edge: show both in a vertical split<ResizablePanelGroup direction="vertical" className="h-full">- <ResizablePanel defaultSize={50} minSize={30}>+ <ResizablePanel defaultSize={70} minSize={30}><DetailsPanel node={currentNode} /></ResizablePanel><ResizableHandle withHandle />- <ResizablePanel defaultSize={50} minSize={30}>+ <ResizablePanel defaultSize={30} minSize={20}><EdgeDetailsPanel edge={currentEdge} /></ResizablePanel></ResizablePanelGroup>diff --git a/flowsint-app/src/stores/graph-controls-store.ts b/flowsint-app/src/stores/graph-controls-store.tsindex e2a60c18..20e6b144 100644--- a/flowsint-app/src/stores/graph-controls-store.ts+++ b/flowsint-app/src/stores/graph-controls-store.ts@@ -3,10 +3,12 @@ import { persist } from 'zustand/middleware'type ViewType = 'graph' | 'table' | 'map' | 'relationships'type LayoutType = 'force' | 'hierarchy'+type SelectionMode = 'lasso' | 'rectangle'type GraphControlsStore = {view: ViewType- isLassoActive: boolean+ isSelectorModeActive: boolean+ selectionMode: SelectionModecurrentLayoutType: LayoutTypezoomToFit: () => voidzoomIn: () => void@@ -17,14 +19,16 @@ type GraphControlsStore = {regenerateLayout: (layoutType: LayoutType) => voidsetCurrentLayoutType: (layoutType: LayoutType) => voidsetView: (view: 'graph' | 'table' | 'map' | 'relationships') => void- setIsLassoActive: (active: boolean) => void+ setIsSelectorModeActive: (active: boolean) => void+ setSelectionMode: (mode: SelectionMode) => void}export const useGraphControls = create<GraphControlsStore>()(persist((set) => ({view: 'graph',- isLassoActive: false,+ isSelectorModeActive: false,+ selectionMode: 'lasso',currentLayoutType: 'force',zoomToFit: () => { },zoomIn: () => { },@@ -35,13 +39,15 @@ export const useGraphControls = create<GraphControlsStore>()(regenerateLayout: () => { },setCurrentLayoutType: (layoutType) => set({ currentLayoutType: layoutType }),setView: (view) => set({ view }),- setIsLassoActive: (active) => set({ isLassoActive: active })+ setIsSelectorModeActive: (active) => set({ isSelectorModeActive: active }),+ setSelectionMode: (mode) => set({ selectionMode: mode })}),{name: 'graph-controls-storage',partialize: (state) => ({view: state.view,- currentLayoutType: state.currentLayoutType+ currentLayoutType: state.currentLayoutType,+ selectionMode: state.selectionMode})})