diff --git a/js_modules/dagster-ui/packages/ui-core/src/asset-graph/AssetGraphExplorerSidebar.tsx b/js_modules/dagster-ui/packages/ui-core/src/asset-graph/AssetGraphExplorerSidebar.tsx index 52fa3d7b1c7b7..f2fc740322693 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/asset-graph/AssetGraphExplorerSidebar.tsx +++ b/js_modules/dagster-ui/packages/ui-core/src/asset-graph/AssetGraphExplorerSidebar.tsx @@ -225,7 +225,9 @@ export const AssetGraphExplorerSidebar = React.memo( nextOpenNodes.add(locationName); nextOpenNodes.add(locationName + ':' + groupName); } - setSelectedNode({id: lastSelectedNode.id}); + if (selectedNode?.id !== lastSelectedNode.id) { + setSelectedNode({id: lastSelectedNode.id}); + } return nextOpenNodes; } let path = lastSelectedNode.id; @@ -249,10 +251,15 @@ export const AssetGraphExplorerSidebar = React.memo( currentPath = `${currentPath}:${nodesInPath[i]}`; nextOpenNodes.add(currentPath); } - setSelectedNode({id: lastSelectedNode.id, path: currentPath}); + if (selectedNode?.id !== lastSelectedNode.id) { + setSelectedNode({id: lastSelectedNode.id, path: currentPath}); + } return nextOpenNodes; }); + } else { + setSelectedNode(null); } + // eslint-disable-next-line react-hooks/exhaustive-deps }, [ lastSelectedNode, assetGraphData, @@ -430,8 +437,7 @@ const Node = ({ const downstream = Object.keys(assetGraphData.downstream[node.id] ?? {}); const elementRef = React.useRef(null); - const [showDownstreamDialog, setShowDownstreamDialog] = React.useState(false); - const [showUpstreamDialog, setShowUpstreamDialog] = React.useState(false); + const [showParents, setShowParents] = React.useState(false); function showDownstreamGraph() { const path = JSON.parse(node.id); @@ -469,22 +475,11 @@ const Node = ({ <> {launchpadElement} { - setShowDownstreamDialog(false); - }} - selectNode={(e, id) => { - selectNode(e, id); - }} - /> - { - setShowUpstreamDialog(false); + setShowParents(false); }} selectNode={selectNode} /> @@ -562,6 +557,15 @@ const Node = ({ }} /> {upstream.length || downstream.length ? : null} + {upstream.length > 1 ? ( + { + setShowParents(true); + }} + /> + ) : null} {upstream.length ? (