fix(ag-grid): DH-21775: restore rows after clearing a filter that returned zero rows#1328
Merged
mofojed merged 3 commits intodeephaven:mainfrom Apr 8, 2026
Conversation
…urned zero rows
Reset cached viewport in handleFilterChanged so refreshViewport
recalculates from the grid's current display indices. Without this,
a stale viewport (e.g. {0, -1} from a zero-row filter result) was
reused after clearing the filter, leaving the grid empty.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes an AG Grid viewport caching edge case where clearing a filter that previously returned zero rows could leave the grid empty due to reusing a stale { firstRow: 0, lastRow: -1 } viewport.
Changes:
- Reset the cached viewport in
handleFilterChangedsorefreshViewport()recomputes from the grid’s current displayed row indices. - Add a Jest unit test that reproduces the “0 rows then clear filter” scenario and asserts a valid viewport is requested afterward.
- Add a Playwright e2e test to validate rows reappear after clearing a zero-result filter in the UI.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
plugins/ag-grid/src/js/src/datasources/DeephavenViewportDatasource.ts |
Clears currentViewport on filter change to prevent stale {0,-1} reuse after filter reset. |
plugins/ag-grid/src/js/src/datasources/DeephavenViewportDatasource.test.ts |
New unit test covering filter→zero rows→clear filter viewport recalculation behavior. |
tests/ag_grid.spec.ts |
New Playwright test exercising the regression via the AG Grid filter UI. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
dgodinez-dh
previously approved these changes
Apr 6, 2026
Contributor
dgodinez-dh
left a comment
There was a problem hiding this comment.
Looks fine, but there are some failures in the test file.
…urce.test.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
dgodinez-dh
approved these changes
Apr 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reset cached viewport in handleFilterChanged so refreshViewport
recalculates from the grid's current display indices. Without this,
a stale viewport (e.g. {0, -1} from a zero-row filter result) was
reused after clearing the filter, leaving the grid empty.