Skip to content

doc(Comments): update components xml comments#7745

Merged
ArgoZhang merged 4 commits intomainfrom
doc-xml
Mar 3, 2026
Merged

doc(Comments): update components xml comments#7745
ArgoZhang merged 4 commits intomainfrom
doc-xml

Conversation

@ArgoZhang
Copy link
Member

@ArgoZhang ArgoZhang commented Mar 3, 2026

Link issues

fixes #7744

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

Improve XML documentation and component comments for several UI components to clarify behavior and usage in both Chinese and English.

Enhancements:

  • Clarify and correct English XML comments for the Marquee component’s properties and behavior.
  • Expand and format XML documentation for MaskService methods and Menu-related constructors and parameters.
  • Document the SubMenu component as an internal-use menu subcomponent and remove obsolete or redundant comments.
  • Make the injected MessageService dependency on the Message component private and clean up unused parameter documentation.

Copilot AI review requested due to automatic review settings March 3, 2026 02:37
@bb-auto bb-auto bot added the documentation Improvements or additions to documentation label Mar 3, 2026
@bb-auto bb-auto bot added this to the v10.4.0 milestone Mar 3, 2026
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Mar 3, 2026

Reviewer's Guide

This PR cleans up and clarifies XML documentation comments for several BootstrapBlazor components and services, primarily improving English descriptions, adding or refining parameter documentation, and removing redundant or empty comments without changing runtime behavior.

File-Level Changes

Change Details Files
Improve Marquee component XML docs for public parameters.
  • Refine English summary to describe Marquee as a scrolling component.
  • Clarify English descriptions for Text, Color, BackgroundColor, FontSize, AnimationDuration, and Direction properties, including defaults and behavior.
  • Simplify and correct mixed-language phrases in XML comments while preserving Chinese descriptions.
src/BootstrapBlazor/Components/Marquee/Marquee.razor.cs
Enhance MaskService XML documentation formatting and clarity.
  • Expand English summary to describe MaskService as a mask service.
  • Reformat parameter XML docs for Show and Close methods to multi-line blocks for option/mask/all parameters in both Chinese and English.
  • Clarify the meaning of the all parameter as closing all masks vs only the current/specified one.
src/BootstrapBlazor/Components/Mask/MaskService.cs
Improve Menu and SubMenu component documentation consistency.
  • Reformat constructor parameter XML docs in MenuItem to multi-line, per-parameter bilingual descriptions for text, url, and icon.
  • Adjust remarks XML comments for Menu.IsAccordion and Menu.IsExpandAll to add indentation and keep cross-references consistent.
  • Document SubMenu as an internal-use-only component with bilingual summary and remove an unused XML doc for the private GetClassString helper.
src/BootstrapBlazor/Components/Menu/MenuItem.cs
src/BootstrapBlazor/Components/Menu/Menu.razor.cs
src/BootstrapBlazor/Components/Menu/SubMenu.razor.cs
Tighten Message component docs and DI visibility.
  • Remove redundant XML doc from the MessageService injection property and make it private, keeping NotNull annotation.
  • Remove empty or parameter-less XML comment tags from SetPlacement and JSInvokable Dismiss methods while retaining their main summaries.
src/BootstrapBlazor/Components/Message/Message.razor.cs

Assessment against linked issues

Issue Objective Addressed Explanation
#7744 Improve and update XML documentation comments for the relevant components (Marquee, MaskService, Menu/MenuItem/SubMenu, Message) to provide clearer bilingual descriptions and parameter docs.
#7744 Add sample code demonstrating usage of the specified component(s) to the documentation or XML comments ("Add sample code for {Component}"). The diff only refines existing XML comments and adjusts access modifiers; it does not add any sample code snippets or usage examples for the components.

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 a5b1537 into main Mar 3, 2026
6 checks passed
@ArgoZhang ArgoZhang deleted the doc-xml branch March 3, 2026 02:38
Copy link
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 2 issues, and left some high level feedback:

  • Some of the updated English XML comments could be polished for clarity and grammar (e.g., Default is #000 Supports hexadecimal and color names and MaskService Mask Service read a bit awkwardly); consider tightening the wording and punctuation for consistency across components.
  • Where you removed empty <param> tags (e.g., in SetPlacement and Dismiss), there are still methods like GetClassString(MenuItem item) without parameter documentation but with non-obvious behavior; consider either documenting the parameter or removing stray, now-misleading comment remnants to keep the API docs coherent.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Some of the updated English XML comments could be polished for clarity and grammar (e.g., `Default is #000 Supports hexadecimal and color names` and `MaskService Mask Service` read a bit awkwardly); consider tightening the wording and punctuation for consistency across components.
- Where you removed empty `<param>` tags (e.g., in `SetPlacement` and `Dismiss`), there are still methods like `GetClassString(MenuItem item)` without parameter documentation but with non-obvious behavior; consider either documenting the parameter or removing stray, now-misleading comment remnants to keep the API docs coherent.

## Individual Comments

### Comment 1
<location path="src/BootstrapBlazor/Components/Marquee/Marquee.razor.cs" line_range="23" />
<code_context>
-    /// <para lang="en">Gets or sets component值 文本color Default is #000 <para>支持16进制和color名称</para>
-    ///</para>
+    /// <para lang="zh">获得/设置 组件值 文本颜色 默认 #000 支持16进制和颜色名称</para>
+    /// <para lang="en">Gets or sets the component's text color. Default is #000 Supports hexadecimal and color names</para>
     /// </summary>
     [Parameter]
</code_context>
<issue_to_address>
**nitpick (typo):** Minor grammar issue in the English description of the text color parameter.

Add punctuation to clearly separate the default value from the capability description, e.g. `Default is #000. Supports hexadecimal and color names.`

```suggestion
    /// <para lang="en">Gets or sets the component's text color. Default is #000. Supports hexadecimal and color names.</para>
```
</issue_to_address>

### Comment 2
<location path="src/BootstrapBlazor/Components/Marquee/Marquee.razor.cs" line_range="30" />
<code_context>
-    /// <para lang="en">Gets or sets component值 背景color Default is #fff <para>支持16进制和color名称</para>
-    ///</para>
+    /// <para lang="zh">获得/设置 组件值 背景颜色 默认 #fff 支持16进制和颜色名称</para>
+    /// <para lang="en">Gets or sets the component's background color. Default is #fff Supports hexadecimal and color names</para>
     /// </summary>
     [Parameter]
</code_context>
<issue_to_address>
**nitpick (typo):** Minor grammar issue in the English description of the background color parameter.

You could mirror the text color description and update this to: `Default is #fff. Supports hexadecimal and color names.`

Suggested implementation:

```csharp
    /// <summary>
    /// <para lang="zh">获得/设置 组件值 背景颜色 默认 #fff 支持16进制和颜色名称</para>
    /// <para lang="en">Gets or sets the component's background color. Default is #fff. Supports hexadecimal and color names.</para>
    /// </summary>
    [Parameter]
    public string? Text { get; set; }

    /// <summary>
    /// <para lang="zh">获得/设置 组件值 文本颜色 默认 #000 支持16进制和颜色名称</para>
    /// <para lang="en">Gets or sets the component's text color. Default is #000. Supports hexadecimal and color names.</para>
    /// </summary>

```

If the `[Parameter]` attribute for `Text` is already present elsewhere around this property in the actual file, remove the duplicate `[Parameter]` I added above and keep only one attribute on the property.
</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.

/// <para lang="en">Gets or sets component值 文本color Default is #000 <para>支持16进制和color名称</para>
///</para>
/// <para lang="zh">获得/设置 组件值 文本颜色 默认 #000 支持16进制和颜色名称</para>
/// <para lang="en">Gets or sets the component's text color. Default is #000 Supports hexadecimal and color names</para>
Copy link
Contributor

Choose a reason for hiding this comment

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

nitpick (typo): Minor grammar issue in the English description of the text color parameter.

Add punctuation to clearly separate the default value from the capability description, e.g. Default is #000. Supports hexadecimal and color names.

Suggested change
/// <para lang="en">Gets or sets the component's text color. Default is #000 Supports hexadecimal and color names</para>
/// <para lang="en">Gets or sets the component's text color. Default is #000. Supports hexadecimal and color names.</para>

/// <para lang="en">Gets or sets component值 背景color Default is #fff <para>支持16进制和color名称</para>
///</para>
/// <para lang="zh">获得/设置 组件值 背景颜色 默认 #fff 支持16进制和颜色名称</para>
/// <para lang="en">Gets or sets the component's background color. Default is #fff Supports hexadecimal and color names</para>
Copy link
Contributor

Choose a reason for hiding this comment

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

nitpick (typo): Minor grammar issue in the English description of the background color parameter.

You could mirror the text color description and update this to: Default is #fff. Supports hexadecimal and color names.

Suggested implementation:

    /// <summary>
    /// <para lang="zh">获得/设置 组件值 背景颜色 默认 #fff 支持16进制和颜色名称</para>
    /// <para lang="en">Gets or sets the component's background color. Default is #fff. Supports hexadecimal and color names.</para>
    /// </summary>
    [Parameter]
    public string? Text { get; set; }

    /// <summary>
    /// <para lang="zh">获得/设置 组件值 文本颜色 默认 #000 支持16进制和颜色名称</para>
    /// <para lang="en">Gets or sets the component's text color. Default is #000. Supports hexadecimal and color names.</para>
    /// </summary>

If the [Parameter] attribute for Text is already present elsewhere around this property in the actual file, remove the duplicate [Parameter] I added above and keep only one attribute on the property.

Copy link
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

Updates XML documentation across several BootstrapBlazor components/services to improve bilingual (zh/en) comment quality and consistency.

Changes:

  • Refined/expanded component/service <summary> and parameter XML docs (Menu, MaskService, MenuItem, SubMenu, Marquee).
  • Removed some redundant/empty XML doc tags (e.g., <param> / <value> placeholders) and internal-only helper docs.
  • Adjusted Message’s injected MessageService visibility (now private).

Reviewed changes

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

Show a summary per file
File Description
src/BootstrapBlazor/Components/Message/Message.razor.cs Removes XML docs on injected service and changes injected MessageService property visibility to private.
src/BootstrapBlazor/Components/Menu/SubMenu.razor.cs Fills in previously empty class summary; removes doc block for a private helper.
src/BootstrapBlazor/Components/Menu/MenuItem.cs Reformats constructor parameter XML docs into multiline bilingual blocks.
src/BootstrapBlazor/Components/Menu/Menu.razor.cs Minor XML doc formatting tweaks; removes an empty <value> tag.
src/BootstrapBlazor/Components/Mask/MaskService.cs Improves English service summary; reformats method parameter XML docs.
src/BootstrapBlazor/Components/Marquee/Marquee.razor.cs Rewrites multiple English/zh XML docs for clarity and consistency.

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

Comment on lines 36 to +38
[Inject]
[NotNull]
public MessageService? MessageService { get; set; }
private MessageService? MessageService { get; set; }
Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

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

Changing the injected MessageService property from public to private is a public API breaking change for consumers compiling against this library (the member is removed from the public surface). If the intent is only to hide the injected service, consider an alternative that preserves compatibility (e.g., keep it public but mark it non-browsable / internal via a wrapper) or explicitly call out the breaking change in release notes/PR description.

Copilot uses AI. Check for mistakes.
Comment on lines 21 to 24
/// <summary>
/// <para lang="zh">获得/设置 组件值 文本颜色 默认 #000 <para>支持16进制和颜色名称</para>
///</para>
/// <para lang="en">Gets or sets component值 文本color Default is #000 <para>支持16进制和color名称</para>
///</para>
/// <para lang="zh">获得/设置 组件值 文本颜色 默认 #000 支持16进制和颜色名称</para>
/// <para lang="en">Gets or sets the component's text color. Default is #000 Supports hexadecimal and color names</para>
/// </summary>
Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

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

In the English doc text for Color, there’s a missing sentence separator: "Default is #000 Supports..." reads as two sentences but lacks punctuation. Consider adding a period or rewriting so generated docs read cleanly.

Copilot uses AI. Check for mistakes.
Comment on lines 28 to 31
/// <summary>
/// <para lang="zh">获得/设置 组件值 背景颜色 默认 #fff <para>支持16进制和颜色名称</para>
///</para>
/// <para lang="en">Gets or sets component值 背景color Default is #fff <para>支持16进制和color名称</para>
///</para>
/// <para lang="zh">获得/设置 组件值 背景颜色 默认 #fff 支持16进制和颜色名称</para>
/// <para lang="en">Gets or sets the component's background color. Default is #fff Supports hexadecimal and color names</para>
/// </summary>
Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

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

In the English doc text for BackgroundColor, there’s a missing sentence separator: "Default is #fff Supports..." would read better with a period (or similar) between the default value sentence and the supported formats sentence.

Copilot uses AI. Check for mistakes.
Comment on lines 42 to 46
/// <summary>
/// <para lang="zh">获得/设置 组件值 动画时间 默认 14s <para>值越小滚动越快</para>
///</para>
/// <para lang="en">Gets or sets component值 动画时间 Default is 14s <para>值越小滚动越快</para>
/// <para lang="en">Gets or sets the component's animation duration. Default is 14s <para>The smaller the value, the faster the scroll</para>
///</para>
Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

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

The Duration XML docs still use nested <para> tags inside <para lang="..."> (and the closing tags are formatted as ///</para>), while other properties in this file were updated to a flatter style. Consider splitting this into separate <para lang="..."> blocks to keep the XML docs consistent and easier for doc tooling to parse.

Copilot uses AI. Check for mistakes.
@codecov
Copy link

codecov bot commented Mar 3, 2026

Codecov Report

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

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #7745   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          750       750           
  Lines        33269     33269           
  Branches      4612      4612           
=========================================
  Hits         33269     33269           
Flag Coverage Δ
BB 100.00% <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.

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(Comments): update components xml comments

2 participants