Skip to content

ResizeObserver: Resizes observer and bounding client rect cleanup#12173

Merged
ScarletKuro merged 8 commits intoMudBlazor:devfrom
91378246:feature/clean-up-resize-observer
Dec 5, 2025
Merged

ResizeObserver: Resizes observer and bounding client rect cleanup#12173
ScarletKuro merged 8 commits intoMudBlazor:devfrom
91378246:feature/clean-up-resize-observer

Conversation

@91378246
Copy link
Contributor

This PR affects the ResizeObserver and the BoundingClientRect:

  • Fix formatting
  • Modernize a view bits
  • Fix floating point comparison
  • Add missing documentation for public properties

@91378246 91378246 marked this pull request as ready for review November 27, 2025 13:48
@mudbot mudbot bot added awaiting triage Needs maintainer review or assistance refactor Reorganizes code and has no changes to the API or functionality in the main library labels Nov 27, 2025
Copy link
Contributor

Copilot AI left a 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 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 IsEqualTo using 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.

@91378246
Copy link
Contributor Author

Note: Copilot links responses sometimes to pr 1 (idk why)

@mudbot mudbot bot removed the awaiting triage Needs maintainer review or assistance label Nov 29, 2025
@danielchalmers danielchalmers changed the title Resizes observer and bounding client rect cleanup Services: Resizes observer and bounding client rect cleanup Nov 29, 2025
@ScarletKuro
Copy link
Member

ScarletKuro commented Nov 30, 2025

Is it just me, or BoundingClientRectExtensions is not used anywhere in our core? Why codecov shows it as "covered", I'm confused.
If it's not used, please remove that, since it's public API we will mark is as breaking change. I'm not even sure what it's doing inside interop not extensions folder.

@mudbot mudbot bot added breaking change This change will require consumer code updates needs: changes A maintainer has asked for further modifications to be made to this pull request labels Nov 30, 2025
@ScarletKuro ScarletKuro removed the breaking change This change will require consumer code updates label Nov 30, 2025
@91378246
Copy link
Contributor Author

91378246 commented Dec 1, 2025

@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

@ScarletKuro
Copy link
Member

Kept for now, but moved to the place where it actually should be.

@mudbot mudbot bot removed the needs: changes A maintainer has asked for further modifications to be made to this pull request label Dec 5, 2025
@ScarletKuro ScarletKuro added the breaking change This change will require consumer code updates label Dec 5, 2025
@ScarletKuro ScarletKuro merged commit 78d9604 into MudBlazor:dev Dec 5, 2025
4 checks passed
@danielchalmers danielchalmers changed the title Services: Resizes observer and bounding client rect cleanup ResizeObserver: Resizes observer and bounding client rect cleanup Dec 20, 2025
This was referenced Feb 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change This change will require consumer code updates refactor Reorganizes code and has no changes to the API or functionality in the main library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants