-
-
Notifications
You must be signed in to change notification settings - Fork 375
doc(Component): comments support both Chinese and English #7532
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
|
Thanks for your PR, @peereflits. Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
Reviewer's GuideAdds bilingual (Chinese and English) XML documentation to ContextMenu-related components, fixes incorrect usage of , and slightly refines parameter/return descriptions, with one new using directive added to the IContextMenuItem interface file. Class diagram for ContextMenu-related components with updated XML documentationclassDiagram
class ContextMenu {
+bool ShowShadow
+Func<object, Task> OnBeforeShowCallback
+RenderFragment ChildContent
-List<IContextMenuItem> _contextMenuItems
-ContextMenuZone ContextMenuZone
-object _contextItem
+Task Show(MouseEventArgs args, object contextItem)
+void AddItem(IContextMenuItem item)
+void RemoveItem(IContextMenuItem item)
+override void OnInitialized()
+override Task OnAfterRenderAsync(bool firstRender)
}
class ContextMenuItem {
+string Text
+string Icon
+bool Disabled
+Func<ContextMenuItem, object, bool> OnDisabledCallback
+Func<ContextMenuItem, object, Task> OnClick
-ContextMenu ContextMenu
-bool disposedValue
+override void OnInitialized()
+void Dispose(bool disposing)
+void Dispose()
}
class ContextMenuDivider {
-ContextMenu ContextMenu
-bool disposedValue
+override void OnInitialized()
+override void BuildRenderTree(RenderTreeBuilder builder)
+void Dispose(bool disposing)
+void Dispose()
}
class ContextMenuTrigger {
+RenderFragment ChildContent
+string WrapperTag
+object ContextItem
-ContextMenuZone ContextMenuZone
+int? OnTouchDelay
+bool IsTouchStarted
-bool IsBusy
-CssBuilder ClassBuilder
+override void OnParametersSet()
+override void BuildRenderTree(RenderTreeBuilder builder)
+Task OnContextMenu(MouseEventArgs args)
}
class ContextMenuZone {
+RenderFragment ChildContent
-CssBuilder ClassBuilder
-ContextMenu _contextMenu
+Task OnContextMenu(MouseEventArgs args, object contextItem)
+void RegisterContextMenu(ContextMenu contextMenu)
}
class IContextMenuItem {
}
class ComponentBase
class BootstrapComponentBase
class Divider
class RenderTreeBuilder
class RenderFragment
class MouseEventArgs
ContextMenuItem ..|> IContextMenuItem
ContextMenuItem --|> ComponentBase
ContextMenuItem ..|> IDisposable
ContextMenuDivider ..|> IContextMenuItem
ContextMenuDivider --|> Divider
ContextMenuDivider ..|> IDisposable
ContextMenuTrigger --|> BootstrapComponentBase
ContextMenuZone o-- ContextMenu
ContextMenuTrigger o-- ContextMenuZone
ContextMenu "1" o-- "*" IContextMenuItem
ContextMenuItem o-- ContextMenu
ContextMenuDivider o-- ContextMenu
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 - I've left some high level feedback:
- The new
using static System.Net.WebRequestMethods;inIContextMenuItem.csappears unused and should be removed to avoid unnecessary dependencies. - For the
Iconproperty example, consider wrapping the sample value in a<code>block or showing it in a typical component usage snippet (e.g.,<ContextMenuItem Icon="fa-solid fa-bookmark" />) to make the documentation clearer.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The new `using static System.Net.WebRequestMethods;` in `IContextMenuItem.cs` appears unused and should be removed to avoid unnecessary dependencies.
- For the `Icon` property example, consider wrapping the sample value in a `<code>` block or showing it in a typical component usage snippet (e.g., `<ContextMenuItem Icon="fa-solid fa-bookmark" />`) to make the documentation clearer.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 #7532 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 748 748
Lines 32998 32998
Branches 4588 4588
=========================================
Hits 32998 32998
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request adds bilingual XML documentation to the ContextMenu component types, translating Chinese documentation into English while preserving the original Chinese text. This addresses issue #7530 and improves code documentation accessibility for non-Chinese readers.
Changes:
- Added bilingual XML documentation tags with
<para lang="zh">and<para lang="en">to all ContextMenu-related classes - Corrected improper
<inheritdoc/>usage by removing redundant<summary>wrappers - Enhanced parameter and return value documentation with language-specific descriptions
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| IContextMenuItem.cs | Added bilingual documentation and remarks; introduced unused import |
| ContextMenuZone.razor.cs | Translated component, method, and parameter documentation to English |
| ContextMenuTrigger.cs | Added bilingual documentation and corrected <inheritdoc/> usage |
| ContextMenuItem.cs | Translated property and method documentation; added icon usage example |
| ContextMenuDivider.cs | Added bilingual documentation and corrected <inheritdoc/> usage |
| ContextMenu.razor.cs | Comprehensive bilingual documentation for all public members |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Link issues
fixes #7530 as of discussion 7513
Summary
Added and translated xml documentation tags as of discussion 7513 for the ContentMenu types.
For the initial translation I used GitHub CoPilot (w Gpt-4.1) with this prompt:
Role: You are a technical writer in charge of the code documetation
Issue: the XML documetation tags are currently in Chinese simplified (culture code zh-Hans-CN)
Achievement: to be able to read the the XML documetation in Chinese and English
Expected Outcome: the XML documetation tags should have a paragraph in the original language (Chinese) and a paragraph with the text translated in English
Example
Current situation:
Expected outcome:
Translate the active document.
(end of prompt)
Note:
In the documentation the usage of
<inheritdoc>is invalid. I often see:while it should be:
Regression?
Risk
Verification
Packaging changes reviewed?
☑️ Self Check before Merge
Summary by Sourcery
Improve ContextMenu component documentation for bilingual readability and clarity without changing runtime behavior.
Documentation: