Skip to content

Clarify mapViewportColumns docs, skip unneeded colSpan args, and test header and summary rows - #4226

Merged
nstepien merged 4 commits into
mainfrom
colspan-followups
Oct 23, 2026
Merged

nstepien merged 4 commits into
mainfrom
colspan-followups

Conversation

@nstepien

@nstepien nstepien commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

Follow-ups to #4225 from a review of it.

Docs

The mapViewportColumns JSDoc, mirrored in the README, said the active cell is always rendered. Two cases weren't covered:

  • When virtualization would leave out the active row, DataGrid still renders it, but its mapViewportColumns only maps the active cell, or nothing when the whole row is active.
  • A cell's colSpan can cover the active column, which is then skipped like any other spanned column.

Fewer allocations in the startIdx memo

The memo built the colSpan args of every rendered row whenever colOverscanStartIdx > 0 and any column had colSpan, even when no column could span into the overscan range, e.g., when every colSpan column is frozen or after the range. It now looks for candidate columns first, and only builds the args when there are some.

Tests

The regression tests for cells hidden by colSpan only covered data rows, but the bug also affected header and summary rows. The three tests now run on all three row types. All 9 fail on the parent of #4225 and pass now.

🤖 Generated with Claude Code

…test header and summary rows

- Document that an active row left out by virtualization only renders its
  active cell, and that a cell's colSpan can skip the active column too
- Only build the colSpan args of the rendered rows when an unfrozen column
  before the overscan range could span into it
- Run the colSpan regression tests on header and summary rows as well

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@codecov-commenter

codecov-commenter commented Oct 23, 2026 •

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.58%. Comparing base (3f99763) to head (2165cce).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4226   +/-   ##
=======================================
  Coverage   98.58%   98.58%           
=======================================
  Files          46       46           
  Lines        1984     1985    +1     
  Branches      750      750           
=======================================
+ Hits         1956     1957    +1     
  Misses         28       28           
Files with missing lines Coverage Δ
src/hooks/useViewportColumns.ts 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@nstepien
nstepien merged commit f1dfede into main Oct 23, 2026
6 checks passed
@nstepien
nstepien deleted the colspan-followups branch October 23, 2026 16:42
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