Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Aug 6, 2025

Note

Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!

Summary

Marks the entire CompressedLayout API as obsolete to inform users that it should not be used and may be removed in a future release. This API currently does not perform any meaningful functionality and should be deprecated.

Changes Made

API Changes

  • Added [Obsolete] attribute to the CompressedLayout class with a clear deprecation message
  • Added [Obsolete] attributes to all public members:
    • IsHeadlessProperty field
    • GetIsHeadless method
    • SetIsHeadless method
    • HeadlessOffsetProperty field
    • GetHeadlessOffset method

Documentation Updates

  • Removed CompressedLayout.xml documentation file entirely (following standard practice for obsolete APIs)
  • Replaced XML include references with direct XML documentation comments in CompressedLayout.cs
  • All obsolete attributes continue to provide clear deprecation guidance

Obsolete Message

All obsolete attributes use the message:

"CompressedLayout does not provide meaningful functionality and may be removed in a future release. Please remove usage of this API."

Impact

  • Non-breaking change: Existing code using CompressedLayout will continue to function
  • Build warnings: Users will receive CS0618 warnings when using any part of this API
  • Clear guidance: The warning message clearly instructs users to remove usage of this API

Testing

  • Verified that the Controls.Core project syntax is correct after removing XML documentation file
  • Confirmed that all public API usage generates appropriate obsolete warnings (CS0618)
  • Validated that existing functionality continues to work correctly
  • The internal SetHeadlessOffset method was left unchanged as it's internal to the framework

This change provides a clear deprecation path for the CompressedLayout API while maintaining backward compatibility for existing code.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Mark CompressedLayout API as obsolete since it currently does nothing Mark CompressedLayout API as obsolete Aug 6, 2025
Copilot AI requested a review from PureWeen August 6, 2025 22:56
<Interfaces />
<Docs>
<summary>Contains attached properties for omitting redundant renderers.</summary>
<summary>Contains attached properties for omitting redundant renderers. This API is obsolete and does not provide meaningful functionality.</summary>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review other places in the code where we have removed this xml files for our docs and just get this file removed @copilot

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've removed the CompressedLayout.xml documentation file entirely and replaced the XML include references in CompressedLayout.cs with direct XML documentation comments. This follows the standard practice for obsolete APIs that are being prepared for removal. The change is in commit ec15a24.

@github-project-automation github-project-automation bot moved this from Todo to Changes Requested in MAUI SDK Ongoing Aug 6, 2025
Copilot AI changed the title Mark CompressedLayout API as obsolete Mark CompressedLayout API as obsolete and remove XML documentation Aug 6, 2025
Copilot AI requested a review from PureWeen August 6, 2025 23:14
@PureWeen
Copy link
Member

PureWeen commented Aug 7, 2025

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@PureWeen PureWeen added the p/0 Current heighest priority issues that we are targeting for a release. label Aug 7, 2025
@PureWeen PureWeen moved this from Changes Requested to Ready To Review in MAUI SDK Ongoing Aug 14, 2025
@PureWeen PureWeen marked this pull request as ready for review August 14, 2025 22:14
Copilot AI review requested due to automatic review settings August 14, 2025 22:14
@PureWeen PureWeen requested a review from a team as a code owner August 14, 2025 22:14
@PureWeen PureWeen requested a review from jfversluis August 14, 2025 22:14
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 marks the entire CompressedLayout API as obsolete to inform users it should not be used and may be removed in a future release. The API currently provides no meaningful functionality and needs deprecation.

Key changes:

  • Added [Obsolete] attributes to all public members of the CompressedLayout class
  • Replaced XML include references with direct XML documentation comments in the source code
  • Removed the entire CompressedLayout.xml documentation file

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/Controls/src/Core/CompressedLayout.cs Added obsolete attributes to class and all public members, replaced XML includes with inline documentation
src/Controls/docs/Microsoft.Maui.Controls/CompressedLayout.xml Removed entire XML documentation file for obsolete API

You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

/// <include file="../../docs/Microsoft.Maui.Controls/CompressedLayout.xml" path="//Member[@MemberName='SetIsHeadless']/Docs/*" />
/// <summary>Turns layout compression on or off for the specified bindable object.</summary>
/// <param name="bindable">The <see cref="BindableObject" /> on which to enable or disable layout compression</param>
/// <param name="value">The new layout compression value. <see langword="true" /> to enable layout compression</param>
Copy link

Copilot AI Aug 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The parameter documentation is incomplete. It should specify what happens when the value is false, similar to the original XML documentation that mentioned both true and false cases.

Suggested change
/// <param name="value">The new layout compression value. <see langword="true" /> to enable layout compression</param>
/// <param name="value">The new layout compression value. <see langword="true" /> to enable layout compression; <see langword="false" /> to disable layout compression.</param>

Copilot uses AI. Check for mistakes.
/// <include file="../../docs/Microsoft.Maui.Controls/CompressedLayout.xml" path="//Member[@MemberName='GetHeadlessOffset']/Docs/*" />
/// <summary>For internal use by the Microsoft.Maui.Controls platform.</summary>
/// <param name="bindable">For internal use by the Microsoft.Maui.Controls platform.</param>
/// <returns>For internal use by the Microsoft.Maui.Controls platform.</returns>
Copy link

Copilot AI Aug 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The return value documentation is not descriptive. It should specify that it returns a Point value representing the headless offset, even though this is an internal API.

Suggested change
/// <returns>For internal use by the Microsoft.Maui.Controls platform.</returns>
/// <returns>A <see cref="Point"/> value representing the headless offset for the specified <paramref name="bindable"/> object.</returns>

Copilot uses AI. Check for mistakes.
@github-project-automation github-project-automation bot moved this from Ready To Review to Approved in MAUI SDK Ongoing Aug 15, 2025
@jfversluis jfversluis merged commit a52e152 into net10.0 Aug 15, 2025
129 checks passed
@github-project-automation github-project-automation bot moved this from Approved to Done in MAUI SDK Ongoing Aug 15, 2025
@jfversluis jfversluis deleted the copilot/fix-9bfd342c-250e-40e9-95db-9d17ff94f03a branch August 15, 2025 12:48
@PureWeen PureWeen added area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter t/breaking 💥 labels Aug 20, 2025
@dotnet-policy-service
Copy link
Contributor

🚨 API change(s) detected @davidbritch FYI

@dotnet-policy-service
Copy link
Contributor

🚨 API change(s) detected @davidortinau FYI

@github-actions github-actions bot locked and limited conversation to collaborators Sep 20, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter p/0 Current heighest priority issues that we are targeting for a release. t/breaking 💥

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants