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 7218cf04581 Fix links for DurationChart (#59095)
7218cf04581 is described below

commit 7218cf045812a5a7135d7f119cdde0aed817b132
Author: Pierre Jeambrun <[email protected]>
AuthorDate: Tue Dec 9 13:23:44 2025 +0100

    Fix links for DurationChart (#59095)
    
    * Fix links for DurationChart
    
    * Address PR comments
---
 .../src/airflow/ui/src/components/DurationChart.tsx     | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/airflow-core/src/airflow/ui/src/components/DurationChart.tsx 
b/airflow-core/src/airflow/ui/src/components/DurationChart.tsx
index c1dad57abc9..4c440288eef 100644
--- a/airflow-core/src/airflow/ui/src/components/DurationChart.tsx
+++ b/airflow-core/src/airflow/ui/src/components/DurationChart.tsx
@@ -37,6 +37,7 @@ import { useNavigate } from "react-router-dom";
 import type { TaskInstanceResponse, GridRunsResponse } from 
"openapi/requests/types.gen";
 import { getComputedCSSVariableValue } from "src/theme";
 import { DEFAULT_DATETIME_FORMAT, renderDuration } from 
"src/utils/datetimeUtils";
+import { buildTaskInstanceUrl } from "src/utils/links";
 
 ChartJS.register(
   CategoryScale,
@@ -191,9 +192,21 @@ export const DurationChart = ({
               }
               case "Task Instance": {
                 const entry = entries[element.index] as TaskInstanceResponse | 
undefined;
-                const baseUrl = 
`/dags/${entry?.dag_id}/runs/${entry?.dag_run_id}`;
 
-                navigate(`${baseUrl}/tasks/${entry?.task_id}`);
+                if (entry === undefined) {
+                  break;
+                }
+
+                const baseUrl = buildTaskInstanceUrl({
+                  currentPathname: location.pathname,
+                  dagId: entry.dag_id,
+                  isMapped: entry.map_index >= 0,
+                  mapIndex: entry.map_index.toString(),
+                  runId: entry.dag_run_id,
+                  taskId: entry.task_id,
+                });
+
+                navigate(baseUrl);
                 break;
               }
               default:

Reply via email to