Reconcile realized rows after collapsing all groups#320
Conversation
|
Self-review completed. I reviewed the collapse-all batch reconciliation point, realized-row cleanup behavior, viewport-bounded work, and regression coverage; no additional actionable findings were found. All six CI checks are successful, the branch is synchronized, and git diff --check is clean. This PR is ready for review. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 15920190cf
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ca8d1a0dc0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c96857fa5e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Summary
CollapseAllGroups()finishes updating every group and collapsed-slot rangeRoot cause
CollapseAllGroups()collapses headers one at a time throughEnsureRowGroupVisibilityandUpdateRowGroupVisibility. The collapse path intentionally performs incremental removals from the circular realized-element buffer withupdateSlotInformation: false, then updates_collapsedSlotsTableafterward. A per-groupUpdateDisplayedRowsreconciliation only occurs for some scroll-anchor positions.For distribution-sensitive multi-level grouping, those incremental operations can leave a viewport-sized run of realized
DataGridRowcontrols outside the final visible slot set. The group model and collapsed-slot table are already correct, which is why a later scroll, resize, or expansion repairs the display, butCollapseAllGroups()previously had no final display reconciliation of its own.Fix
After every group has been collapsed and the collapsed-slot table has settled,
CollapseAllGroups()performs one final realization rebuild. For legacy scrolling it derives the first visible header and partial-row offset from the adjusted scrollbar offset; logical scrolling continues through its anchor-alignment path. The reconciliation runs once per explicit collapse-all gesture and adds no work to regular scrolling.Regression coverage
The new headless test creates:
It performs collapse → expand → collapse to exercise display-list reuse, confirms rows are realized after expansion, and then asserts immediately after the final
CollapseAllGroups()call that no visible leafDataGridRowremains.Validation
Avalonia.Controls.DataGrid.UnitTestsheadless suite: 2,251 passed, 0 failednet8.0,net10.0): 0 errors; existing repository warnings onlygit diff --check: cleanCloses #309
Review hardening
Follow-up review expanded the final reconciliation beyond stale-row removal:
Current validation: 6/6 focused collapse/expand tests and 2,252/2,252 full unit tests pass. Review threads are resolved.