-
-
Notifications
You must be signed in to change notification settings - Fork 355
feat(DynamicElement): support html attribute #6561
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
Reviewer's GuideThis PR refactors key components to use explicit RenderTreeBuilder implementations—enabling support for arbitrary HTML attributes—and removes the DynamicElement wrapper in favor of native HTML elements with direct @OnClick bindings. Class diagram for refactored LinkButton and BootstrapInputGroupLabel componentsclassDiagram
class ButtonBase {
}
class LinkButton {
+string Url
+string Target
+bool Disabled
+string Icon
+string ImageUrl
+string Text
+RenderFragment ChildContent
+BuildRenderTree(RenderTreeBuilder builder)
-OnClickButton()
}
ButtonBase <|-- LinkButton
class DisplayBase~T~ {
}
class BootstrapInputGroupLabel {
+string? ClassString
+string? StyleString
+bool Required
+string? DisplayText
+BuildRenderTree(RenderTreeBuilder builder)
+OnParametersSet()
}
DisplayBase <|-- BootstrapInputGroupLabel
Class diagram for removal of DynamicElement usage in componentsclassDiagram
class DynamicElement {
-string TagName
-EventCallback OnClick
-bool TriggerClick
-RenderFragment ChildContent
}
%% DynamicElement is no longer used in CardUpload, MultiSelect, MultiSelectGeneric, DatePickerBody, and ContextMenu
class CardUpload {
-OnCardFileDelete()
}
class MultiSelect {
-SelectAll()
-InvertSelect()
-Clear()
}
class MultiSelectGeneric {
-SelectAll()
-InvertSelect()
-Clear()
}
class DatePickerBody {
-SwitchView()
-SwitchTimeView()
}
class ContextMenu {
-OnClickItem()
}
%% DynamicElement is removed from these components
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 @ArgoZhang - I've reviewed your changes - here's some feedback:
- Custom BuildRenderTree implementations (e.g., in LinkButton and BootstrapInputGroupLabel) should call builder.AddMultipleAttributes to forward AdditionalAttributes so consumers can supply arbitrary HTML attributes.
- A few DynamicElement usages lost their TagName parameter (for example in ContextMenu), so double-check you’re still rendering the intended HTML element instead of relying on the default.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Custom BuildRenderTree implementations (e.g., in LinkButton and BootstrapInputGroupLabel) should call builder.AddMultipleAttributes to forward AdditionalAttributes so consumers can supply arbitrary HTML attributes.
- A few DynamicElement usages lost their TagName parameter (for example in ContextMenu), so double-check you’re still rendering the intended HTML element instead of relying on the default.
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 #6561 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 721 719 -2
Lines 31520 31560 +40
Branches 4449 4450 +1
=========================================
+ Hits 31520 31560 +40
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:
|
Link issues
fixes #6560
Summary By Copilot
Regression?
Risk
Verification
Packaging changes reviewed?
☑️ Self Check before Merge
Summary by Sourcery
Simplify component rendering by migrating DynamicElement-based wrappers to direct HTML elements and upgrading LinkButton and InputGroupLabel components to use manual render trees for full HTML attribute support and consistent event handling
New Features:
Enhancements: