Repository navigation
Conversation
Reviewer's GuideThe PR fixes programmatic filter synchronization by routing condition-count changes through FilterContext into FilterProvider, restores aggregate String/Regex logic for two-condition filters, adds focused filter and ContextMenu tests, and bumps the package to 11.0.2-beta01. Sequence diagram for programmatic filter synchronizationsequenceDiagram
participant FilterProvider
participant Filter as FilterBase
participant FilterContext
FilterProvider->>FilterContext: create FilterContext
FilterProvider->>Filter: SetFilterConditionsAsync(filter)
Filter->>Filter: SetCount(filter.Filters.Count > 1 ? 1 : 0)
Filter->>FilterContext: CountChanged(count)
FilterContext-->>FilterProvider: OnCountChanged(count)
FilterProvider->>FilterProvider: StateHasChanged()
Flow diagram for restoring two-condition filter logicflowchart LR
A[Programmatic filter with two conditions] --> B[StringFilter or RegexFilter]
B --> C[Read second condition]
C --> D[Set Logic from filter.FilterLogic]
D --> E[SetFilterConditionsAsync]
E --> F[FilterProvider count synchronized]
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 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="src/BootstrapBlazor/Components/Filters/FilterBase.cs" line_range="206" />
<code_context>
- public virtual Task SetFilterConditionsAsync(FilterKeyValueAction filter) => OnFilterAsync();
+ public virtual Task SetFilterConditionsAsync(FilterKeyValueAction filter)
+ {
+ SetCount(filter.Filters.Count > 1 ? 1 : 0);
+ return OnFilterAsync();
+ }
</code_context>
<issue_to_address>
**Multi-selection enables extra condition**
When `MultiFilter` or `MultiSelectFilter` receives multiple selected values inside a `FilterProvider` with `ShowMoreButton` enabled, `SetFilterConditionsAsync` counts selected values as condition slots, so the provider enables its extra-condition control even though the filter has no second condition to add or remove.
Set the provider count based on whether the filter supports a second condition, rather than on the number of entries in `filter.Filters`.
</issue_to_address>Sourcery assessment
Approval pending. 1 finding to address first.
Blocking findings: src/BootstrapBlazor/Components/Filters/FilterBase.cs:206
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8549 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 775 775
Lines 35151 35162 +11
=========================================
+ Hits 35151 35162 +11
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:
|
Link issues
fixes #8544
Summary By Copilot
Synchronize filter counts with FilterProvider so programmatic filters retain both conditions. Restore String/Regex filter logic, add focused filter and ContextMenu tests, and bump the package to 11.0.2-beta01.
Regression?
No newly introduced regression identified; the issue reports existing behavior in 11.0.0 and 11.0.1.
Risk
Changes are limited to filter state synchronization, logic restoration, tests, and the package version.
Verification
dotnet build test\UnitTest\UnitTest.csproj --no-restore --nologo -v:q— passed, 0 warnings/errors.git --no-pager diff --check origin/main...HEAD— passed.Unit tests and manual verification were not run; tests are reserved for the author's manual coverage review.
Packaging changes reviewed?
Package version updated from 11.0.1 to 11.0.2-beta01.
☑️ Self Check before Merge
Summary by Sourcery
Preserve programmatic filter state while keeping provider counts and multi-condition filter logic consistent.
Bug Fixes:
Build:
Tests: