Add grouped spanning headers for column bands#314
Conversation
|
Self-review completed. I found and fixed an edge case where adjacent, distinct band objects with identical captions were merged into one spanning header. Commit ad7ee4a carries stable band identity alongside display segments and adds a headless regression test. Focused tests passed 4/4, the full unit suite passed 2,254/2,254, all six CI checks are successful, and git diff --check is clean. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ad7ee4adcd
ℹ️ 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
ColumnBandHeaderLayout.Groupedrendering for conventional horizontally spanning band headersResult
The sample band tree now renders in this structure:
Set the layout on the existing model:
Stackedremains the default and preserves the previous behavior where every leaf displays its complete path.Design
Model contract
ColumnBandHeadernow carries both the complete root-to-leafSegmentspath and the selectedLayout.DisplaySegmentskeeps the existing data template reusable: stacked headers display the full path, while grouped leaf headers display only their final segment.Changing
ColumnBandModel.HeaderLayoutrequests the normal model refresh, so all materialized definitions receive updated header metadata without view code or reflection.Header composition
DataGridColumnHeadersPresenterderives grouped cells from visible columns during measurement:DataGridColumnBandHeaderCellThe spanning cells are non-interactive. Sorting, filtering, resizing, reordering, focus, and automation for actual columns remain on the existing leaf
DataGridColumnHeadercontrols.Styling
DataGridColumnBandHeaderCellhas a dedicated control theme and the newDataGridColumnBandHeaderBorderThicknesstoken in both Simple and Fluent themes. Applications can restyle the public band-cell type without replacing grid input logic.Tests
Added headless coverage for:
Validation:
Avalonia.Controls.DataGrid.UnitTestsproject: 2253 passednet8.0,net10.0): succeeded46b9d7b92668fae7c98e57f712b87b96eed272016961b9df62f186be59dbecfcFixes #294
Review hardening
Follow-up review extended grouped-header auto sizing: a spanning group header contributes its natural measured width across eligible Auto/SizeToHeader leaf columns, distributes only the unmet width, and respects each column's maximum.
Current validation: 5/5 focused banded-header tests and the complete 2,255-test unit suite pass. Review threads are resolved.