Skip to content

UI: Make duration charts readable at a glance#70142

Merged
bbovenzi merged 4 commits into
apache:mainfrom
eddiesr93:improve-63582-task-duration-chart
Jul 21, 2026
Merged

UI: Make duration charts readable at a glance#70142
bbovenzi merged 4 commits into
apache:mainfrom
eddiesr93:improve-63582-task-duration-chart

Conversation

@eddiesr93

Copy link
Copy Markdown
Contributor

Redesign of the Dag Run / Task Instance duration chart on the overview pages, covering the five points raised in the issue.

  • Axis units — durations render as 5m, 1h 30m, 1d 4h instead of 00:05:00, and ticks snap to steps people actually count in (30s, 1m, 5m, 15m, 1h, …) rather than Chart.js' decimal steps, which produced ticks like 26m 40s / 33m 20s.
  • Reference line — the two mean lines are replaced by one dashed median-of-total line labelled Median total: 4m 15s. A single stuck run drags the mean well above where runs actually land, and the two old labels were both pinned to the same edge, so they overlapped each other and the most recent bars.
  • Legend — enabled, so the queued and run series are named.
  • Chart size — the card was pinned to 350px. It now flexes on the Dag overview and fills its row on the Task overview, which is what makes the bars comparable in the first place.
  • Stackingy.stacked was never set even though x.stacked was, so queued time was drawn behind run time rather than underneath it and was effectively invisible. It now sits at the base of each bar.

Median and tick-step selection are pure helpers (src/utils/median.ts and getDurationTickStep) with unit tests. Full UI suite passes: 88 files / 706 tests.

Screenshots below are the same 12 Dag Runs rendered through the real theme, one run deliberately stuck at ~32m so the median and the mean it replaces land in visibly different places.

Before

Duration chart before: HH:mm:ss axis, no legend, two overlapping mean labels, queued time hidden

After

Duration chart after: compact time axis on human steps, legend, single dashed median line, queued time stacked at the base

At the narrower width the card falls back to (when asset events share the row):

Duration chart after at 350px

closes: #63582


Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (Opus 4.8)

Generated-by: Claude Code (Opus 4.8) following the guidelines

The Airflow 3 duration chart dropped several things the Airflow 2 version
did well, and what is left is hard to read at the size it is given.

Durations on the value axis are the main cost: HH:mm:ss has to be decoded
tick by tick before the magnitude is apparent, and Chart.js picks decimal
steps, so a busy Dag lands on ticks like 26m 40s. The two reference lines
report the mean, which one stuck run drags well above where runs actually
sit, and both labels are pinned to the same edge so they overlap each other
and the most recent bars. Nothing names the two series. Finally the card is
pinned to 350px on a page with room to spare, which is what makes the bars
too small to compare in the first place.

The bars were also stacked on the index axis only, so queued time was drawn
behind run time rather than underneath it, and was effectively invisible.

@bbovenzi bbovenzi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks. This looks good. Can you provide a few more screenshots?

Comment thread airflow-core/newsfragments/70142.improvement.rst Outdated
Comment thread airflow-core/src/airflow/ui/public/i18n/locales/en/components.json Outdated
Comment thread airflow-core/src/airflow/ui/src/pages/Task/Overview/Overview.tsx Outdated
@bbovenzi bbovenzi added this to the Airflow 3.3.1 milestone Jul 20, 2026
@bbovenzi bbovenzi added the backport-to-v3-3-test Backport to v3-3-test label Jul 20, 2026
Letting the card flex horizontally handed its height to Chart.js' default 2:1
aspect ratio, which the old fixed 350px width had been capping as a side
effect. On a 1400px row the chart came out 496px tall, and on a 2560px monitor
it would have passed 1000px and swallowed the page it sits on.
@eddiesr93

Copy link
Copy Markdown
Contributor Author

Pushed a follow-up commit after re-checking the layout against the AssetEvents sibling on the Dag overview.

Freeing the card width handed the chart height to Chart.js' default 2:1 aspect ratio, which the old fixed 350px had been capping as a side effect. Measured on a 1400px row: the canvas came out 992×496, and on a 2560px monitor it would have scaled past 1000px tall. The chart now renders into a fixed-height box with maintainAspectRatio: false, so it is 280px tall at every width, and the loading skeletons were bumped from 200px to match so there is no jump on load.

For the record, the sibling panel is unaffected — AssetEvents measures 380px wide with the old fixed width, with the flexed card, and with a capped variant, because it sizes to its content and there is spare room in the row either way.

The screenshots above have been regenerated against the fixed height.


Drafted-by: Claude Code (Opus 4.8) (no human review before posting)

The two overview pages had drifted apart for no reason: one card flexed, the
other sat in a single-column grid with only a max width, so the same chart
answered to two different sets of rules. They now share one Box, which also
gives the Task overview the cap the Dag overview needed to stop the chart
spanning an ultrawide monitor.

The reference line reads "Total:" rather than "Median total:", and the
newsfragment is dropped as not warranted for this change.
@bbovenzi
bbovenzi merged commit ae756a9 into apache:main Jul 21, 2026
89 checks passed
@boring-cyborg

boring-cyborg Bot commented Jul 21, 2026

Copy link
Copy Markdown

Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions.

@github-actions

Copy link
Copy Markdown
Contributor

Backport successfully created: v3-3-test

Note: As of Merging PRs targeted for Airflow 3.X
the committer who merges the PR is responsible for backporting the PRs that are bug fixes (generally speaking) to the maintenance branches.

In matter of doubt please ask in #release-management Slack channel.

Status Branch Result
v3-3-test PR Link

github-actions Bot pushed a commit to aws-mwaa/upstream-to-airflow that referenced this pull request Jul 21, 2026
* UI: Make duration charts readable at a glance

The Airflow 3 duration chart dropped several things the Airflow 2 version
did well, and what is left is hard to read at the size it is given.

Durations on the value axis are the main cost: HH:mm:ss has to be decoded
tick by tick before the magnitude is apparent, and Chart.js picks decimal
steps, so a busy Dag lands on ticks like 26m 40s. The two reference lines
report the mean, which one stuck run drags well above where runs actually
sit, and both labels are pinned to the same edge so they overlap each other
and the most recent bars. Nothing names the two series. Finally the card is
pinned to 350px on a page with room to spare, which is what makes the bars
too small to compare in the first place.

The bars were also stacked on the index axis only, so queued time was drawn
behind run time rather than underneath it, and was effectively invisible.

* Add newsfragment for the duration chart changes

* UI: Pin the duration chart height

Letting the card flex horizontally handed its height to Chart.js' default 2:1
aspect ratio, which the old fixed 350px width had been capping as a side
effect. On a 1400px row the chart came out 496px tall, and on a 2560px monitor
it would have passed 1000px and swallowed the page it sits on.

* UI: Apply duration chart review feedback

The two overview pages had drifted apart for no reason: one card flexed, the
other sat in a single-column grid with only a max width, so the same chart
answered to two different sets of rules. They now share one Box, which also
gives the Task overview the cap the Dag overview needed to stop the chart
spanning an ultrawide monitor.

The reference line reads "Total:" rather than "Median total:", and the
newsfragment is dropped as not warranted for this change.
(cherry picked from commit ae756a9)

Co-authored-by: Eddie Roman <44783562+eddiesr93@users.noreply.github.com>
aws-airflow-bot pushed a commit to aws-mwaa/upstream-to-airflow that referenced this pull request Jul 21, 2026
* UI: Make duration charts readable at a glance

The Airflow 3 duration chart dropped several things the Airflow 2 version
did well, and what is left is hard to read at the size it is given.

Durations on the value axis are the main cost: HH:mm:ss has to be decoded
tick by tick before the magnitude is apparent, and Chart.js picks decimal
steps, so a busy Dag lands on ticks like 26m 40s. The two reference lines
report the mean, which one stuck run drags well above where runs actually
sit, and both labels are pinned to the same edge so they overlap each other
and the most recent bars. Nothing names the two series. Finally the card is
pinned to 350px on a page with room to spare, which is what makes the bars
too small to compare in the first place.

The bars were also stacked on the index axis only, so queued time was drawn
behind run time rather than underneath it, and was effectively invisible.

* Add newsfragment for the duration chart changes

* UI: Pin the duration chart height

Letting the card flex horizontally handed its height to Chart.js' default 2:1
aspect ratio, which the old fixed 350px width had been capping as a side
effect. On a 1400px row the chart came out 496px tall, and on a 2560px monitor
it would have passed 1000px and swallowed the page it sits on.

* UI: Apply duration chart review feedback

The two overview pages had drifted apart for no reason: one card flexed, the
other sat in a single-column grid with only a max width, so the same chart
answered to two different sets of rules. They now share one Box, which also
gives the Task overview the cap the Dag overview needed to stop the chart
spanning an ultrawide monitor.

The reference line reads "Total:" rather than "Median total:", and the
newsfragment is dropped as not warranted for this change.
(cherry picked from commit ae756a9)

Co-authored-by: Eddie Roman <44783562+eddiesr93@users.noreply.github.com>
bbovenzi pushed a commit that referenced this pull request Jul 21, 2026
…70197)

* UI: Make duration charts readable at a glance

The Airflow 3 duration chart dropped several things the Airflow 2 version
did well, and what is left is hard to read at the size it is given.

Durations on the value axis are the main cost: HH:mm:ss has to be decoded
tick by tick before the magnitude is apparent, and Chart.js picks decimal
steps, so a busy Dag lands on ticks like 26m 40s. The two reference lines
report the mean, which one stuck run drags well above where runs actually
sit, and both labels are pinned to the same edge so they overlap each other
and the most recent bars. Nothing names the two series. Finally the card is
pinned to 350px on a page with room to spare, which is what makes the bars
too small to compare in the first place.

The bars were also stacked on the index axis only, so queued time was drawn
behind run time rather than underneath it, and was effectively invisible.

* Add newsfragment for the duration chart changes

* UI: Pin the duration chart height

Letting the card flex horizontally handed its height to Chart.js' default 2:1
aspect ratio, which the old fixed 350px width had been capping as a side
effect. On a 1400px row the chart came out 496px tall, and on a 2560px monitor
it would have passed 1000px and swallowed the page it sits on.

* UI: Apply duration chart review feedback

The two overview pages had drifted apart for no reason: one card flexed, the
other sat in a single-column grid with only a max width, so the same chart
answered to two different sets of rules. They now share one Box, which also
gives the Task overview the cap the Dag overview needed to stop the chart
spanning an ultrawide monitor.

The reference line reads "Total:" rather than "Median total:", and the
newsfragment is dropped as not warranted for this change.
(cherry picked from commit ae756a9)

Co-authored-by: Eddie Roman <44783562+eddiesr93@users.noreply.github.com>
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. backport-to-v3-3-test Backport to v3-3-test translation:default

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Problems with rendering the task duration graph in airflow 3

2 participants