From a285c6a51f4b28c8456c080a5c5cc1f349594233 Mon Sep 17 00:00:00 2001 From: Shashwati Date: Sun, 7 Jun 2026 21:12:30 +0530 Subject: [PATCH] Fix Gantt tooltip showing wrong start date on queued/scheduled segments --- .../airflow/ui/src/layouts/Details/Gantt/GanttTimeline.tsx | 2 +- .../src/airflow/ui/src/layouts/Details/Gantt/utils.ts | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/airflow-core/src/airflow/ui/src/layouts/Details/Gantt/GanttTimeline.tsx b/airflow-core/src/airflow/ui/src/layouts/Details/Gantt/GanttTimeline.tsx index 42cc8b44f9567..43c28dba56b52 100644 --- a/airflow-core/src/airflow/ui/src/layouts/Details/Gantt/GanttTimeline.tsx +++ b/airflow-core/src/airflow/ui/src/layouts/Details/Gantt/GanttTimeline.tsx @@ -86,7 +86,7 @@ const toTooltipSummary = ( return { child_states: null, max_end_date: dayjs(segment.x[1]).toISOString(), - min_start_date: dayjs(segment.x[0]).toISOString(), + min_start_date: segment.start_when ?? dayjs(segment.x[0]).toISOString(), state: segment.state ?? null, task_display_name: segment.y, task_id: segment.taskId, diff --git a/airflow-core/src/airflow/ui/src/layouts/Details/Gantt/utils.ts b/airflow-core/src/airflow/ui/src/layouts/Details/Gantt/utils.ts index ff281092add2b..9502cd31e7843 100644 --- a/airflow-core/src/airflow/ui/src/layouts/Details/Gantt/utils.ts +++ b/airflow-core/src/airflow/ui/src/layouts/Details/Gantt/utils.ts @@ -33,6 +33,8 @@ export type GanttDataItem = { /** Source try times for tooltips (matches TaskInstance `*_when` fields). */ queued_when?: string | null; scheduled_when?: string | null; + /** Actual task execution start_date — consistent across all segments of the same try. */ + start_when?: string | null; state?: TaskInstanceState | null; taskId: string; tryNumber?: number; @@ -133,10 +135,11 @@ export const transformGanttData = ({ const queuedMs = queuedDttm === null ? undefined : dayjs(queuedDttm).valueOf(); const scheduledMs = scheduledDttm === null ? undefined : dayjs(scheduledDttm).valueOf(); - // Include scheduled/queued times in tooltip data whenever the timestamps exist. + // Include scheduled/queued/start times in tooltip data whenever the timestamps exist. const tryWhenForTooltip = { ...(scheduledMs === undefined ? {} : { scheduled_when: scheduledDttm }), ...(queuedMs === undefined ? {} : { queued_when: queuedDttm }), + ...(startDate === null ? {} : { start_when: startDate }), }; let endMs: number;