Skip to content

Commit 5237caa

Browse files
committed
cockpit: fix overlay clicks — search focus + readout close
Both bugs had one root cause: the vis-network canvas was swallowing pointer events over the overlays, so the search input never focused (no cursor / no typing) and the readout ✕ never closed. Node clicks still worked because they hit the canvas directly. Fix: give the canvas container its OWN stacking context (zIndex:0, trapping whatever z-index vis-network assigns its canvas internally) and lift the overlays above it (zIndex:10 + pointerEvents:auto on the search panel and the readout). The ✕ also gets a slightly larger hit target. Node clicks still land — the canvas keeps every region the overlays don't cover.
1 parent 19af902 commit 5237caa

1 file changed

Lines changed: 16 additions & 2 deletions

File tree

cockpit/src/OsintGraph.tsx

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,8 @@ function ReasonBox({ readout, onClose }: { readout: Readout; onClose: () => void
205205
bottom: 56,
206206
width: 400,
207207
maxHeight: '46%',
208+
zIndex: 10,
209+
pointerEvents: 'auto',
208210
display: 'flex',
209211
flexDirection: 'column',
210212
fontFamily: 'monospace',
@@ -221,7 +223,11 @@ function ReasonBox({ readout, onClose }: { readout: Readout; onClose: () => void
221223
<span style={{ color: '#7fd1ff' }}>
222224
{head} · {readout.seed}
223225
</span>
224-
<span onClick={onClose} style={{ cursor: 'pointer', color: '#6f87a0' }}>
226+
<span
227+
onClick={onClose}
228+
title="close"
229+
style={{ cursor: 'pointer', color: '#9fb4c8', padding: '0 4px', fontSize: 13 }}
230+
>
225231
226232
</span>
227233
</div>
@@ -655,14 +661,18 @@ export function OsintGraph() {
655661

656662
return (
657663
<div style={{ position: 'relative', width: '100%', height: '100vh', background: PAGE_BG, overflow: 'hidden' }}>
658-
<div ref={hostRef} style={{ position: 'absolute', inset: 0 }} />
664+
{/* zIndex:0 traps the vis-network canvas in its OWN stacking context, so
665+
the overlays (zIndex:10) reliably win pointer events — otherwise the
666+
canvas swallowed clicks on the search box (no focus) and the ✕. */}
667+
<div ref={hostRef} style={{ position: 'absolute', inset: 0, zIndex: 0 }} />
659668

660669
{/* title + status */}
661670
<div
662671
style={{
663672
position: 'absolute',
664673
top: 16,
665674
left: 16,
675+
zIndex: 10,
666676
fontFamily: 'monospace',
667677
color: '#93a9bf',
668678
fontSize: 12,
@@ -681,6 +691,8 @@ export function OsintGraph() {
681691
top: 58,
682692
left: 16,
683693
width: 320,
694+
zIndex: 10,
695+
pointerEvents: 'auto',
684696
fontFamily: 'monospace',
685697
display: 'flex',
686698
flexDirection: 'column',
@@ -761,6 +773,7 @@ export function OsintGraph() {
761773
position: 'absolute',
762774
bottom: 16,
763775
left: 16,
776+
zIndex: 10,
764777
fontFamily: 'monospace',
765778
fontSize: 11,
766779
color: '#93a9bf',
@@ -793,6 +806,7 @@ export function OsintGraph() {
793806
position: 'absolute',
794807
top: 14,
795808
right: 16,
809+
zIndex: 10,
796810
fontFamily: 'monospace',
797811
fontSize: 12,
798812
color: '#cfe7ff',

0 commit comments

Comments
 (0)