Skip to content

doc(Components): update xml comments#7560

Merged
ArgoZhang merged 1 commit intomainfrom
doc-error
Jan 21, 2026
Merged

doc(Components): update xml comments#7560
ArgoZhang merged 1 commit intomainfrom
doc-error

Conversation

@ArgoZhang
Copy link
Copy Markdown
Member

@ArgoZhang ArgoZhang commented Jan 21, 2026

Link issues

fixes #7559

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

Polish component documentation and sample code formatting across toast extensions, localization helpers, and tree view samples.

Enhancements:

  • Tidy up tree view sample logging message spacing and draggable item list formatting.
  • Normalize the Error page Razor file formatting and newline handling.

Documentation:

  • Improve English XML documentation for ToastService extension methods and TabItemContent, and simplify parameter doc comments.
  • Clarify Xml documentation for JsonLocalizationOptions extensions with proper cref references and remove redundant inline comments.

Copilot AI review requested due to automatic review settings January 21, 2026 10:44
@bb-auto bb-auto Bot added the documentation Improvements or additions to documentation label Jan 21, 2026
@bb-auto bb-auto Bot added this to the v10.2.0 milestone Jan 21, 2026
@ArgoZhang ArgoZhang merged commit 87ba5bc into main Jan 21, 2026
7 of 8 checks passed
@ArgoZhang ArgoZhang deleted the doc-error branch January 21, 2026 10:44
@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai Bot commented Jan 21, 2026

Reviewer's Guide

Updates and cleans up documentation comments and minor formatting across several components and extensions, primarily improving English XML docs, simplifying param tags, and removing redundant inline comments and whitespace.

File-Level Changes

Change Details Files
Normalize and simplify XML documentation for ToastService extension methods.
  • Improve English summaries for ToastService shortcut methods (success, error, information, warning).
  • Simplify parameter XML doc tags to bare param names without nested language-specific descriptions.
  • Keep method signatures and behavior unchanged.
src/BootstrapBlazor/Extensions/ToastServiceExtensions.cs
Clean up localization extension docs and remove redundant commented guidance.
  • Reference JsonLocalizationOptions via cref in XML docs for better navigation.
  • Remove inline bilingual comment blocks that duplicated code intent.
  • Retain existing logic for resource stream discovery and configuration building unchanged.
src/BootstrapBlazor/Extensions/LocalizationOptionsExtensions.cs
Minor content and formatting tweaks in sample components and pages.
  • Adjust logging string spacing in TreeViews sample and remove trailing comma in collection initializer.
  • Normalize BOM/whitespace and ensure newline-at-EOF on Error page Razor file.
  • Tweak TabItemContent English XML doc punctuation for Item property.
src/BootstrapBlazor.Server/Components/Samples/TreeViews.razor.cs
src/BootstrapBlazor.Server/Components/Pages/Error.razor
src/BootstrapBlazor/Components/Tab/TabItemContent.cs

Assessment against linked issues

Issue Objective Addressed Explanation
#7559 Update and correct the XML documentation comments for the relevant component(s) described in the issue.
#7559 Add sample code for the specified component(s) to the documentation or XML comments as requested in the issue body. The PR only refines existing XML comments (wording, language tags, cref links) and makes minor formatting changes. It does not add any sample code snippets for the component(s), as requested in the issue body.

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

@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (2e4d93f) to head (603f7a4).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #7560   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          748       748           
  Lines        33000     33000           
  Branches      4588      4588           
=========================================
  Hits         33000     33000           
Flag Coverage Δ
BB 100.00% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

@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 - I've found 1 issue, and left some high level feedback:

  • In ToastServiceExtensions, the XML doc comments for the parameters (title, content, autoHide, showClose) were simplified to empty <param> tags; consider restoring brief descriptions (in both zh/en as before) so consumers still get useful IntelliSense for what each parameter does and its defaults.
  • The removed Chinese comment in ToastServiceExtensions about the three-parameter method being used by the UniLite plugin system encoded an important constraint (“please do not delete”); consider keeping a concise version of that note (possibly in English as well) so future refactors don’t accidentally break the plugin integration.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In `ToastServiceExtensions`, the XML doc comments for the parameters (`title`, `content`, `autoHide`, `showClose`) were simplified to empty `<param>` tags; consider restoring brief descriptions (in both zh/en as before) so consumers still get useful IntelliSense for what each parameter does and its defaults.
- The removed Chinese comment in `ToastServiceExtensions` about the three-parameter method being used by the UniLite plugin system encoded an important constraint (“please do not delete”); consider keeping a concise version of that note (possibly in English as well) so future refactors don’t accidentally break the plugin integration.

## Individual Comments

### Comment 1
<location> `src/BootstrapBlazor/Extensions/LocalizationOptionsExtensions.cs:40-42` </location>
<code_context>

         var streams = assemblies.SelectMany(i => option.GetResourceStream(i, cultureName)).ToList();

-        // <para lang="zh">添加 Json 文件流到配置</para>
-        // <para lang="en">Add Json file stream to configuration</para>
         foreach (var s in streams)
         {
             builder.AddJsonStream(s);
</code_context>

<issue_to_address>
**suggestion (bug_risk):** Consider protecting stream disposal with a try/finally (or using) to avoid leaks if `builder.Build()` throws.

If `builder.Build()` throws, the `foreach` that disposes `streams` is never reached and the manifest resource streams are leaked. Ensure stream creation, `Build()`, and disposal are wrapped so the streams are always disposed even when configuration building fails.

Suggested implementation:

```csharp
        var assemblies = new List<Assembly>() { assembly };
        var entryAssembly = GetEntryAssembly();
        if (assembly != entryAssembly)
        {
            var streams = assemblies.SelectMany(i => option.GetResourceStream(i, cultureName)).ToList();

            try
            {
                foreach (var s in streams)
                {
                    builder.AddJsonStream(s);
                }
            }
            finally
            {
                foreach (var s in streams)
                {
                    s.Dispose();
                }
            }

```

To fully satisfy the review comment about protecting against leaks when `builder.Build()` throws, you should ensure that the call to `builder.Build()` (wherever it occurs in this method) executes inside the same `try` block that owns `streams`, so that the `finally` above still runs and disposes the streams if `Build()` fails. For example:

1. Move `builder.Build()` into the `try` block that currently wraps `AddJsonStream`.
2. Or, if `builder.Build()` is outside this `if (assembly != entryAssembly)` block, lift the `try/finally` to a scope that encloses both the JSON stream registration and the `Build()` call, and keep the `streams` disposal in the corresponding `finally`.
</issue_to_address>

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.

Comment on lines 40 to 42
var streams = assemblies.SelectMany(i => option.GetResourceStream(i, cultureName)).ToList();

// <para lang="zh">添加 Json 文件流到配置</para>
// <para lang="en">Add Json file stream to configuration</para>
foreach (var s in streams)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (bug_risk): Consider protecting stream disposal with a try/finally (or using) to avoid leaks if builder.Build() throws.

If builder.Build() throws, the foreach that disposes streams is never reached and the manifest resource streams are leaked. Ensure stream creation, Build(), and disposal are wrapped so the streams are always disposed even when configuration building fails.

Suggested implementation:

        var assemblies = new List<Assembly>() { assembly };
        var entryAssembly = GetEntryAssembly();
        if (assembly != entryAssembly)
        {
            var streams = assemblies.SelectMany(i => option.GetResourceStream(i, cultureName)).ToList();

            try
            {
                foreach (var s in streams)
                {
                    builder.AddJsonStream(s);
                }
            }
            finally
            {
                foreach (var s in streams)
                {
                    s.Dispose();
                }
            }

To fully satisfy the review comment about protecting against leaks when builder.Build() throws, you should ensure that the call to builder.Build() (wherever it occurs in this method) executes inside the same try block that owns streams, so that the finally above still runs and disposes the streams if Build() fails. For example:

  1. Move builder.Build() into the try block that currently wraps AddJsonStream.
  2. Or, if builder.Build() is outside this if (assembly != entryAssembly) block, lift the try/finally to a scope that encloses both the JSON stream registration and the Build() call, and keep the streams disposal in the corresponding finally.

Copy link
Copy Markdown
Contributor

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 updates XML documentation comments across several files to improve English translations and clean up redundant or poorly translated comments. The changes primarily focus on replacing machine-translated or duplicated Chinese text in English documentation tags with proper English translations.

Changes:

  • Updated English translations in XML comments for ToastService extension methods
  • Added proper <see cref> tags in LocalizationOptionsExtensions and removed inline comments
  • Removed a trailing period in TabItemContent documentation for consistency
  • Added spacing in a Chinese log message for better readability
  • Cleaned up whitespace and trailing blank lines in multiple files

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
ToastServiceExtensions.cs Updated English XML comment translations and removed parameter descriptions
LocalizationOptionsExtensions.cs Added <see cref> tags and removed inline code comments
TabItemContent.cs Removed trailing period from English documentation
TreeViews.razor.cs Added spacing in Chinese log message and removed trailing blank lines
Error.razor Removed leading blank line

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 46 to +49
/// <param name="service"></param>
/// <param name="title"><para lang="zh">Title 属性</para><para lang="en">Title property</para></param>
/// <param name="content"><para lang="zh">Content 属性</para><para lang="en">Content property</para></param>
/// <param name="autoHide"><para lang="zh">自动隐藏属性默认为 true</para><para lang="en">自动隐藏propertydefault is为 true</para></param>
/// <param name="title"></param>
/// <param name="content"></param>
/// <param name="autoHide"></param>
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The parameter documentation has been completely removed, leaving only empty param tags. While simplifying documentation can be beneficial, completely removing parameter descriptions may reduce code clarity. Consider either keeping brief descriptions or following a consistent documentation standard across the codebase. Empty param tags provide no value and should either contain descriptions or be removed entirely if the project doesn't require parameter documentation.

Copilot uses AI. Check for mistakes.
Comment on lines 56 to +60
/// <param name="service"></param>
/// <param name="title"><para lang="zh">Title 属性</para><para lang="en">Title property</para></param>
/// <param name="content"><para lang="zh">Content 属性</para><para lang="en">Content property</para></param>
/// <param name="autoHide"><para lang="zh">自动隐藏属性默认为 true</para><para lang="en">自动隐藏propertydefault is为 true</para></param>
/// <param name="showClose"><para lang="zh">是否显示关闭按钮 默认 true</para><para lang="en">whetherdisplay关闭button default is true</para></param>
/// <param name="title"></param>
/// <param name="content"></param>
/// <param name="autoHide"></param>
/// <param name="showClose"></param>
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The parameter documentation has been completely removed, leaving only empty param tags. While simplifying documentation can be beneficial, completely removing parameter descriptions may reduce code clarity. Consider either keeping brief descriptions or following a consistent documentation standard across the codebase. Empty param tags provide no value and should either contain descriptions or be removed entirely if the project doesn't require parameter documentation.

Copilot uses AI. Check for mistakes.
Comment on lines 74 to +77
/// <param name="service"></param>
/// <param name="title"><para lang="zh">Title 属性</para><para lang="en">Title property</para></param>
/// <param name="content"><para lang="zh">Content 属性</para><para lang="en">Content property</para></param>
/// <param name="autoHide"><para lang="zh">自动隐藏属性默认为 true</para><para lang="en">自动隐藏propertydefault is为 true</para></param>
/// <param name="title"></param>
/// <param name="content"></param>
/// <param name="autoHide"></param>
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The parameter documentation has been completely removed, leaving only empty param tags. While simplifying documentation can be beneficial, completely removing parameter descriptions may reduce code clarity. Consider either keeping brief descriptions or following a consistent documentation standard across the codebase. Empty param tags provide no value and should either contain descriptions or be removed entirely if the project doesn't require parameter documentation.

Copilot uses AI. Check for mistakes.
Comment on lines 84 to +88
/// <param name="service"></param>
/// <param name="title"><para lang="zh">Title 属性</para><para lang="en">Title property</para></param>
/// <param name="content"><para lang="zh">Content 属性</para><para lang="en">Content property</para></param>
/// <param name="autoHide"><para lang="zh">自动隐藏属性默认为 true</para><para lang="en">自动隐藏propertydefault is为 true</para></param>
/// <param name="showClose"><para lang="zh">是否显示关闭按钮 默认 true</para><para lang="en">whetherdisplay关闭button default is true</para></param>
/// <param name="title"></param>
/// <param name="content"></param>
/// <param name="autoHide"></param>
/// <param name="showClose"></param>
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The parameter documentation has been completely removed, leaving only empty param tags. While simplifying documentation can be beneficial, completely removing parameter descriptions may reduce code clarity. Consider either keeping brief descriptions or following a consistent documentation standard across the codebase. Empty param tags provide no value and should either contain descriptions or be removed entirely if the project doesn't require parameter documentation.

Copilot uses AI. Check for mistakes.
Comment on lines 102 to +105
/// <param name="service"></param>
/// <param name="title"><para lang="zh">Title 属性</para><para lang="en">Title property</para></param>
/// <param name="content"><para lang="zh">Content 属性</para><para lang="en">Content property</para></param>
/// <param name="autoHide"><para lang="zh">自动隐藏属性默认为 true</para><para lang="en">自动隐藏propertydefault is为 true</para></param>
/// <param name="title"></param>
/// <param name="content"></param>
/// <param name="autoHide"></param>
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The parameter documentation has been completely removed, leaving only empty param tags. While simplifying documentation can be beneficial, completely removing parameter descriptions may reduce code clarity. Consider either keeping brief descriptions or following a consistent documentation standard across the codebase. Empty param tags provide no value and should either contain descriptions or be removed entirely if the project doesn't require parameter documentation.

Copilot uses AI. Check for mistakes.
Comment on lines 112 to +116
/// <param name="service"></param>
/// <param name="title"><para lang="zh">Title 属性</para><para lang="en">Title property</para></param>
/// <param name="content"><para lang="zh">Content 属性</para><para lang="en">Content property</para></param>
/// <param name="autoHide"><para lang="zh">自动隐藏属性默认为 true</para><para lang="en">自动隐藏propertydefault is为 true</para></param>
/// <param name="showClose"><para lang="zh">是否显示关闭按钮 默认 true</para><para lang="en">whetherdisplay关闭button default is true</para></param>
/// <param name="title"></param>
/// <param name="content"></param>
/// <param name="autoHide"></param>
/// <param name="showClose"></param>
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The parameter documentation has been completely removed, leaving only empty param tags. While simplifying documentation can be beneficial, completely removing parameter descriptions may reduce code clarity. Consider either keeping brief descriptions or following a consistent documentation standard across the codebase. Empty param tags provide no value and should either contain descriptions or be removed entirely if the project doesn't require parameter documentation.

Copilot uses AI. Check for mistakes.
Comment on lines 18 to +21
/// <param name="service"></param>
/// <param name="title"><para lang="zh">Title 属性</para><para lang="en">Title property</para></param>
/// <param name="content"><para lang="zh">Content 属性</para><para lang="en">Content property</para></param>
/// <param name="autoHide"><para lang="zh">自动隐藏属性默认为 true</para><para lang="en">自动隐藏propertydefault is为 true</para></param>
/// <param name="title"></param>
/// <param name="content"></param>
/// <param name="autoHide"></param>
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The parameter documentation has been completely removed, leaving only empty param tags. While simplifying documentation can be beneficial, completely removing parameter descriptions may reduce code clarity. Consider either keeping brief descriptions or following a consistent documentation standard across the codebase. Empty param tags provide no value and should either contain descriptions or be removed entirely if the project doesn't require parameter documentation.

Copilot uses AI. Check for mistakes.
Comment on lines 28 to +32
/// <param name="service"></param>
/// <param name="title"><para lang="zh">Title 属性</para><para lang="en">Title property</para></param>
/// <param name="content"><para lang="zh">Content 属性</para><para lang="en">Content property</para></param>
/// <param name="autoHide"><para lang="zh">自动隐藏属性默认为 true</para><para lang="en">自动隐藏propertydefault is为 true</para></param>
/// <param name="showClose"><para lang="zh">是否显示关闭按钮 默认 true</para><para lang="en">whetherdisplay关闭button default is true</para></param>
/// <param name="title"></param>
/// <param name="content"></param>
/// <param name="autoHide"></param>
/// <param name="showClose"></param>
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The parameter documentation has been completely removed, leaving only empty param tags. While simplifying documentation can be beneficial, completely removing parameter descriptions may reduce code clarity. Consider either keeping brief descriptions or following a consistent documentation standard across the codebase. Empty param tags provide no value and should either contain descriptions or be removed entirely if the project doesn't require parameter documentation.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

doc(Components): update xml comments

2 participants