Aaryan123456679 commented on code in PR #68570:
URL: https://github.com/apache/airflow/pull/68570#discussion_r3476675844


##########
airflow-core/src/airflow/ui/src/layouts/Details/Gantt/utils.ts:
##########
@@ -152,6 +147,17 @@ export const transformGanttData = ({
               endMs = dayjs(endDate).valueOf();
             }
 
+            // Include scheduled/queued/start/end times in tooltip data 
whenever the timestamps exist.
+            // start_when/end_when are carried on every segment of a try so 
the tooltip reports the
+            // task's actual start and end on the scheduled and queued bars 
too, not just the
+            // execution bar's own bounds.
+            const tryWhenForTooltip = {
+              ...(scheduledMs === undefined ? {} : { scheduled_when: 
scheduledDttm }),
+              ...(queuedMs === undefined ? {} : { queued_when: queuedDttm }),
+              ...(startDate === null ? {} : { start_when: startDate }),
+              ...(startDate === null && !hasTaskRunning ? {} : { end_when: 
dayjs(endMs).toISOString() }),

Review Comment:
   Good call — collapsed both into a single symmetric form. Now 
`effectiveEndDate = endDate ?? (hasTaskRunning && startDate !== null ? new 
Date().toISOString() : null)` and `end_when` is gated on it exactly like 
`start_when` is gated on `startDate`:
   
   - **Value:** finished tasks keep the raw API `end_date` string (no 
`dayjs(endMs).toISOString()` re-serialization), so the test now asserts the raw 
`2024-03-14T10:05:00+00:00` just like `start_when`.
   - **Gate:** a not-yet-started task (no `start_date`) now skips `start_when` 
and `end_when` together and both bars fall back to their own bounds — no more 
mismatched scales in one tooltip.
   - **Ordering:** since `effectiveEndDate` no longer needs `endMs`, the 
`tryWhenForTooltip` block moved back above the `endMs` computation, removing 
that dependency.
   
   Pushed in 9f81693.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to