-
-
Notifications
You must be signed in to change notification settings - Fork 26
Feature/modal #286
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
Feature/modal #286
Conversation
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.
Pull Request Overview
This PR introduces a comprehensive modal dialog system for Blazor applications using native HTML <dialog> elements with JavaScript interop. The implementation provides a service-based approach for displaying common modal types (alert, confirm, prompt) with customizable styling variants.
- Adds a complete modal dialog framework with JavaScript interop for HTML
<dialog>management - Implements service layer with extension methods for common modal patterns (Alert, Confirm, Prompt)
- Provides comprehensive CSS styling with multiple visual variants (Primary, Information, Success, Warning, Danger)
Reviewed Changes
Copilot reviewed 24 out of 24 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
dialog.js |
JavaScript module for managing HTMLDialogElement interactions |
modal-dialog.css |
Complete CSS styling system with variants and animations |
BlazorControls.css |
Imports the new modal dialog CSS |
ServiceCollectionExtensions.cs |
Adds modal service registration |
ModalVariant.cs |
Enum defining visual variants for modals |
ModalServiceExtensions.cs |
Extension methods for common modal operations |
ModalService.cs |
Core service for displaying modal dialogs |
ModalResult.cs |
Result structure for modal operations |
ModalReference.cs |
Reference class managing modal lifecycle |
ModalDialog.razor/.cs |
Component rendering individual modal dialogs |
ModalContainer.razor/.cs |
Container component managing active modals |
ModalComponentBase.cs |
Base class for modal components |
| Message classes | Records for modal show/close messaging |
IModalReference.cs |
Interface for modal references |
| Common modal components | Alert, Confirm, and Prompt modal implementations |
| Sample files | Demo page and navigation updates |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| if (value === '--closed--') | ||
| return; |
Copilot
AI
Oct 14, 2025
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.
The magic string '--closed--' should be defined as a constant to improve maintainability and reduce the risk of typos.
|
|
||
| &[open] { | ||
| animation: dialog-open 300ms forwards; | ||
| } |
Copilot
AI
Oct 14, 2025
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.
The CSS nesting syntax using '&' may not be supported in all browsers. Consider using standard CSS selectors for better compatibility.
| &[open] { | |
| animation: dialog-open 300ms forwards; | |
| } | |
| } | |
| dialog[open] { | |
| animation: dialog-open 300ms forwards; |
| @@ -0,0 +1,9 @@ | |||
|
|
|||
Copilot
AI
Oct 14, 2025
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.
[nitpick] Remove the empty line at the beginning of the file for consistency with other files in the codebase.
No description provided.