This is an automated email from the ASF dual-hosted git repository.

pierrejeambrun pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new d2377a9bed1 fix(ui): only apply elk.portConstraints for LR orientation 
in graph view (#62144)
d2377a9bed1 is described below

commit d2377a9bed131adfaa9c08f16d68f5162518fda3
Author: Michael Silvestre <[email protected]>
AuthorDate: Thu Feb 19 19:01:56 2026 +0100

    fix(ui): only apply elk.portConstraints for LR orientation in graph view 
(#62144)
    
    The `elk.portConstraints: "FIXED_SIDE"` layout option breaks ELK.js
    layout for non-LR orientations (TB, BT, RL) when TaskGroups are present,
    causing nodes to spread horizontally and overlap. This is a regression
    introduced between 3.0.6 and 3.1.x.
    
    Conditionally apply the constraint only for RIGHT (LR) direction,
    restoring correct layout behavior for all orientations.
    
    Closes: #61384
---
 airflow-core/src/airflow/ui/src/components/Graph/useGraphLayout.ts | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/airflow-core/src/airflow/ui/src/components/Graph/useGraphLayout.ts 
b/airflow-core/src/airflow/ui/src/components/Graph/useGraphLayout.ts
index 31fbff3e394..83b415ad141 100644
--- a/airflow-core/src/airflow/ui/src/components/Graph/useGraphLayout.ts
+++ b/airflow-core/src/airflow/ui/src/components/Graph/useGraphLayout.ts
@@ -164,7 +164,7 @@ const generateElkGraph = ({
         label: node.label,
         layoutOptions: {
           "elk.padding": "[top=80,left=15,bottom=15,right=15]",
-          "elk.portConstraints": "FIXED_SIDE",
+          ...(direction === "RIGHT" ? { "elk.portConstraints": "FIXED_SIDE" } 
: {}),
         },
       };
     }
@@ -216,7 +216,7 @@ const generateElkGraph = ({
       isGroup: Boolean(node.children),
       isMapped: node.is_mapped === null ? undefined : node.is_mapped,
       label: node.label,
-      layoutOptions: { "elk.portConstraints": "FIXED_SIDE" },
+      layoutOptions: direction === "RIGHT" ? { "elk.portConstraints": 
"FIXED_SIDE" } : undefined,
       operator: node.operator,
       setupTeardownType: node.setup_teardown_type,
       type: node.type,

Reply via email to