This is an automated email from the ASF dual-hosted git repository. kaxilnaik pushed a commit to branch v3-0-test in repository https://gitbox.apache.org/repos/asf/airflow.git
commit 8490b2c3ca311aa86e6ee82a94e93efa977da950 Author: Brent Bovenzi <[email protected]> AuthorDate: Thu May 1 18:32:17 2025 -0400 Fix node selections (#50095) (cherry picked from commit 4ece2df42edaa0dd3dd106be3c18b82ffbff3632) --- airflow-core/src/airflow/ui/src/components/Graph/DagNode.tsx | 3 ++- airflow-core/src/airflow/ui/src/components/Graph/DefaultNode.tsx | 1 + airflow-core/src/airflow/ui/src/layouts/Details/Graph/Graph.tsx | 2 +- airflow-core/src/airflow/ui/src/pages/Asset/AssetGraph.tsx | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/airflow-core/src/airflow/ui/src/components/Graph/DagNode.tsx b/airflow-core/src/airflow/ui/src/components/Graph/DagNode.tsx index 1b53b4f0359..3cd9e100a4c 100644 --- a/airflow-core/src/airflow/ui/src/components/Graph/DagNode.tsx +++ b/airflow-core/src/airflow/ui/src/components/Graph/DagNode.tsx @@ -36,13 +36,14 @@ export const DagNode = ({ <NodeWrapper> <Flex bg={isOpen ? "bg.muted" : "bg"} + borderColor={isSelected ? "border.inverted" : "border"} borderRadius={5} borderWidth={isSelected ? 4 : 2} cursor="default" flexDirection="column" height={`${height}px`} px={3} - py={isSelected ? 0 : 1} + py={1} width={`${width}px`} > <HStack alignItems="center" justifyContent="space-between"> diff --git a/airflow-core/src/airflow/ui/src/components/Graph/DefaultNode.tsx b/airflow-core/src/airflow/ui/src/components/Graph/DefaultNode.tsx index d9e809d517a..5d3813c7d55 100644 --- a/airflow-core/src/airflow/ui/src/components/Graph/DefaultNode.tsx +++ b/airflow-core/src/airflow/ui/src/components/Graph/DefaultNode.tsx @@ -28,6 +28,7 @@ export const DefaultNode = ({ data: { height, label, width } }: NodeProps<NodeTy bg="bg" borderRadius={5} borderWidth={2} + cursor="auto" flexDirection="column" height={`${height}px`} p={2} diff --git a/airflow-core/src/airflow/ui/src/layouts/Details/Graph/Graph.tsx b/airflow-core/src/airflow/ui/src/layouts/Details/Graph/Graph.tsx index 12744c7d15f..89a11ad11a9 100644 --- a/airflow-core/src/airflow/ui/src/layouts/Details/Graph/Graph.tsx +++ b/airflow-core/src/airflow/ui/src/layouts/Details/Graph/Graph.tsx @@ -144,7 +144,7 @@ export const Graph = () => { ...node, data: { ...node.data, - isSelected: node.id === taskId, + isSelected: node.id === taskId || node.id === `dag:${dagId}`, taskInstance, }, }; diff --git a/airflow-core/src/airflow/ui/src/pages/Asset/AssetGraph.tsx b/airflow-core/src/airflow/ui/src/pages/Asset/AssetGraph.tsx index 42e1c39071f..94055eadcde 100644 --- a/airflow-core/src/airflow/ui/src/pages/Asset/AssetGraph.tsx +++ b/airflow-core/src/airflow/ui/src/pages/Asset/AssetGraph.tsx @@ -42,7 +42,7 @@ export const AssetGraph = ({ asset }: { readonly asset?: AssetResponse }) => { }); const nodes = graphData?.nodes.map((node) => - node.data.label === asset?.name ? { ...node, data: { ...node.data, isSelected: true } } : node, + node.id === `asset:${assetId}` ? { ...node, data: { ...node.data, isSelected: true } } : node, ); const [selectedDarkColor, selectedLightColor] = useToken("colors", ["gray.200", "gray.800"]);
