Skip to content

Conversation

@RoyLee1224
Copy link
Contributor

@RoyLee1224 RoyLee1224 commented Aug 8, 2025

Related issues, discussions and PRs

closes: #54138
related issue: #52008
discussions: #50907
backend: #52748

Changes

  • New "Calendar" Tab is added to the Dag page
  • Dual Granularity View: Daily & Hourly View
  • Tooltips: Hovering over a cell displays a tooltip with the specific date/time and the runs info.
  • Success Rate Spectrum: A color-coded legend explains the success rate.
  • Adjusted success.400 and success.500 in the theme for better readability. I've confirmed this change won't affect other parts of the UI. The lime green we see in the current UI is using running.600.

Discussions and suggestions on the UI design are highly welcome.

To-Do

  • Enhance Cell Coloring by State: Update the getColor logic to reflect the final run states (e.g., success -> green, failed -> red, mixed -> yellow, planned -> brown).
  • Improve Tooltip Performance: Implement debounce for the tooltip similar to GridTI.tsx to prevent performance issues.
  • Make legend responsive and vertical in hourly view.
  • Abbreviate weekday names to a single letter(Mo -> M) for smaller cell sizes (< 18px).
  • Replace all hardcoded colors with theme tokens to enable dark mode support.

Screenshots

calendar_v2.mp4

Hourly View

hourly_v2

Daily View

daily_v2

^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in airflow-core/newsfragments.

feat(ui): Add Github style grid for Calendar tab

fix(ui): Fix time format for importing dag runs to calendar
@boring-cyborg boring-cyborg bot added area:translations area:UI Related to UI/UX. For Frontend Developers. translation:default labels Aug 8, 2025
@RoyLee1224 RoyLee1224 marked this pull request as draft August 8, 2025 00:00
@RoyLee1224 RoyLee1224 marked this pull request as ready for review August 8, 2025 22:45
@RoyLee1224 RoyLee1224 changed the title [WIP] Add Calendar view for Dag Add Calendar view for Dag Aug 9, 2025
Copy link
Member

@Lee-W Lee-W left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Translation-wise, it looks good to me. would appreciate on a second pair of eyes

Copy link
Contributor

@jscheffl jscheffl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me in general. Thanks for the work!
I was also fearing a bit that the view is too large but find it very cool that you added a control to adjust cell size. This is then cool to adjust to individual screen size!

Some small layout nit, can you fix this up before merge?

(1) In some zoom levels the days are wrapped on the hourly view:
image

(2) Colors need some adjustment for dark mode... the colors especially on days w/o execution look a bit strange. Also the legend font colors are probably too dark gray for readability.
image

@RoyLee1224
Copy link
Contributor Author

RoyLee1224 commented Aug 11, 2025

Update

calendar_v3.mp4

Hi all, I've pushed the following updates based on the review:

Layout:

  • Made legend responsive and vertical in hourly view.
  • Abbreviated weekday names to a single letter(Mo -> M) for smaller cell sizes (< 18px).

Theming:

  • Replaced all hardcoded colors with theme tokens to enable dark mode support.
  • Adjusted success.400 and success.500 in the theme for better readability. I've confirmed this change won't affect other parts of the UI. The lime green we see in the current UI is using running.600.

The theme change:

Before After

@RoyLee1224
Copy link
Contributor Author

Here's a demo video of filter & show total

filter_showtotal.mp4

@jscheffl
Copy link
Contributor

Here's a demo video of filter & show total

Very cool!

@ashb
Copy link
Member

ashb commented Aug 17, 2025

@RoyLee1224 You've missed one crucial use case: Seeing when the Dag will run. Not so useful with a daily or hourly scheduler, but crucial for more complex scheduling patterns, and was the original reason Calendar view was added to Airflow 2's UI

@ashb
Copy link
Member

ashb commented Aug 17, 2025

Here's a demo video of filter & show total
filter_showtotal.mp4

Nice.

What do the "Daily" and "Hourly" buttons do? How does a dag behave if it runs once a day? What about when it's 4 times a day?

Copy link
Contributor

@bbovenzi bbovenzi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I appreciate the filters you added but I think those are not the ones we need. I feel like we're trying to make this calendar heatmap do too much at once

I would still like to remove:

  • showing the count in the cell
  • changing the cell size

What we do need:

  • Let's just have a toggle between total count and failure count with a tooltip that always gives you the full breakdown. Both should be sequential colors just like the github commit history heatmap is only shades of green. Plus "planned" as a distinctly different color to be colorblind friendly.
  • We can then simplify the legend and have it take up less screen space
  • (Future PR) Clicking on a cell should link to a list of dagruns filtered to that date range and with state=failed if we were only showing the failed count. Or link directly to the dagrun if the count for that period is 1

@bbovenzi
Copy link
Contributor

bbovenzi commented Aug 19, 2025

(Future PR) We probably want to add better bar charts to the overview page too so that this calendar view is not trying to do too much.

@RoyLee1224
Copy link
Contributor Author

RoyLee1224 commented Aug 22, 2025

@bbovenzi Sure, sounds good! Those filters were just my experiment on a different branch, and I agree that simplifying is the right way to go.

I've updated the PR with the changes you suggested:

  • remove cellsize changing function

  • GitHub-style heatmap with buttons toggle between total count and failure count

  • default to hourly


The current static thresholds for TOTAL_COLOR_INTENSITIES and FAILURE_COLOR_INTENSITIES might not scale well.
Maybe we should:

  • Use different intensity scales for the daily vs. hourly views.
  • Longer-term, the scale could be dynamic based on the Dag's own run history.

Please let me know what you think!

calendar_v4.mp4

Copy link
Contributor

@jscheffl jscheffl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For me this is looking very good (still) - LGTM so that we get this in 3.1!

(mini nit: The yearly view is a bit large, needs almost FHD screen to see the panel w/o scrolling. Might it make sense to make cell sizing a nit smaller? Non blocking though!)

@RoyLee1224
Copy link
Contributor Author

With 14px cell size, the 10px font (2xs) is a bit tight. Here are the options:

  • Reduce the font size to 9px.
  • Use single-letter abbreviations for the days (M, T, W) while keeping the 10px font.

For now, I've implemented Option B in the latest commit, but I'm happy to change it depending on your preference. Let me know what you think!

Option Preview
Before
Option A: Reduce Font Size
Option B: Single-Letter Days

@jscheffl
Copy link
Contributor

With 14px cell size, the 10px font (2xs) is a bit tight. Here are the options:

For me both is OK

@RoyLee1224
Copy link
Contributor Author

RoyLee1224 commented Aug 22, 2025

Third, I think we can always get away with less white space between each cell too which should help with the size of the calendars

Here’s a quick comparison between the original gap=1 and smallergap=0.5:

gap 1 gap 0.5

For now, I'm using gap=0.5.

Copy link
Contributor

@bbovenzi bbovenzi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Great work and thanks for being so patient with so many comments. I think people will really enjoy this!

@bbovenzi bbovenzi added this to the Airflow 3.1.0 milestone Aug 25, 2025
@bbovenzi
Copy link
Contributor

Oh and #protm

@bbovenzi bbovenzi merged commit 9a30311 into apache:main Aug 25, 2025
56 checks passed
@jason810496
Copy link
Member

Great work! #protm as well

mangal-vairalkar pushed a commit to mangal-vairalkar/airflow that referenced this pull request Aug 30, 2025
* feat(ui): WIP - Add initial scaffold for DAG Calendar view

feat(ui): Add Github style grid for Calendar tab

fix(ui): Fix time format for importing dag runs to calendar

* feat(ui): enhance Dag Calendar with hourly/daily view

* feat(ui): Implement state and Success Rate Spectrum for calendar view

* feat(ui): implement debounced tooltip for calendar grid

* feat(ui): enhance calendar view UX with improved loading and button

* feat(ui): modify Success Rate Spectrum layout in hourly calender view

* perf(ui): optimize calendar data processing

* feat(ui): refactor calendar legend layout and improve hourly view positioning

* feat(ui): improve calendar cellSize controls and hourly view text display

* feat(ui): enhance calendar dark mode support and replace hardcoded RGB colors

* refactor(ui): optimize calendar date state management

* refactor(ui): Extract calendar tooltip logic into useDelayedTooltip hook

* refactor(ui): reduce duplication in CalendarLegend

* style(ui): improve calendar UI consistency and accessibility

* fix(i18n): modify translations

* fix(ui): remove cellsize changing function

* feat(ui): GitHub-style heatmap, default to hourly.

* fix(ui): Rename calendar colorMode to viewMode to avoid confusion with theme settings

* style(calendar): reduce cell size to 14x14px and simplify weekday labels to single letters

* refactor(ui): consolidate calendar cells

* style(ui): modify calendar cell gap and legend size
nothingmin pushed a commit to nothingmin/airflow that referenced this pull request Sep 2, 2025
* feat(ui): WIP - Add initial scaffold for DAG Calendar view

feat(ui): Add Github style grid for Calendar tab

fix(ui): Fix time format for importing dag runs to calendar

* feat(ui): enhance Dag Calendar with hourly/daily view

* feat(ui): Implement state and Success Rate Spectrum for calendar view

* feat(ui): implement debounced tooltip for calendar grid

* feat(ui): enhance calendar view UX with improved loading and button

* feat(ui): modify Success Rate Spectrum layout in hourly calender view

* perf(ui): optimize calendar data processing

* feat(ui): refactor calendar legend layout and improve hourly view positioning

* feat(ui): improve calendar cellSize controls and hourly view text display

* feat(ui): enhance calendar dark mode support and replace hardcoded RGB colors

* refactor(ui): optimize calendar date state management

* refactor(ui): Extract calendar tooltip logic into useDelayedTooltip hook

* refactor(ui): reduce duplication in CalendarLegend

* style(ui): improve calendar UI consistency and accessibility

* fix(i18n): modify translations

* fix(ui): remove cellsize changing function

* feat(ui): GitHub-style heatmap, default to hourly.

* fix(ui): Rename calendar colorMode to viewMode to avoid confusion with theme settings

* style(calendar): reduce cell size to 14x14px and simplify weekday labels to single letters

* refactor(ui): consolidate calendar cells

* style(ui): modify calendar cell gap and legend size
@RoyLee1224 RoyLee1224 deleted the calendar branch September 10, 2025 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:translations area:UI Related to UI/UX. For Frontend Developers. translation:default

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UI - Implement the Calendar View

7 participants