feat(Table): remove AutoSearchOnInput parameter#7674
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAdds a new AutoSearchOnValueChanged parameter to the Table component and wires the search box value-changed event to optionally trigger a search when the text changes. Sequence diagram for auto search on search text value changesequenceDiagram
actor User
participant SearchInput
participant Table_TItem as Table_TItem
participant SearchService
User->>SearchInput: Type_in_search_text
SearchInput->>Table_TItem: OnSearchTextValueChanged(value)
activate Table_TItem
Table_TItem->>Table_TItem: Set_SearchText(value)
alt AutoSearchOnValueChanged_is_true
Table_TItem->>Table_TItem: SearchClick()
activate Table_TItem
Table_TItem->>SearchService: ExecuteSearch(SearchText)
SearchService-->>Table_TItem: SearchResults
deactivate Table_TItem
else AutoSearchOnValueChanged_is_false
Table_TItem-->>User: Wait_for_manual_search_trigger
end
deactivate Table_TItem
Class diagram for updated Table component search parametersclassDiagram
class Table_TItem {
+bool AutoSearchOnInput
+bool AutoSearchOnValueChanged
-string SearchText
+List~IFilterAction~ GetSearches()
+Task OnSearchTextValueChanged(string value)
+Task SearchClick()
}
class IFilterAction
Table_TItem ..> IFilterAction : uses
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:
- The interaction and behavioral difference between
AutoSearchOnInputandAutoSearchOnValueChangedis not obvious from the code; consider either consolidating these options or clarifying (e.g., via naming or XML comments) when one should be used over the other to avoid confusion for consumers. - In
OnSearchTextValueChanged, you might want to short-circuit whenvalue == SearchTextto avoid triggering redundant searches for unchanged text values.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The interaction and behavioral difference between `AutoSearchOnInput` and `AutoSearchOnValueChanged` is not obvious from the code; consider either consolidating these options or clarifying (e.g., via naming or XML comments) when one should be used over the other to avoid confusion for consumers.
- In `OnSearchTextValueChanged`, you might want to short-circuit when `value == SearchText` to avoid triggering redundant searches for unchanged text values.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7674 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 749 749
Lines 33192 33190 -2
Branches 4603 4603
=========================================
- Hits 33192 33190 -2
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:
|
There was a problem hiding this comment.
Pull request overview
This PR adds a new AutoSearchOnValueChanged parameter to the Table component that enables automatic search triggering when the fuzzy search bar's value changes. This complements the existing AutoSearchOnInput parameter, which triggers search on every keystroke. The new parameter is intended to provide a less aggressive search behavior that triggers only when the value is committed (e.g., on blur).
Changes:
- Added
AutoSearchOnValueChangedboolean parameter to Table component (defaults to false) - Implemented
OnSearchTextValueChangedcallback method that triggers search when the parameter is enabled
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/BootstrapBlazor/Components/Table/Table.razor.cs | Adds new AutoSearchOnValueChanged parameter with bilingual documentation |
| src/BootstrapBlazor/Components/Table/Table.razor.Search.cs | Implements OnSearchTextValueChanged handler method to trigger search on value change |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Link issues
fixes #7673
Summary By Copilot
Regression?
Risk
Verification
Packaging changes reviewed?
☑️ Self Check before Merge
Summary by Sourcery
New Features: