refactor(Table): add DisplayName parameter event invisible#8011
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAdjusts table column visibility handling so that DisplayName is always updated from the corresponding column definition, even when the column is invisible, while still only caching visible columns. Flow diagram for updated ResetVisibleColumnsCache visibility and DisplayName handlingflowchart TD
A[Start ResetVisibleColumnsCache] --> B[Loop over _tableColumnStates]
B --> C[Get current item]
C --> D[Find col in Columns by GetFieldName == item.Name]
D --> E{col != null?}
E -->|No| F[Next item]
E -->|Yes| G[Set item.DisplayName = col.GetDisplayName]
G --> H{item.Visible?}
H -->|Yes| I[Add col to _visibleColumnsCache]
H -->|No| F
I --> F
F --> J{More items?}
J -->|Yes| B
J -->|No| K[End ResetVisibleColumnsCache]
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- In
ResetVisibleColumnsCache, consider inverting the condition to early-continue whencolis null (e.g.,if (col is null) continue;) so the main logic (updatingDisplayNameand optionally adding to_visibleColumnsCache) is less nested and easier to follow.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In `ResetVisibleColumnsCache`, consider inverting the condition to early-continue when `col` is null (e.g., `if (col is null) continue;`) so the main logic (updating `DisplayName` and optionally adding to `_visibleColumnsCache`) is less nested and easier to follow.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
There was a problem hiding this comment.
Pull request overview
This PR addresses #8010 by ensuring TableColumnState.DisplayName is updated even when a column is currently invisible, so the column list UI can still render correct labels for hidden columns.
Changes:
- Update
ResetVisibleColumnsCache()to setDisplayNamefor both visible and invisible columns. - Keep visible-columns cache behavior the same (only visible columns are added).
- Bump package version to
10.6.1-beta22.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/BootstrapBlazor/Components/Table/Table.razor.Toolbar.cs | Ensures column state DisplayName is refreshed regardless of visibility while maintaining the visible-columns cache. |
| src/BootstrapBlazor/BootstrapBlazor.csproj | Version bump to 10.6.1-beta22. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8011 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 766 766
Lines 34123 34123
Branches 4692 4692
=========================================
Hits 34123 34123
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Link issues
fixes #8010
Summary By Copilot
Regression?
Risk
Verification
Packaging changes reviewed?
☑️ Self Check before Merge
Summary by Sourcery
Bug Fixes: