Skip to content

feat(Region): bump version 9.0.7#618

Merged
ArgoZhang merged 2 commits intomasterfrom
refactor-region
Oct 18, 2025
Merged

feat(Region): bump version 9.0.7#618
ArgoZhang merged 2 commits intomasterfrom
refactor-region

Conversation

@ArgoZhang
Copy link
Copy Markdown
Member

@ArgoZhang ArgoZhang commented Oct 18, 2025

Link issues

fixes #617

Summary By Copilot

Regression?

  • Yes
  • No

Risk

  • High
  • Medium
  • Low

Verification

  • Manual (required)
  • Automated

Packaging changes reviewed?

  • Yes
  • No
  • N/A

☑️ Self Check before Merge

⚠️ Please check all items below before review. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • Merge the latest code from the main branch

Summary by Sourcery

Bump the region component to version 9.0.7 and enhance the city selector by integrating an injectable PinyinService for improved pinyin search and streamlined code.

New Features:

  • Support injecting a PinyinService into the SelectCity component for pinyin-based searching

Bug Fixes:

Enhancements:

  • Replace static pinyin utility methods with injected IPinyinService calls and remove local Chinese detection logic
  • Register the PinyinService in the region service extension for dependency injection

Build:

  • Bump BootstrapBlazor.Region version to 9.0.7

Copilot AI review requested due to automatic review settings October 18, 2025 11:58
@bb-auto bb-auto Bot added the enhancement New feature or request label Oct 18, 2025
@bb-auto bb-auto Bot added this to the v9.2.0 milestone Oct 18, 2025
@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented Oct 18, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

This PR bumps the Region package to v9.0.7 and refactors the pinyin handling by replacing static calls with an injected IPinyinService, removing the old local implementation, and updating DI registration accordingly.

Class diagram for refactored SelectCity component with IPinyinService injection

classDiagram
    class SelectCity {
        +bool AutoClose
        +IPinyinService PinyinService
        -string? ClassString
        -string? GetActiveClass(string item)
        -HashSet<string> GetProvinces()
        -HashSet<ProvinceItem> GenerateProvincePinYin()
        -HashSet<CityItem> GenerateCityPinYin(string provinceName)
    }
    SelectCity --> IPinyinService
Loading

Class diagram for IPinyinService usage

classDiagram
    class IPinyinService {
        +string GetFirstLetters(string text)
        +bool IsChinese(string text)
    }
    SelectCity --> IPinyinService
Loading

File-Level Changes

Change Details Files
Inject and use IPinyinService instead of static PinYinService
  • Added an injected IPinyinService property with [Inject] and [NotNull] attributes
  • Replaced PinYinService.GetFirstLetters calls with PinyinService.GetFirstLetters in GetActiveClass, GenerateProvincePinYin, and GenerateCityPinYin
src/components/BootstrapBlazor.Region/Components/SelectCity.razor.cs
Switch Chinese character check to IPinyinService
  • Removed local IsChinese method
  • Replaced IsChinese(_searchText) with PinyinService.IsChinese(_searchText)
src/components/BootstrapBlazor.Region/Components/SelectCity.razor.cs
Register PinyinService in dependency injection
  • Added services.AddPinyinService() in ServiceCollectionExtension
src/components/BootstrapBlazor.Region/Extensions/ServiceCollectionExtension.cs
Remove old static PinYinService implementation
  • Deleted PinYinService.cs file
src/components/BootstrapBlazor.Region/Services/PinYinService.cs
Bump Region package version to 9.0.7
  • Updated version number in the project file
src/components/BootstrapBlazor.Region/BootstrapBlazor.Region.csproj

Assessment against linked issues

Issue Objective Addressed Explanation
#617 Add dependency on BootstrapBlazor.Pinyin to the Region component.

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@ArgoZhang ArgoZhang merged commit 5e009f9 into master Oct 18, 2025
0 of 2 checks passed
@ArgoZhang ArgoZhang deleted the refactor-region branch October 18, 2025 11:58
Copy link
Copy Markdown

Copilot AI left a 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 bumps the version of BootstrapBlazor.Region from 9.0.6 to 9.0.7 and refactors the PinYin functionality by removing the internal PinYinService class and replacing it with a dependency on the BootstrapBlazor.Pinyin package.

  • Removes internal PinYinService implementation and replaces with external package dependency
  • Updates service registration to use the new external pinyin service
  • Refactors SelectCity component to use injected IPinyinService instead of static PinYinService

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
BootstrapBlazor.Region.csproj Version bump to 9.0.7 and added BootstrapBlazor.Pinyin package reference
ServiceCollectionExtension.cs Added pinyin service registration
SelectCity.razor.cs Refactored to use injected IPinyinService and removed local IsChinese method
PinYinService.cs Entire file deleted - internal implementation removed

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a 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 and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(Region): bump version 9.0.7

2 participants