-
-
Notifications
You must be signed in to change notification settings - Fork 375
feat(IContextMenuItem): add IsShow parameter #7608
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, @AiYuZhen. Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
Reviewer's GuideImplements explicit ordering for context menu items and dividers, and adds an option to trim leading/trailing dividers from rendered context menus, with accompanying unit tests. Sequence diagram for rendering ordered and trimmed context menusequenceDiagram
actor User
participant Browser
participant ContextMenu
User->>Browser: Right click target
Browser->>ContextMenu: Render context menu
ContextMenu->>ContextMenu: GetContextMenuItems()
activate ContextMenu
ContextMenu->>ContextMenu: Sort _contextMenuItems by Order
alt TrimStartAndEndDivider enabled
ContextMenu->>ContextMenu: Remove leading ContextMenuDivider items
ContextMenu->>ContextMenu: Remove trailing ContextMenuDivider items
end
ContextMenu-->>Browser: Ordered and trimmed items
deactivate ContextMenu
Browser-->>User: Display context menu
Class diagram for ordered and trimmed context menu itemsclassDiagram
class ContextMenu {
+RenderFragment ChildContent
+bool TrimStartAndEndDivider
-List~IContextMenuItem~ _contextMenuItems
-List~IContextMenuItem~ GetContextMenuItems()
}
class IContextMenuItem {
+int Order
}
class ContextMenuItem {
+string Text
+int Order
}
class ContextMenuDivider {
+int Order
}
ContextMenuItem ..|> IContextMenuItem
ContextMenuDivider ..|> IContextMenuItem
ContextMenu o--> IContextMenuItem
File-Level Changes
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.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7608 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 749 749
Lines 33003 33005 +2
Branches 4580 4580
=========================================
+ Hits 33003 33005 +2
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:
|
This reverts commit df336ea.
增加上下文菜单项反排序。
增加 TrimStartAndEndDivider 参数,确保开始及结尾菜单项不是分割线。
Link issues
fixes #7605
Summary By Copilot
Regression?
Risk
Verification
Packaging changes reviewed?
☑️ Self Check before Merge
Summary by Sourcery
Add configurable trimming of leading and trailing dividers and support ordered rendering for context menu items.
New Features:
Tests: