-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
MudDialog: Add nullable annotation #9146
Conversation
5ee0d31
to
877ccfd
Compare
This comment was marked as resolved.
This comment was marked as resolved.
The problem is that on top of nullable, you do change the behavior:
This now says that the Title must always be supplied. If someone just calls new MessageBoxOptions() , they will get a compilation error. I understand it's the v7 branch where such changes are allowed, but below I'm explaining why some refactoring could be questionable for now.
This also slightly changes the behavior. I'm not saying it's not a correct refactor—it is, and it's how it should have been—but I'd prefer to have parameter changes in a separate change, as we do with ParameterState .
The dialog is going to be refactored in the future, which is why I wouldn't do any refactor now. Just do a basic nullable annotation even if there will be clumsy spots, we can suppress it for now. |
I think @henon can invite you to the contribution team, it will be easier to communicate. |
Sure @xC0dex, please join the mudblazor discord server if you haven't already done so https://discord.gg/mudblazor |
I already joined the server. My username is |
Hey @ScarletKuro, thanks for the feedback!
You're right. I didn't think about that. I'll revert that and initialize the title with
I got your point. Usually when I spot a potential improvement, I fix it immediately. But I can understand, if this should be done in a separate PR 👍. Maintaining an open source project is another level of responsibility. |
cc0b181
to
1be1e31
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #9146 +/- ##
==========================================
+ Coverage 89.82% 90.82% +0.99%
==========================================
Files 412 401 -11
Lines 11878 12516 +638
Branches 2364 2436 +72
==========================================
+ Hits 10670 11368 +698
+ Misses 681 608 -73
- Partials 527 540 +13 ☔ View full report in Codecov by Sentry. |
I'm a bit confused why codecov now started complaining |
1be1e31
to
45d1813
Compare
Maybe the lines you touched weren't that well covered to begin with |
079667c
to
791adb3
Compare
Yeah, that's the reason. I was just wondering why it was not complaining when the PR was created. |
I'll add the missing tests 👍 |
791adb3
to
5007da3
Compare
97f758e
to
0c38e95
Compare
0c38e95
to
735cf53
Compare
While writing the tests, I noticed that the public void Close(DialogReference dialog) to public void Close(IDialogReference dialog) |
I guess it should be safe from a binary compatibility viewpoint since it's not a virtual or abstract method. |
Hmm, apparently the Before the annotation:
And this case was not covered by |
Thanks Justin! |
Hey ✋,
I'll try to contribute to MudBlazor more often. This time with nullable annoations.
Description
Part of #6535
DialogOptions
andDialogParameters
calledDefault
to reduce some allocationsThere is one thing to discuss:TheMudMessageBox
defines theTitle
parameter as nullable. That's why theShow
methods of theIDialogService
now accept a nullable title because I would rather not suppress nullable here. But IMO, it would be better to not make the title nullable as the title will always be rendered right now inMudDialogInstance
.So we basically have to answer only one question: Should the Title be nullable or not?
How Has This Been Tested?
Added missing tests.
Type of Changes
Checklist
dev
).