Skip to content

Commit c1ea989

Browse files
gvelez17claude
andcommitted
Fix node click handlers to pass full data with aliases
- Ctrl/Cmd+click now passes full cytoscape node data (with aliases, isMerged) - Right-click also passes full node data - Added Shift+click to navigate to Add Claim / Validate page This enables the aliases section in the detail modal to show linked identities for merged SAME_AS nodes. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent c91ca75 commit c1ea989

File tree

1 file changed

+22
-9
lines changed

1 file changed

+22
-9
lines changed

src/containers/Explore/index.tsx

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -232,18 +232,30 @@ const Explore = (homeProps: IHomeProps) => {
232232
const originalEvent = event.originalEvent
233233
event.preventDefault()
234234
if (originalEvent) {
235-
const nodeData = event.target.data('raw')
236-
const nodeId = event.target.data('id')
237-
238-
if (nodeData && nodeId) {
239-
// Check if ctrl key or cmd key (Mac) is pressed
235+
// Get full cytoscape node data (includes aliases, isMerged, etc.)
236+
const fullNodeData = event.target.data()
237+
const nodeId = fullNodeData?.id
238+
239+
if (fullNodeData && nodeId) {
240+
// Shift+click: navigate to Add Claim page
241+
if (originalEvent.shiftKey) {
242+
const nodeUri = fullNodeData.nodeUri || fullNodeData.uri || ''
243+
const nodeName = fullNodeData.label || fullNodeData.name || ''
244+
const isClaimNode = fullNodeData.entType === 'CLAIM' || fullNodeData.entityType === 'CLAIM'
245+
if (isClaimNode) {
246+
window.location.href = `/validate?subject=${encodeURIComponent(nodeUri)}`
247+
} else {
248+
window.location.href = `/claim?subject=${encodeURIComponent(nodeUri)}&name=${encodeURIComponent(nodeName)}`
249+
}
250+
return
251+
}
252+
// Ctrl/Cmd+click: Show node details modal
240253
if (originalEvent.ctrlKey || originalEvent.metaKey) {
241-
// Show node details modal on ctrl/cmd+click
242-
setModalData(nodeData)
254+
setModalData(fullNodeData)
243255
setModalType('node')
244256
setModalOpen(true)
245257
} else {
246-
// Expand the graph on regular left click
258+
// Regular left click: Expand the graph
247259
fetchRelatedClaims(nodeId, page.current)
248260
}
249261
}
@@ -281,7 +293,8 @@ const Explore = (homeProps: IHomeProps) => {
281293
event.preventDefault()
282294
event.stopPropagation()
283295
const element = event.target
284-
const data = element.data('raw')
296+
// Get full cytoscape data (includes aliases, isMerged for merged nodes)
297+
const data = element.data()
285298

286299
if (element.isNode() && data) {
287300
// Show node details modal on right-click

0 commit comments

Comments
 (0)