Skip to content

Progressively load interactive elements of Dag Card - #69806

Merged
bbovenzi merged 3 commits into
apache:mainfrom
shivaam:codex/prototype-dag-card-progressive-mount
Jul 23, 2026
Merged

Progressively load interactive elements of Dag Card#69806
bbovenzi merged 3 commits into
apache:mainfrom
shivaam:codex/prototype-dag-card-progressive-mount

Conversation

@shivaam

@shivaamshivaam commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #69681.

The DAG Card view can render up to 50 cards with 14 recent runs per card. On cached navigation, rebuilding hundreds of run bars and repeated interactive controls can delay the page even though most cards are below the viewport.

This change renders every card shell and its static DAG information immediately, while deferring the expensive interactive content until the card approaches the viewport:

  • pause, trigger, favorite, delete, and review controls
  • full schedule and asset-expression UI
  • recent-run bars
  • run-state badges

The cards share one IntersectionObserver per scroll root. Hydration is one-way, so scrolling away does not unmount controls or disturb focus or open menus. The observer finds the actual scrolling ancestor and applies a 600 px rootMargin, avoiding a dependency on the newer scrollMargin option. Keyboard focus entering a deferred card hydrates its controls, and browsers without IntersectionObserver fall back to eager rendering.

This is intentionally not list virtualization. All card shells, DAG names, DAG identity links, sorting behavior, and browser find are available immediately. Interactive controls and recent-run links for fully offscreen cards appear when their card approaches the viewport or receives focus. All cards eventually hydrate, so the final page state is unchanged.

Screen.Recording.2026-07-21.at.7.18.52.PM.mov

Closes: #69609

Testing

  • 31 focused Vitest tests covering shared-observer behavior, scroll-root selection, one-way hydration, keyboard focus, fallback behavior, cleanup, stable geometry, and card interactions
  • targeted ESLint and Prettier checks
  • full UI TypeScript check with pnpm tsc --noEmit
  • production Vite build and Airflow prek UI hooks
  • git diff --check
  • live Breeze sort, scroll, hover, keyboard, and exact run-link smoke tests

Was generative AI tooling used to co-author this PR?
  • Yes (OpenAI Codex)

Generated-by: OpenAI Codex following the guidelines


  • Read the Pull Request Guidelines for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
  • For significant user-facing changes create newsfragment: {pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.

@boring-cyborgboring-cyborgBot added the area:UI Related to UI/UX. For Frontend Developers. label Jul 13, 2026
@shivaam
shivaamforce-pushed the codex/prototype-dag-card-progressive-mount branch from d11b093 to 9805025CompareJuly 13, 2026 17:37
@shivaamshivaam changed the title Render DAG cards progressively[Prototype][Do not merge yet] Render DAG cards progressivelyJul 13, 2026
@shivaam

Copy link
Copy Markdown
ContributorAuthor

@pierrejeambrun I have been experimenting with some ideas to make the UI snappier for displaying multiple rows of data. Could you take a look and share your thoughts?
I made some improvements to the UI speed earlier as well - #69681

@shivaam
shivaam marked this pull request as ready for review July 13, 2026 17:58
@bbovenzi
bbovenzi marked this pull request as draft July 13, 2026 20:26
@bbovenzi

Copy link
Copy Markdown
Contributor

Please keep as a draft PR if you dont want it merged yet.

@shivaam

Copy link
Copy Markdown
ContributorAuthor

Please keep as a draft PR if you dont want it merged yet.

So this PR is ready for review but not ready for merge. I thought a draft PR means that it is not ready for review but in this case I am looking for feedback from the community while doing some more testing on my end. Wondering what is the best way to say it is ready for feedback?

@bbovenzi

Copy link
Copy Markdown
Contributor

I think a better safeguard is to keep it as a draft but then you can tag specific contributors in a comment to ask them to take a look.

@shivaam

shivaam commented Jul 13, 2026

Copy link
Copy Markdown
ContributorAuthor

I think a better safeguard is to keep it as a draft but then you can tag specific contributors in a comment to ask them to take a look.

Sounds good.

Since we are already here, if you get a chance can you also look at the PR and let me know if you have any thoughts. The improvement is marginal thought it makes the UI feel more snappier.

@bbovenzibbovenzi 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.

I feel like we should progressively load the interactive elements of a card instead of the cards themselves. Those are the slow to load elements. Batches of 5 cards would probably create some odd start-stop jitter during scrolling.

If a card is not in view, don't try to fetch or render any of the asset_expression, pause/unpause, delete button, favorite button, needs review tag. We can apply the same logic to the content of the table list too. So that the new dag run stats mad task instance stats also don't slow down rendering

@shivaam
shivaamforce-pushed the codex/prototype-dag-card-progressive-mount branch from 9805025 to 7fdccc9CompareJuly 21, 2026 23:14
@shivaamshivaam changed the title [Prototype][Do not merge yet] Render DAG cards progressivelyRender DAG card content near the viewportJul 21, 2026
@shivaam

Copy link
Copy Markdown
ContributorAuthor

I feel like we should progressively load the interactive elements of a card instead of the cards themselves. Those are the slow to load elements. Batches of 5 cards would probably create some odd start-stop jitter during scrolling.

If a card is not in view, don't try to fetch or render any of the asset_expression, pause/unpause, delete button, favorite button, needs review tag. We can apply the same logic to the content of the table list too. So that the new dag run stats mad task instance stats also don't slow down rendering

Great point. I like this idea and updated the PR to render the slower components only when the card is in the view. It took a few iterations. Let me know your thoughts.

@shivaam
shivaam marked this pull request as ready for review July 22, 2026 02:00
@bbovenzibbovenzi added this to the Airflow 3.3.1 milestone Jul 22, 2026
@bbovenzibbovenzi added the backport-to-v3-3-test Backport to v3-3-test label Jul 22, 2026

@bbovenzibbovenzi 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.

Looking good!

Comment threadairflow-core/src/airflow/ui/src/hooks/useNearViewport.ts
@bbovenzibbovenzi changed the title Render DAG card content near the viewportProgressively load interactive elements of Dag CardJul 23, 2026
@bbovenzi
bbovenzi merged commit 4db892e into apache:mainJul 23, 2026
89 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

Backport failed to create: v3-3-test. View the failure log Run details

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.

StatusBranchResult
v3-3-testCommit Link

You can attempt to backport this manually by running:

cherry_picker 4db892e v3-3-test

This should apply the commit to the v3-3-test branch and leave the commit in conflict state marking
the files that need manual conflict resolution.

After you have resolved the conflicts, you can continue the backport process by running:

cherry_picker --continue

If you don't have cherry-picker installed, see the installation guide.

@bbovenzibbovenzi removed the backport-to-v3-3-test Backport to v3-3-test label Jul 23, 2026
dabla pushed a commit to dabla/airflow that referenced this pull request Aug 14, 2026
* Render DAG card content near the viewport
* Preload DAG cards from their scroll root
* Explain DAG card scroll root selection
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:UIRelated to UI/UX. For Frontend Developers.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rendering dags list page very slow

2 participants

@shivaam@bbovenzi