Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion frontend/src/features/territory/agent-node.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ export function AgentNode({ data }: NodeProps<AgentNodeType>) {
alignItems: 'center',
cursor: clickable ? 'pointer' : 'default',
}}
onClick={clickable ? () => data.onSelect!(data.wolfId!) : undefined}
// The click is handled by ReactFlow's onNodeClick (graph-canvas) — a per-node onClick here
// would double-fire and toggle the selection straight back off.
title={label ? label.label : data.role}
>
<div style={{ width: SIZE, height: SIZE, position: 'relative' }}>
Expand Down
19 changes: 16 additions & 3 deletions frontend/src/features/territory/graph-canvas.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ export function buildGraph(
role, wolfId: id, tone: wolfTone(wolves?.[id]), live: wolves?.[id],
selected: selection?.selectedId === id, onSelect: selection?.onSelect,
},
selectable: false,
// Only a live wolf is inspectable — an empty formation slot stays inert.
selectable: !!wolves?.[id],
draggable: false,
...(TRANSIENT_HEALER_ROLES.has(role) ? { className: 'warden-roam' } : {}),
}
Expand Down Expand Up @@ -172,7 +173,7 @@ export function buildGraph(
role: w.role, wolfId: wid, tone: wolfTone(w), live: w,
selected: selection?.selectedId === wid, onSelect: selection?.onSelect,
},
selectable: false,
selectable: true,
draggable: false,
className: 'warden-roam',
})
Expand Down Expand Up @@ -258,6 +259,11 @@ export function GraphCanvas({ huntState }: GraphCanvasProps) {
}
.glyph-done-pop { animation: glyph-done-pop 450ms cubic-bezier(0.34, 1.56, 0.64, 1) 150ms both; }

/* Suppress React Flow's default selection outline — our own halo marks the inspected wolf. */
.react-flow__node.selected, .react-flow__node:focus, .react-flow__node:focus-visible {
outline: none !important; box-shadow: none !important;
}

/* Selected wolf's halo breathes softly so it stays obvious. */
@keyframes node-selected {
0%, 100% { opacity: 0.55; }
Expand All @@ -284,10 +290,17 @@ export function GraphCanvas({ huntState }: GraphCanvasProps) {
panOnScroll
zoomOnScroll={false}
zoomOnDoubleClick={false}
elementsSelectable={false}
// Nodes stay selectable so a click registers (elementsSelectable=false sets
// pointer-events:none and swallows it); the default selection outline is hidden in CSS,
// our own halo marks the inspected wolf.
elementsSelectable
nodesDraggable={false}
proOptions={{ hideAttribution: true }}
colorMode="light"
onNodeClick={(_e, node) => {
const d = node.data as AgentNodeData
if (d.wolfId && d.live) onSelect(d.wolfId)
}}
onPaneClick={() => setSelectedId(null)}
/>
</div>
Expand Down
Loading