fix(datagrid): apply per-column CSS class#302
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe DataGrid now inserts a Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #302 +/- ##
==========================================
- Coverage 96.95% 92.96% -4.00%
==========================================
Files 70 166 +96
Lines 1542 2754 +1212
Branches 150 404 +254
==========================================
+ Hits 1495 2560 +1065
- Misses 28 103 +75
- Partials 19 91 +72 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
🧹 Nitpick comments (2)
src/LumexUI/Components/DataGrid/LumexDataGrid.razor (1)
200-208: Consider adding@keydirective for consistency.Other loops in this component (e.g.,
RenderColumnHeaders,RenderRow,RenderPlaceholderRow) use@key="@column"to help Blazor's diffing algorithm. For consistency, consider adding it here as well.♻️ Suggested change
private void RenderColGroup( RenderTreeBuilder __builder ) { <colgroup> `@foreach`(var column in _columns ) { - <col class="@column.Class" /> + <col class="@column.Class" `@key`="@column" /> } </colgroup> }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/LumexUI/Components/DataGrid/LumexDataGrid.razor` around lines 200 - 208, The RenderColGroup method renders a foreach over _columns but omits the `@key` directive used elsewhere; update RenderColGroup to add `@key`="@column" on the <col> element so Blazor's diffing is consistent with RenderColumnHeaders/RenderRow/RenderPlaceholderRow—locate the RenderColGroup method and add the `@key` attribute to the <col class="@column.Class" /> element.src/LumexUI/Components/DataGrid/LumexDataGrid.razor.cs (1)
227-227: Inconsistent indentation: tabs instead of spaces.Line 227 uses a tab character for indentation while the surrounding code (lines 228-231) uses spaces. This inconsistency should be fixed to maintain code style consistency.
🧹 Suggested fix
- _renderColGroup = RenderColGroup; + _renderColGroup = RenderColGroup;🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/LumexUI/Components/DataGrid/LumexDataGrid.razor.cs` at line 227, The assignment statement "_renderColGroup = RenderColGroup;" uses a tab for indentation while the surrounding block uses spaces; replace the leading tab with the same number of spaces used in adjacent lines so the "_renderColGroup = RenderColGroup;" line matches the file's space-based indentation style, leaving the symbol names and statement unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/LumexUI/Components/DataGrid/LumexDataGrid.razor`:
- Around line 200-208: The RenderColGroup method renders a foreach over _columns
but omits the `@key` directive used elsewhere; update RenderColGroup to add
`@key`="@column" on the <col> element so Blazor's diffing is consistent with
RenderColumnHeaders/RenderRow/RenderPlaceholderRow—locate the RenderColGroup
method and add the `@key` attribute to the <col class="@column.Class" /> element.
In `@src/LumexUI/Components/DataGrid/LumexDataGrid.razor.cs`:
- Line 227: The assignment statement "_renderColGroup = RenderColGroup;" uses a
tab for indentation while the surrounding block uses spaces; replace the leading
tab with the same number of spaces used in adjacent lines so the
"_renderColGroup = RenderColGroup;" line matches the file's space-based
indentation style, leaving the symbol names and statement unchanged.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 0522455f-2d84-464a-b1fa-9bd30d2be506
📒 Files selected for processing (2)
src/LumexUI/Components/DataGrid/LumexDataGrid.razorsrc/LumexUI/Components/DataGrid/LumexDataGrid.razor.cs
Description
This PR fixes an issue where per-column CSS classes in DataGrid component were not applied.
What's been done?
Checklist
Additional Notes
https://discord.com/channels/1310668690337038346/1488092450852704397
Summary by CodeRabbit