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

ephraimanierobi pushed a commit to branch v3-1-test
in repository https://gitbox.apache.org/repos/asf/airflow.git

commit 6a3432a4dc40fa5472638b2dc88c5342b949c6e7
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Tue Dec 9 15:30:29 2025 +0100

    [v3-1-test] Fix links for DurationChart (#59095) (#59237)
    
    * Fix links for DurationChart
    
    * Address PR comments
    (cherry picked from commit 7218cf045812a5a7135d7f119cdde0aed817b132)
    
    Co-authored-by: Pierre Jeambrun <[email protected]>
---
 .../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