Skip to content

Stop re-rendering the whole Grid on every hover - #69912

Merged
bbovenzi merged 1 commit into
apache:mainfrom
astronomer:grid-hover-perf
Jul 15, 2026
Merged

Stop re-rendering the whole Grid on every hover#69912
bbovenzi merged 1 commit into
apache:mainfrom
astronomer:grid-hover-perf

Conversation

@pierrejeambrun

Copy link
Copy Markdown
Member

Every cell in the Dag Grid view subscribed to a shared hover context, so hovering any cell changed the context value and re-rendered the entire grid — the interaction lag reported in #69531, which worsens as the Dag grows. This moves the run-column / task-row crosshair highlight to a single delegated pointerover handler that toggles CSS classes on the matching cells by data-run-id/data-task-id, so hovering does no React render work; the same delegated root covers the gantt so the shared row highlight stays in sync.

Measured on a ~20-run × 20-task grid (React Profiler): commits per hover dropped from ~3.0 to ~0.07 — hovering now does essentially zero React work. Appearance is unchanged (same crosshair highlight; selected cells still win).

The separate stream-driven full-grid re-render (the other cause of grid slowness in #69531) is addressed in a stacked follow-up on top of this branch.

related: #69531


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

Every cell in the Dag Grid view subscribed to a shared hover context, so
hovering any cell changed the context value and re-rendered the entire grid.
On a ~20-run x 20-task grid that measured ~3 React commits plus full-grid
render work per hover — the interaction lag reported in the issue, which only
gets worse as the Dag grows.

Move the run-column / task-row crosshair highlight to a single delegated
pointerover handler that toggles CSS classes on the matching cells by
data-run-id / data-task-id, so hovering does no React render work at all. The
same delegated root covers the gantt so the shared row highlight stays in sync.
Measured on the same grid, React commits per hover dropped from ~3.0 to ~0.07.

related: apache#69531
@boring-cyborg boring-cyborg Bot added the area:UI Related to UI/UX. For Frontend Developers. label Jul 15, 2026
@pierrejeambrun pierrejeambrun self-assigned this Jul 15, 2026
@pierrejeambrun pierrejeambrun added this to the Airflow 3.3.1 milestone Jul 15, 2026
@pierrejeambrun pierrejeambrun added the backport-to-v3-3-test Backport to v3-3-test label Jul 15, 2026
@pierrejeambrun
pierrejeambrun marked this pull request as ready for review July 15, 2026 12:11
@pierrejeambrun

Copy link
Copy Markdown
Member Author

Before

Screen.Recording.2026-07-15.at.15.00.47.mov

After

Screen.Recording.2026-07-15.at.15.02.05.mov

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

Great! Yes, we should've done the hovering in css a while ago. Thanks

@bbovenzi
bbovenzi merged commit ae6188d into apache:main Jul 15, 2026
170 checks passed
@bbovenzi
bbovenzi deleted the grid-hover-perf branch July 15, 2026 14:11
@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.

Status Branch Result
v3-3-test Commit Link

You can attempt to backport this manually by running:

cherry_picker ae6188d 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.

bbovenzi pushed a commit that referenced this pull request Jul 15, 2026
Every cell in the Dag Grid view subscribed to a shared hover context, so
hovering any cell changed the context value and re-rendered the entire grid.
On a ~20-run x 20-task grid that measured ~3 React commits plus full-grid
render work per hover — the interaction lag reported in the issue, which only
gets worse as the Dag grows.

Move the run-column / task-row crosshair highlight to a single delegated
pointerover handler that toggles CSS classes on the matching cells by
data-run-id / data-task-id, so hovering does no React render work at all. The
same delegated root covers the gantt so the shared row highlight stays in sync.
Measured on the same grid, React commits per hover dropped from ~3.0 to ~0.07.

related: #69531
(cherry picked from commit ae6188d)
joshuabvarghese pushed a commit to joshuabvarghese/airflow that referenced this pull request Jul 16, 2026
Every cell in the Dag Grid view subscribed to a shared hover context, so
hovering any cell changed the context value and re-rendered the entire grid.
On a ~20-run x 20-task grid that measured ~3 React commits plus full-grid
render work per hover — the interaction lag reported in the issue, which only
gets worse as the Dag grows.

Move the run-column / task-row crosshair highlight to a single delegated
pointerover handler that toggles CSS classes on the matching cells by
data-run-id / data-task-id, so hovering does no React render work at all. The
same delegated root covers the gantt so the shared row highlight stays in sync.
Measured on the same grid, React commits per hover dropped from ~3.0 to ~0.07.

related: apache#69531
vatsrahul1001 pushed a commit that referenced this pull request Aug 5, 2026
Every cell in the Dag Grid view subscribed to a shared hover context, so
hovering any cell changed the context value and re-rendered the entire grid.
On a ~20-run x 20-task grid that measured ~3 React commits plus full-grid
render work per hover — the interaction lag reported in the issue, which only
gets worse as the Dag grows.

Move the run-column / task-row crosshair highlight to a single delegated
pointerover handler that toggles CSS classes on the matching cells by
data-run-id / data-task-id, so hovering does no React render work at all. The
same delegated root covers the gantt so the shared row highlight stays in sync.
Measured on the same grid, React commits per hover dropped from ~3.0 to ~0.07.

related: #69531
(cherry picked from commit ae6188d)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:UI Related to UI/UX. For Frontend Developers. backport-to-v3-3-test Backport to v3-3-test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants