ResizeObserver: Resizes observer and bounding client rect cleanup#12173
ResizeObserver: Resizes observer and bounding client rect cleanup#12173ScarletKuro merged 8 commits intoMudBlazor:devfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR modernizes and improves the ResizeObserver and BoundingClientRect classes with formatting cleanup, documentation enhancements, and a floating-point comparison fix. The changes align with modern C# conventions while adding comprehensive XML documentation for public APIs.
Key changes:
- Converted to file-scoped namespaces for cleaner code structure
- Fixed floating-point comparison in
IsEqualTousing tolerance-based comparison instead of direct equality - Added comprehensive XML documentation for all public properties and methods
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
src/MudBlazor/Services/ResizeObserver/ResizeObserver.cs |
Converted to file-scoped namespace, modernized syntax (using [] instead of Array.Empty, .Count == 0 instead of .Any(), Guid.Empty instead of default), and added class-level documentation |
src/MudBlazor/Interop/BoundingClientRect.cs |
Converted to file-scoped namespace, added comprehensive XML documentation for all properties and methods, implemented tolerance-based floating-point comparison in IsEqualTo, and marked obsolete X/Y properties |
src/MudBlazor.UnitTests/Services/BoundingClientRectTests.cs |
Converted to file-scoped namespace, updated field naming to use underscore prefix (_ctx), and added pragma warnings to suppress obsolete member usage in tests |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Note: Copilot links responses sometimes to pr 1 (idk why) |
|
Is it just me, or |
|
@ScarletKuro It is used in the bounding client rect tests itself; Should I still remove it / make it internally only? Could be useful for a consumer using the bounding client rect Anyways, if it's okay that this is a breaking change I would also remove the redundant X and Y properties |
|
Kept for now, but moved to the place where it actually should be. |
This PR affects the
ResizeObserverand theBoundingClientRect: