Skip to content

fix(data-grid): wait for nested shadow components before measuring - #2554

Merged
amir-ba merged 1 commit into
mainfrom
fix/data-grid-shadow-readiness
Oct 7, 2026
Merged

amir-ba merged 1 commit into
mainfrom
fix/data-grid-shadow-readiness

Conversation

@amir-ba

@amir-ba amir-ba commented Oct 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fix the remaining data-grid readiness issue from #2552. Wait for each component before traversing its light-DOM and shadow-DOM children, so children created during hydration are included before auto-width measurement.

 calculateAutoWidths
-  await light-DOM descendants
+  await each cell recursively through light DOM and shadow roots
   await fonts
   measure widths

Extend the existing regression test with a delayed component inside two shadow roots. Keep the existing light-DOM case and stale fields/rows guard. No public API change.

Evidence

  • Before: The new nested-shadow case fails: expected width auto, received 12 before hydration completes.
  • After: Both readiness cases pass and the hydrated width is 120.
  • Core build and lint pass.
  • Core specs: 62 suites, 360 tests, 168 unchanged snapshots.
  • Core E2E: 35 suites, 78 tests pass.
  • Pinned Linux Chromium data-grid visuals: 26 cases pass in light/dark mode with snapshot updates disabled. No baselines changed.
  • Changed-file Prettier and whitespace checks pass.

Merge Danger

Door: two-way

Blast Radius: data-grid

Only automatic column measurement timing changes. Existing visual baselines are unchanged. A descendant that never resolves componentOnReady() will continue to delay measurement, as a light-DOM descendant already does.

Copilot AI balanced review requested due to automatic review settings October 7, 2026 15:33
@amir-ba
amir-ba requested a review from maomaoZH as a code owner October 7, 2026 15:33

Copilot AI 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.

🟢 Approval recommended

The implementation matches the stated scope and provides focused regression coverage without introducing unresolved issues.

0 open findings

What changed in this PR

Ensures DataGrid auto-width measurement includes content hydrated within nested shadow roots.

Changes:

  • Recursively waits for light- and shadow-DOM descendants before measurement.
  • Extends regression coverage for light DOM and two nested shadow roots.
File Description
data-grid.tsx Adds recursive component readiness traversal.
data-grid.spec.ts Tests delayed hydration across light and nested shadow DOM.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@amir-ba
amir-ba merged commit b926a0f into main Oct 7, 2026
12 checks passed
@amir-ba
amir-ba deleted the fix/data-grid-shadow-readiness branch October 7, 2026 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants