Skip to content

Conversation

@guan404ming
Copy link
Member

@guan404ming guan404ming commented Jun 12, 2025

Related Issue

#44672

cc @bbovenzi

Why

Our ui currently lack of gantt chart compared with AF2

How

Reimplement the gantt chart with chart.js

  • add chartjs-adapter-dayjs-4 to use dayjs to format time in chart.js
  • use grid data hook to fetch data and sync layout with grid view
  • add gantt tab in Run, TI and GroupTI page
Screen.Recording.2025-06-13.at.1.49.32.AM.mov

^ 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.

@guan404ming
Copy link
Member Author

guan404ming commented Jun 12, 2025

Known issue: the row alignment between grid view and gantt view would break when the HeaderCard height change. I would like to know that should we fix the height of HeaderCard to some constant or is there any better to solve this issue?

Thanks in advance!

@bbovenzi bbovenzi added this to the Airflow 3.1.0 milestone Jun 12, 2025
@bbovenzi
Copy link
Contributor

bbovenzi commented Jun 12, 2025

Very cool! I'll pull this down and play with it some more. But my quick thoughts:

  • Yes, let's make the header a fixed height. Ideally by using as a placeholder
  • I think we need to remove or at least speed up the animations in the gantt chart
  • Let's test this against a dag with 100+ tasks and see how the scrolling holds up

@guan404ming guan404ming marked this pull request as draft June 12, 2025 18:57
@jscheffl
Copy link
Contributor

Very cool!

@guan404ming guan404ming force-pushed the add-gantt branch 3 times, most recently from b82c025 to fb91fb7 Compare June 14, 2025 08:16
@guan404ming
Copy link
Member Author

guan404ming commented Jun 14, 2025

I've fixed the HeaderCard height for Gantt page and do some rwd implementation for Stat. Also, I've followed the official docs to optimize our Gantt. Current ui looks like

Screen.Recording.2025-06-14.at.4.25.38.PM.mov

@guan404ming guan404ming marked this pull request as ready for review June 14, 2025 08:35
@guan404ming guan404ming requested a review from Lee-W as a code owner June 14, 2025 08:35
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.

Taiwanese Mandarin translation looks good to me

@guan404ming guan404ming marked this pull request as draft June 16, 2025 08:46
@bbovenzi
Copy link
Contributor

I was thinking about the UX of this after #51764

Perhaps instead of putting the gantt in a tab on the right-hand panel, it should be an option to add onto the grid view on the left panel. Let's discuss first before you refactor everything though.

@guan404ming
Copy link
Member Author

I’m back!
I've noticed the change to the right panel. It seems like fixing the height of HeaderCard might not be ideal now. I agree with your idea of moving the Gantt chart to the left panel, similar to how we handle the grid and graph. That might be a better way to manage the Gantt chart UX without messing up the layout.

The only trade-off I see is that we might lose the shared scroll between the grid and the Gantt. What are your thoughts on that?

@bbovenzi
Copy link
Contributor

I’m back! I've noticed the change to the right panel. It seems like fixing the height of HeaderCard might not be ideal now. I agree with your idea of moving the Gantt chart to the left panel, similar to how we handle the grid and graph. That might be a better way to manage the Gantt chart UX without messing up the layout.

The only trade-off I see is that we might lose the shared scroll between the grid and the Gantt. What are your thoughts on that?

Either, the gantt chart can be a separate view on the left panel (easier)
Show/Hide Gantt , is an option on the grid view and they can live inside of the same container so the scrolling is easier to handle.

@guan404ming
Copy link
Member Author

I think the second idea is great and aligns better with the UX, especially since users will likely want to use both the grid and Gantt views at the same time. I’ll try implementing it first and see how it feels. My only concern is that it might get a bit cramped, so I might increase the min-width of the left pane to help with that. Thanks!

@bbovenzi
Copy link
Contributor

Yeah, when the gantt is shown we can change the minWidth!

@guan404ming guan404ming force-pushed the add-gantt branch 2 times, most recently from d6f2fef to b7b5ac6 Compare June 19, 2025 19:46
@guan404ming guan404ming force-pushed the add-gantt branch 2 times, most recently from 0e85698 to 16d7377 Compare August 16, 2025 18:00
@bbovenzi
Copy link
Contributor

Looking really good! Let's fix some spacing issues and merge this. Then we can work on the tooltips and clicking on a gantt bar to select the task

@bbovenzi bbovenzi merged commit 61b64a4 into apache:main Aug 20, 2025
53 checks passed
@bbovenzi
Copy link
Contributor

#protm

@potiuk
Copy link
Member

potiuk commented Aug 20, 2025

Indeed #protm

@guan404ming
Copy link
Member Author

Thanks for all reviews! I would keep working on improving the chart.

@guan404ming guan404ming deleted the add-gantt branch August 20, 2025 18:27
mangal-vairalkar pushed a commit to mangal-vairalkar/airflow that referenced this pull request Aug 30, 2025
* Add Gantt chart

* Fix grid color in dark mode

* Sync selected color with Grid

* Enable showGantt button for run or TI selected

* Set minimum width for TI

* Fix spacing

* Fix single task layout

* Update auto-refresh for TI and useMemo

* Fix button visibility condition

* Update fixedHeight

* Update DetailsLayout and Grid layout

* Update airflow-core/src/airflow/ui/src/layouts/Details/Gantt/Gantt.tsx

Co-authored-by: Brent Bovenzi <brent.bovenzi@gmail.com>

---------

Co-authored-by: Brent Bovenzi <brent.bovenzi@gmail.com>
@simi
Copy link
Contributor

simi commented Sep 19, 2025

I'm facing this issue on Linux/Chrome. Time rotated is not simple to read, since it is cut at the top and tooltip is streched to fit inside and cut at the bottom.

image

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.

8 participants