-
-
Notifications
You must be signed in to change notification settings - Fork 363
feat(Table): add AutoSearchOnInput parameter #6306
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-Authored-By: Jaders77 <[email protected]>
Reviewer's GuideThis PR adds an AutoSearchOnInput flag to the Table component so that searches fire automatically on each input change, refactors the search input markup to use explicit Value/OnValueChanged handlers with the new UseInputEvent setting, implements the corresponding change handler to trigger searches programmatically, and updates the unit tests to cover the new behavior. Sequence diagram for search triggering with AutoSearchOnInputsequenceDiagram
participant User as actor User
participant Table as Table<TItem>
participant BootstrapInput
User->>BootstrapInput: types in search box
BootstrapInput-->>Table: OnValueChanged (if AutoSearchOnInput=true)
Table->>Table: OnSearchTextValueChanged(value)
Table->>Table: SearchClick()
Table-->>User: Updates search results
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces the AutoSearchOnInput parameter to enable automatic search triggering when input values change, addressing issue #6283. The key changes include:
- Converting the OnSearchKeyUp test method to asynchronous and adding a change event simulation.
- Adding the AutoSearchOnInput parameter with accompanying documentation in Table.razor.cs.
- Implementing a new OnSearchTextValueChanged method to trigger searches on input change and updating the BootstrapInput components accordingly.
- Bumping the project version in the csproj file.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| test/UnitTest/Components/TableTest.cs | Updated test method to async form and simulated additional change. |
| src/BootstrapBlazor/Components/Table/Table.razor.cs | Added AutoSearchOnInput parameter with documentation. |
| src/BootstrapBlazor/Components/Table/Table.razor.Search.cs | Introduced OnSearchTextValueChanged to trigger search on input change. |
| src/BootstrapBlazor/Components/Table/Table.razor | Modified input components to use OnValueChanged and UseInputEvent. |
| src/BootstrapBlazor/BootstrapBlazor.csproj | Incremented project version. |
Comments suppressed due to low confidence (1)
test/UnitTest/Components/TableTest.cs:392
- Consider adding a separate test case where AutoSearchOnInput is enabled to verify that the search is automatically triggered upon input changes.
pb.Add(a => a.AutoSearchOnInput, false);
| /// <returns></returns> | ||
| protected List<IFilterAction> GetSearches() => Columns.Where(col => col.GetSearchable()).ToSearches(SearchText); | ||
|
|
||
| private async Task OnSearchTextValueChanged(string? value) |
Copilot
AI
Jun 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since OnSearchTextValueChanged triggers a search on every input change when AutoSearchOnInput is enabled, consider debouncing the invocation of SearchClick to mitigate potential performance issues during rapid input.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @ArgoZhang - I've reviewed your changes and they look great!
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6306 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 714 714
Lines 31452 31457 +5
Branches 4438 4438
=========================================
+ Hits 31452 31457 +5
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 #6283
Summary By Copilot
Regression?
Risk
Verification
Packaging changes reviewed?
☑️ Self Check before Merge
Summary by Sourcery
Add a new AutoSearchOnInput parameter to the Table component to enable automatic searches when the user types by wiring the search inputs to use Value/OnValueChanged with an InputEvent binding and invoking the search handler on input change.
New Features:
Enhancements:
Tests: