-
-
Notifications
You must be signed in to change notification settings - Fork 362
feat(SelectCity): add ShowSearch parameter #6933
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
Reviewer's GuideThis PR introduces the ShowSearch, AutoClose, IsMultiple, and IsDisabled parameters to the SelectCity component by enriching its sample demo with interactive toggles and backing fields, enhances the base popover JavaScript module with a shownCallback hook, adjusts the OtpInputs sample wrapper for documentation, and includes project and localization file updates. Class diagram for updated SelectCities component backing fieldsclassDiagram
class SelectCities {
string? _value
bool _showSearch
bool _isMultiple
bool _isDisabled
bool _autoClose
}
Flow diagram for Popover shownCallback invocationflowchart TD
A["Popover.show() called"] --> B["Append content to body"]
B --> C{"shownCallback is not null?"}
C -- Yes --> D["Invoke shownCallback()"]
C -- No --> E["Do nothing"]
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.
Hey there - I've reviewed your changes - here's some feedback:
- In SelectCities.razor, the ShowSearch, IsMultiple, IsDisabled, and AutoClose attributes should use Razor bindings (e.g. ShowSearch="@_showSearch") instead of plain strings to correctly bind the boolean fields.
- The repeated BootstrapInputGroup + Switch blocks could be refactored into a small reusable component or loop to reduce boilerplate and improve sample maintainability.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In SelectCities.razor, the ShowSearch, IsMultiple, IsDisabled, and AutoClose attributes should use Razor bindings (e.g. ShowSearch="@_showSearch") instead of plain strings to correctly bind the boolean fields.
- The repeated BootstrapInputGroup + Switch blocks could be refactored into a small reusable component or loop to reduce boilerplate and improve sample maintainability.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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds a ShowSearch parameter to the SelectCity sample and updates related UI/demo code. Also introduces a shownCallback hook to the base popover module and removes now-obsolete localization strings tied to the old multiple-selection demo.
- Add ShowSearch, IsMultiple, IsDisabled, and AutoClose toggles to the SelectCity sample
- Introduce shownCallback in base-popover.js to notify when content is appended
- Remove unused localization keys and bump BootstrapBlazor.Region package version
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/BootstrapBlazor/wwwroot/modules/base-popover.js | Adds shownCallback option and invokes it after content is appended, aligning popover lifecycle hooks with new demo behavior. |
| src/BootstrapBlazor.Server/Locales/zh-CN.json | Removes unused multiple-selection strings for SelectCity demo. |
| src/BootstrapBlazor.Server/Locales/en-US.json | Removes unused multiple-selection strings for SelectCity demo. |
| src/BootstrapBlazor.Server/Components/Samples/SelectCities.razor.cs | Adds backing fields for new demo toggles (ShowSearch, IsMultiple, IsDisabled, AutoClose). |
| src/BootstrapBlazor.Server/Components/Samples/SelectCities.razor | Replaces multiple-selection demo with a single configurable demo and wires new parameters to SelectCity. |
| src/BootstrapBlazor.Server/Components/Samples/OtpInputs.razor | Minor markup change (div to section) in demo layout; unrelated to SelectCity but included in this PR. |
| src/BootstrapBlazor.Server/BootstrapBlazor.Server.csproj | Bumps BootstrapBlazor.Region to 9.0.4. |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6933 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 740 740
Lines 31815 31815
Branches 4469 4469
=========================================
Hits 31815 31815
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 #6932
Summary By Copilot
Regression?
Risk
Verification
Packaging changes reviewed?
☑️ Self Check before Merge
Summary by Sourcery
Introduce configurable ShowSearch, AutoClose, multiple selection, and disabled state options to the SelectCity demo, unify the demo blocks, add a shownCallback hook to the Popover JS module, and adjust the OtpInputs sample wrapper for correct rendering.
New Features:
Enhancements: