Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8256 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 769 769
Lines 34436 34436
=========================================
Hits 34436 34436
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Reviewer's GuideIntroduce server-side configuration options for chart total data labels, tooltips, and category labels, replacing JavaScript interop-based customization in the Bar chart sample with new formatter properties on ChartDataSource.Options and corresponding initialization methods. 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 found 2 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="src/BootstrapBlazor.Server/Components/Samples/Charts/Bar.razor.cs" line_range="267-269" />
<code_context>
return Task.FromResult(ds);
}
+ private Task<ChartDataSource> OnInitCustomTooltip()
+ {
+ var ds = OnInit(false).Result;
+ ds.Options.TooltipTitleFormatter = "Day {label}";
+ ds.Options.TooltipLabelFormatter = " {datasetLabel}: {value} units";
</code_context>
<issue_to_address>
**issue (bug_risk):** Avoid blocking on the async OnInit(false) call with .Result inside OnInitCustomTooltip.
Blocking on `OnInit(false).Result` in a Blazor component can cause deadlocks and thread-pool exhaustion, and complicates async control flow. Make `OnInitCustomTooltip` async, use `await OnInit(false)`, and return `Task<ChartDataSource>` via async/await instead of `Task.FromResult` to keep the method fully asynchronous.
</issue_to_address>
### Comment 2
<location path="src/BootstrapBlazor.Server/Components/Samples/Charts/Bar.razor.cs" line_range="275-269" />
<code_context>
+ return Task.FromResult(ds);
+ }
+
+ private Task<ChartDataSource> OnInitCustomCategoryLabel()
+ {
+ var ds = OnInit(false).Result;
+ ds.Options.CategoryLabelFormatter = "Day {label}";
+ return Task.FromResult(ds);
</code_context>
<issue_to_address>
**issue (bug_risk):** OnInitCustomCategoryLabel should also avoid using .Result on the async OnInit(false) method.
This method also blocks synchronously on `OnInit(false).Result`. Please update it to be fully async (e.g., `private async Task<ChartDataSource> OnInitCustomCategoryLabel() { var ds = await OnInit(false); ... }`) to avoid potential deadlocks and keep it consistent with the rest of the async code.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| private Task<ChartDataSource> OnInitCustomTooltip() | ||
| { | ||
| var ds = OnInit(false).Result; |
There was a problem hiding this comment.
issue (bug_risk): Avoid blocking on the async OnInit(false) call with .Result inside OnInitCustomTooltip.
Blocking on OnInit(false).Result in a Blazor component can cause deadlocks and thread-pool exhaustion, and complicates async control flow. Make OnInitCustomTooltip async, use await OnInit(false), and return Task<ChartDataSource> via async/await instead of Task.FromResult to keep the method fully asynchronous.
|
|
||
| private Task<ChartDataSource> OnInitCustomTooltip() | ||
| { | ||
| var ds = OnInit(false).Result; |
There was a problem hiding this comment.
issue (bug_risk): OnInitCustomCategoryLabel should also avoid using .Result on the async OnInit(false) method.
This method also blocks synchronously on OnInit(false).Result. Please update it to be fully async (e.g., private async Task<ChartDataSource> OnInitCustomCategoryLabel() { var ds = await OnInit(false); ... }) to avoid potential deadlocks and keep it consistent with the rest of the async code.
Link issues
fixes #8243
fixes #8244
fixes #8245
Summary By Copilot
Regression?
Risk
Verification
Packaging changes reviewed?
☑️ Self Check before Merge
Summary by Sourcery
Add server-side configuration options for chart label and tooltip formatting and update bar chart samples to use these options instead of custom JavaScript modules.
New Features:
Enhancements: