-
-
Notifications
You must be signed in to change notification settings - Fork 331
perf(PopConfirmButton): remove dismiss event handler to improve performance #5453
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 Guide by SourceryThis pull request removes the dismiss event handler from the PopConfirmButton component to improve performance. It also removes redundant methods and directly calls the event callbacks. Sequence diagram for PopConfirmButton confirmation before and aftersequenceDiagram
actor User
participant PopConfirmButton
participant PopConfirmButtonContent
participant bootstrap.Popover
alt Before
User->PopConfirmButton: Click button
PopConfirmButton->bootstrap.Popover: Show popover
User->PopConfirmButtonContent: Click Confirm
PopConfirmButtonContent->PopConfirmButtonContent: TriggerConfirmAsync()
PopConfirmButtonContent->PopConfirmButtonContent: InvokeVoidAsync("hide", Id)
PopConfirmButtonContent->PopConfirmButtonContent: OnConfirmClick()
PopConfirmButtonContent->PopConfirmButton: await OnConfirm()
PopConfirmButton->bootstrap.Popover: hide()
else After
User->PopConfirmButton: Click button
PopConfirmButton->bootstrap.Popover: Show popover
User->PopConfirmButtonContent: Click Confirm
PopConfirmButtonContent->PopConfirmButtonContent: OnConfirmClick()
PopConfirmButtonContent->PopConfirmButtonContent: InvokeVoidAsync("hide", Id)
PopConfirmButtonContent->PopConfirmButton: await OnConfirm()
PopConfirmButton->bootstrap.Popover: hide()
end
Sequence diagram for PopConfirmButton closing before and aftersequenceDiagram
actor User
participant PopConfirmButton
participant PopConfirmButtonContent
participant bootstrap.Popover
alt Before
User->PopConfirmButton: Click button
PopConfirmButton->bootstrap.Popover: Show popover
User->PopConfirmButtonContent: Click Close
PopConfirmButtonContent->PopConfirmButtonContent: TriggerCloseAsync()
PopConfirmButtonContent->PopConfirmButtonContent: InvokeVoidAsync("hide", Id)
PopConfirmButtonContent->PopConfirmButtonContent: OnCloseClick()
PopConfirmButtonContent->PopConfirmButton: await OnClose()
PopConfirmButton->bootstrap.Popover: hide()
else After
User->PopConfirmButton: Click button
PopConfirmButton->bootstrap.Popover: Show popover
User->PopConfirmButtonContent: Click Close
PopConfirmButtonContent->PopConfirmButtonContent: OnCloseClick()
PopConfirmButtonContent->PopConfirmButtonContent: InvokeVoidAsync("hide", Id)
PopConfirmButtonContent->PopConfirmButton: await OnClose()
PopConfirmButton->bootstrap.Popover: hide()
end
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:
Overall Comments:
- The removal of the dismiss handler looks good, but I'm not sure about passing the OnCloseClick and OnConfirmClick methods as cascading values - can these be simplified?
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5453 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 646 646
Lines 29352 29346 -6
Branches 4129 4129
=========================================
- Hits 29352 29346 -6 ☔ View full report in Codecov by Sentry. |
Co-Authored-By: 2881099 <2881099@qq.com>
remove dismiss event handler to improve performance
Summary of the changes (Less than 80 chars)
简单描述你更改了什么, 不超过80个字符;如果有关联 Issue 请在下方填写相关编号
Description
fixes #5444
Regression?
[If yes, specify the version the behavior has regressed from]
[是否影响老版本]
Risk
[Justify the selection above]
Verification
Packaging changes reviewed?
☑️ Self Check before Merge
Summary by Sourcery
Bug Fixes: