From 4917300350fd85b79f4d81fc36cef56c4593bd39 Mon Sep 17 00:00:00 2001 From: Shashwati Date: Sat, 9 May 2026 13:17:19 +0530 Subject: [PATCH 1/3] Fix calendar view showing queued runs as green, indistinguishable from success --- .../src/pages/Dag/Calendar/CalendarLegend.tsx | 8 +++++++- .../ui/src/pages/Dag/Calendar/calendarUtils.ts | 17 +++++++++++++++-- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/airflow-core/src/airflow/ui/src/pages/Dag/Calendar/CalendarLegend.tsx b/airflow-core/src/airflow/ui/src/pages/Dag/Calendar/CalendarLegend.tsx index 480c1a8e07702..31401bd10cbe6 100644 --- a/airflow-core/src/airflow/ui/src/pages/Dag/Calendar/CalendarLegend.tsx +++ b/airflow-core/src/airflow/ui/src/pages/Dag/Calendar/CalendarLegend.tsx @@ -21,7 +21,7 @@ import { useTranslation } from "react-i18next"; import { Tooltip } from "src/components/ui"; -import { PLANNED_COLOR } from "./calendarUtils"; +import { PLANNED_COLOR, QUEUED_COLOR } from "./calendarUtils"; import type { CalendarScale, CalendarColorMode } from "./types"; type Props = { @@ -89,6 +89,12 @@ export const CalendarLegend = ({ scale, vertical = false, viewMode }: Props) => {translate("common:states.planned")} + + + + {translate("common:states.queued")} + + { - const actualCount = viewMode === "total" ? counts.total - counts.planned : counts.failed; + const actualCount = + viewMode === "total" ? counts.total - counts.planned - counts.queued : counts.failed; const hasPlanned = counts.planned > 0; + const hasQueued = counts.queued > 0; const hasActual = actualCount > 0; if (hasPlanned && hasActual) { @@ -241,6 +244,10 @@ export const createCalendarScale = ( return PLANNED_COLOR; } + if (hasQueued && !hasActual) { + return QUEUED_COLOR; + } + return actualCount === 0 ? EMPTY_COLOR : singleColor; }, legendItems: [ @@ -274,8 +281,10 @@ export const createCalendarScale = ( actual: string | { _dark: string; _light: string }; planned: string | { _dark: string; _light: string }; } => { - const actualCount = viewMode === "total" ? counts.total - counts.planned : counts.failed; + const actualCount = + viewMode === "total" ? counts.total - counts.planned - counts.queued : counts.failed; const hasPlanned = counts.planned > 0; + const hasQueued = counts.queued > 0; const hasActual = actualCount > 0; if (hasPlanned && hasActual) { @@ -304,6 +313,10 @@ export const createCalendarScale = ( return PLANNED_COLOR; } + if (hasQueued && !hasActual) { + return QUEUED_COLOR; + } + const targetCount = actualCount; if (targetCount === 0) { From c1c154742693e45cda46c623da5d44a2bc8b3969 Mon Sep 17 00:00:00 2001 From: Shashwati Date: Sat, 9 May 2026 22:49:13 +0530 Subject: [PATCH 2/3] Fix line formatting and exclude queued from calculateDataBounds --- .../airflow/ui/src/pages/Dag/Calendar/calendarUtils.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/airflow-core/src/airflow/ui/src/pages/Dag/Calendar/calendarUtils.ts b/airflow-core/src/airflow/ui/src/pages/Dag/Calendar/calendarUtils.ts index ca67bbae22853..1c55b2a7bb965 100644 --- a/airflow-core/src/airflow/ui/src/pages/Dag/Calendar/calendarUtils.ts +++ b/airflow-core/src/airflow/ui/src/pages/Dag/Calendar/calendarUtils.ts @@ -187,7 +187,10 @@ export const calculateDataBounds = ( dataMap.forEach((runs) => { const runCounts = calculateRunCounts(runs); - const targetCount = viewMode === "total" ? runCounts.total : runCounts.failed; + const targetCount = + viewMode === "total" + ? runCounts.total - runCounts.planned - runCounts.queued + : runCounts.failed; if (targetCount > 0) { counts.push(targetCount); @@ -281,8 +284,7 @@ export const createCalendarScale = ( actual: string | { _dark: string; _light: string }; planned: string | { _dark: string; _light: string }; } => { - const actualCount = - viewMode === "total" ? counts.total - counts.planned - counts.queued : counts.failed; + const actualCount = viewMode === "total" ? counts.total - counts.planned - counts.queued : counts.failed; const hasPlanned = counts.planned > 0; const hasQueued = counts.queued > 0; const hasActual = actualCount > 0; From 35a9193676072222ac57bda8776b510d0698e703 Mon Sep 17 00:00:00 2001 From: Shashwati Date: Mon, 11 May 2026 20:32:34 +0530 Subject: [PATCH 3/3] Fix line formatting in calculateDataBounds --- .../src/airflow/ui/src/pages/Dag/Calendar/calendarUtils.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/airflow-core/src/airflow/ui/src/pages/Dag/Calendar/calendarUtils.ts b/airflow-core/src/airflow/ui/src/pages/Dag/Calendar/calendarUtils.ts index 1c55b2a7bb965..38adcdaa16f08 100644 --- a/airflow-core/src/airflow/ui/src/pages/Dag/Calendar/calendarUtils.ts +++ b/airflow-core/src/airflow/ui/src/pages/Dag/Calendar/calendarUtils.ts @@ -188,9 +188,7 @@ export const calculateDataBounds = ( dataMap.forEach((runs) => { const runCounts = calculateRunCounts(runs); const targetCount = - viewMode === "total" - ? runCounts.total - runCounts.planned - runCounts.queued - : runCounts.failed; + viewMode === "total" ? runCounts.total - runCounts.planned - runCounts.queued : runCounts.failed; if (targetCount > 0) { counts.push(targetCount);