Skip to content

armgit / ARES

Public Imported from GitHub
0

ARES - authorized red-team engagement automation with dashboard, campaign scope, module orchestration, OPSEC controls, encrypted vault, and reporting.

fix(graph): eliminate hover flickering and click swallowing on pivot nodes

Mafifrizied6f6ef1a9ef
diff --git a/frontend/src/features/graph/CobaltStrikeNodes.tsx b/frontend/src/features/graph/CobaltStrikeNodes.tsx
index 9b4e7bf..8552eb7 100644
--- a/frontend/src/features/graph/CobaltStrikeNodes.tsx
+++ b/frontend/src/features/graph/CobaltStrikeNodes.tsx
@@ -96,10 +96,10 @@ export const PivotFirewallNode = memo(function PivotFirewallNode({ data, selecte
const nodeData = data as unknown as PivotNodeData;
return (
<div className={`cobalt-firewall-node${selected ? " selected" : ""}${nodeData.dimmed ? " dimmed opacity-30" : ""}`}>
- <Handle type="target" position={Position.Left} id="left-target" className="opacity-0" isConnectable={false} />
- <Handle type="source" position={Position.Left} id="left-source" className="opacity-0" isConnectable={false} />
- <Handle type="target" position={Position.Top} id="top-target" className="opacity-0" isConnectable={false} />
- <Handle type="source" position={Position.Top} id="top-source" className="opacity-0" isConnectable={false} />
+ <Handle type="target" position={Position.Left} id="left-target" className="opacity-0 pointer-events-none" isConnectable={false} />
+ <Handle type="source" position={Position.Left} id="left-source" className="opacity-0 pointer-events-none" isConnectable={false} />
+ <Handle type="target" position={Position.Top} id="top-target" className="opacity-0 pointer-events-none" isConnectable={false} />
+ <Handle type="source" position={Position.Top} id="top-source" className="opacity-0 pointer-events-none" isConnectable={false} />
<div className="cobalt-firewall-brick">
{/* Stylized Flames and Brickwork */}
@@ -136,10 +136,10 @@ export const PivotFirewallNode = memo(function PivotFirewallNode({ data, selecte
<span className="cobalt-node-subtext">{nodeData.subLabel || "Ingress / Egress"}</span>
</div>
- <Handle type="target" position={Position.Right} id="right-target" className="opacity-0" isConnectable={false} />
- <Handle type="source" position={Position.Right} id="right-source" className="opacity-0" isConnectable={false} />
- <Handle type="target" position={Position.Bottom} id="bottom-target" className="opacity-0" isConnectable={false} />
- <Handle type="source" position={Position.Bottom} id="bottom-source" className="opacity-0" isConnectable={false} />
+ <Handle type="target" position={Position.Right} id="right-target" className="opacity-0 pointer-events-none" isConnectable={false} />
+ <Handle type="source" position={Position.Right} id="right-source" className="opacity-0 pointer-events-none" isConnectable={false} />
+ <Handle type="target" position={Position.Bottom} id="bottom-target" className="opacity-0 pointer-events-none" isConnectable={false} />
+ <Handle type="source" position={Position.Bottom} id="bottom-source" className="opacity-0 pointer-events-none" isConnectable={false} />
</div>
);
});
@@ -191,10 +191,10 @@ export const PivotComputerNode = memo(function PivotComputerNode({ data, selecte
return (
<div className={`cobalt-node-wrapper ${auraClass}${selected ? " selected" : ""}${nodeData.dimmed ? " dimmed opacity-30" : ""}`}>
{/* Handles on all 4 directions for clean directional pivot routing */}
- <Handle type="target" position={Position.Left} id="left-target" className="opacity-0" isConnectable={false} />
- <Handle type="source" position={Position.Left} id="left-source" className="opacity-0" isConnectable={false} />
- <Handle type="target" position={Position.Top} id="top-target" className="opacity-0" isConnectable={false} />
- <Handle type="source" position={Position.Top} id="top-source" className="opacity-0" isConnectable={false} />
+ <Handle type="target" position={Position.Left} id="left-target" className="opacity-0 pointer-events-none" isConnectable={false} />
+ <Handle type="source" position={Position.Left} id="left-source" className="opacity-0 pointer-events-none" isConnectable={false} />
+ <Handle type="target" position={Position.Top} id="top-target" className="opacity-0 pointer-events-none" isConnectable={false} />
+ <Handle type="source" position={Position.Top} id="top-source" className="opacity-0 pointer-events-none" isConnectable={false} />
{/* Monitor Display Unit */}
<div className="cobalt-monitor-housing">
@@ -223,10 +223,10 @@ export const PivotComputerNode = memo(function PivotComputerNode({ data, selecte
)}
</div>
- <Handle type="target" position={Position.Right} id="right-target" className="opacity-0" isConnectable={false} />
- <Handle type="source" position={Position.Right} id="right-source" className="opacity-0" isConnectable={false} />
- <Handle type="target" position={Position.Bottom} id="bottom-target" className="opacity-0" isConnectable={false} />
- <Handle type="source" position={Position.Bottom} id="bottom-source" className="opacity-0" isConnectable={false} />
+ <Handle type="target" position={Position.Right} id="right-target" className="opacity-0 pointer-events-none" isConnectable={false} />
+ <Handle type="source" position={Position.Right} id="right-source" className="opacity-0 pointer-events-none" isConnectable={false} />
+ <Handle type="target" position={Position.Bottom} id="bottom-target" className="opacity-0 pointer-events-none" isConnectable={false} />
+ <Handle type="source" position={Position.Bottom} id="bottom-source" className="opacity-0 pointer-events-none" isConnectable={false} />
</div>
);
});
diff --git a/frontend/src/features/graph/GraphPage.tsx b/frontend/src/features/graph/GraphPage.tsx
index 08ddb2e..ee6d5db 100644
--- a/frontend/src/features/graph/GraphPage.tsx
+++ b/frontend/src/features/graph/GraphPage.tsx
@@ -246,6 +246,7 @@ function cobaltPivotLayout(
type: nodeType,
position: { x, y },
selected: isNodeSelected,
+ zIndex: isNodeSelected ? 30 : (hoverActive && isNodeHoverConnected ? 25 : 10),
data: {
label: node.label,
subLabel: inferred.subLabel,
@@ -332,11 +333,11 @@ function cobaltPivotLayout(
animated: true, // Flowing dash stream communicates directional movement instantly
className: `${edgeClass}${isDirectHovered ? " edge-hover-pulse" : ""}`,
label: undefined,
- zIndex: isDirectHovered ? 100 : (isHighlighted ? 50 : 1),
+ zIndex: isDirectHovered ? 5 : (isHighlighted ? 4 : 1),
markerEnd: {
type: MarkerType.ArrowClosed,
- width: 22,
- height: 22,
+ width: 20,
+ height: 20,
color: markerColor
},
style: {
@@ -466,8 +467,13 @@ function CobaltGraphInner({
fitViewOptions={{ padding: 0.14 }}
minZoom={0.25}
maxZoom={2.0}
- onNodeMouseEnter={(_event, node) => setHoveredNodeId(node.id)}
- onNodeMouseLeave={() => setHoveredNodeId(null)}
+ onPaneMouseEnter={() => setHoveredNodeId(null)}
+ onNodeMouseEnter={(_event, node) => {
+ setHoveredNodeId((curr) => (curr === node.id ? curr : node.id));
+ }}
+ onNodeMouseLeave={(_event, node) => {
+ setHoveredNodeId((curr) => (curr === node.id ? null : curr));
+ }}
onNodeClick={(_event, node) => {
const selectedNode = nodeById.get(node.id);
if (selectedNode) onSelect({ kind: "node", value: selectedNode });
diff --git a/frontend/src/features/graph/graphCobalt.css b/frontend/src/features/graph/graphCobalt.css
index 92f420f..c72bbba 100644
--- a/frontend/src/features/graph/graphCobalt.css
+++ b/frontend/src/features/graph/graphCobalt.css
@@ -280,7 +280,8 @@
.cobalt-node-wrapper,
.cobalt-firewall-node {
- transition: opacity 0.25s ease, transform 0.2s ease, filter 0.25s ease;
+ transition: opacity 0.18s ease, filter 0.18s ease;
+ pointer-events: auto;
}
.cobalt-node-wrapper.dimmed,
@@ -290,8 +291,8 @@
}
.cobalt-node-wrapper:hover .cobalt-monitor-housing {
- transform: translateY(-2px);
- box-shadow: 0 0 14px rgba(0, 212, 255, 0.45);
+ box-shadow: 0 0 16px rgba(0, 212, 255, 0.65), inset 0 0 4px rgba(0, 212, 255, 0.3);
+ border-color: #38bdf8;
}
/* Halo & Aura Variations (Pure Crisp Vectors, No Blurry AI-Slop Glows) */
@@ -456,7 +457,12 @@
/* ── Directed Edge Styling (Curved Bezier Paths & Directional Flow) ──────── */
.cobalt-canvas-area .react-flow__edge-path {
stroke-linecap: round;
- transition: stroke-width 0.2s ease, opacity 0.2s ease, filter 0.2s ease;
+ transition: opacity 0.15s ease;
+}
+
+.cobalt-canvas-area .react-flow__edge marker,
+.cobalt-canvas-area marker {
+ pointer-events: none !important;
}
.cobalt-canvas-area .cobalt-edge-smb .react-flow__edge-path,