-
-
Notifications
You must be signed in to change notification settings - Fork 362
feat(Message): Add ”DismissMode“ in MessageOption #6508
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, @momijijin. Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
Reviewer's GuideThis PR introduces a new MessageDismissMode enum and integrates it into MessageOption to control how messages are dismissed (hidden or deleted), and updates both the JS and server-side logic to enforce the DeleteSource behavior. Sequence diagram for message dismissal with new DismissModesequenceDiagram
participant User
participant JS as Message.razor.js
participant Server as Message.razor.cs
participant MessageOption
User->>JS: Dismiss message (e.g., click close)
JS->>JS: Remove message from items
alt Last message dismissed
JS->>Server: invokeMethodAsync(callback)
else More messages remain
JS->>Server: invokeMethodAsync('Dismiss', alertId)
Server->>MessageOption: Check DismissMode
alt DismissMode == DeleteSource
Server->>Server: Remove message from _messages
else DismissMode == OnlyHidden
Server->>Server: Only hide message
end
end
Class diagram for MessageOption and MessageDismissMode changesclassDiagram
class MessageOption {
MessageShowMode ShowMode
MessageDismissMode DismissMode
}
class MessageShowMode {
<<enum>>
Single
Multiple
}
class MessageDismissMode {
<<enum>>
OnlyHidden
DeleteSource
}
MessageOption --> MessageShowMode
MessageOption --> MessageDismissMode
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 @momijijin - I've reviewed your changes - here's some feedback:
- The new DismissMode isn’t referenced in the JS logic – you need to pass the mode into Message.razor.js and only call the ‘Dismiss’ callback when DismissMode is DeleteSource.
- When popping the last message you invoke msg.callback without an id, but your C# Dismiss method expects an id parameter – ensure the callbacks and signatures line up.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The new DismissMode isn’t referenced in the JS logic – you need to pass the mode into Message.razor.js and only call the ‘Dismiss’ callback when DismissMode is DeleteSource.
- When popping the last message you invoke msg.callback without an id, but your C# Dismiss method expects an id parameter – ensure the callbacks and signatures line up.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 #6508 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 714 714
Lines 31387 31390 +3
Branches 4430 4431 +1
=========================================
+ Hits 31387 31390 +3
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 #6506
Summary By Copilot
Regression?
Risk
Verification
Packaging changes reviewed?
☑️ Self Check before Merge
Summary by Sourcery
Introduce configurable dismiss behavior for message component by adding a new DismissMode option and supporting client-server handling for per-message dismissal.
New Features:
Enhancements: