-
Notifications
You must be signed in to change notification settings - Fork 308
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
feat(Checkbox): use client click instead of server event #4620
Conversation
Reviewer's Guide by SourceryThis PR refactors the Checkbox component to use client-side click handling instead of server events. The implementation moves the click event handling to JavaScript, improves state management, and updates all related test cases to use the new API. Sequence diagram for client-side click handling in CheckboxsequenceDiagram
actor User
participant Checkbox
participant JavaScript
participant Server
User->>Checkbox: Click
Checkbox->>JavaScript: TriggerClick
JavaScript->>Checkbox: SyncStateCallback
Checkbox-->>User: Update UI
Note over Checkbox,JavaScript: No server interaction needed
Updated class diagram for Checkbox componentclassDiagram
class Checkbox {
+bool StopPropagation
+string? StopPropagationString
+CheckboxState NextState
+ValueTask TriggerOnBeforeStateChanged()
+ValueTask SyncStateCallback(CheckboxState state)
+ValueTask TriggerClick()
}
class ValidateBase {
}
Checkbox --|> ValidateBase
note for Checkbox "Refactored to handle clicks client-side"
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 PR removes the StopPropagation parameter and hardcodes e.stopPropagation() in the JS code. Consider keeping this configurable to support cases where event bubbling is needed.
Here's what I looked at during the review
- 🟡 General issues: 1 issue found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟡 Complexity: 1 issue found
- 🟢 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 #4620 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 620 620
Lines 27379 27381 +2
Branches 3917 3914 -3
=========================================
+ Hits 27379 27381 +2 ☔ View full report in Codecov by Sentry. |
@sourcery-ai review |
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 and they look great!
Here's what I looked at during the review
- 🟡 General issues: 1 issue found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟡 Complexity: 2 issues found
- 🟢 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.
use client click instead of server event
Summary of the changes (Less than 80 chars)
简单描述你更改了什么, 不超过80个字符;如果有关联 Issue 请在下方填写相关编号
Description
fixes #4619
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
Switch checkbox click handling from server-side to client-side to improve performance and responsiveness. Add support for stopping event propagation in checkboxes and update tests to cover these changes.
New Features:
Enhancements:
Tests: