Skip to content

refactor(control)!: Remove UseLegacyContentAlignment flag (BC45) - #23843

Merged
Xiaoy312 merged 1 commit into
feature/breakingchangesfrom
dev/xygu/20260722/bc45-drop-uselegacycontentalignment
Aug 3, 2026
Merged

Xiaoy312 merged 1 commit into
feature/breakingchangesfrom
dev/xygu/20260722/bc45-drop-uselegacycontentalignment

Conversation

@Xiaoy312

Copy link
Copy Markdown
Contributor

GitHub Issue: #8339

PR Type:

💬 Other... Breaking change (API alignment with WinUI)

What changed? 🚀

Removes the Uno-only feature flag FeatureConfiguration.Control.UseLegacyContentAlignment (BC45 of the Phase 5 breaking-changes wave) and hard-codes the WinUI-correct Center/Center default for Control.HorizontalContentAlignment / VerticalContentAlignment.

The flag was an opt-in that flipped those defaults back to the legacy Left/Top. It defaulted to false, so the effective default was already Center/Center — removing it is source-breaking only: default users see no runtime change; only apps that explicitly set UseLegacyContentAlignment = true are affected.

  • Generator (DependencyPropertyMixinGenerator): the HorizontalContentAlignment / VerticalContentAlignment DP defaults now emit HorizontalAlignment.Center / VerticalAlignment.Center directly, dropping the ternary that read the flag.
  • FeatureConfiguration: the now-empty nested Control holder is deleted (its only remaining member was this flag; the sibling UseLegacyLazyApplyTemplate was removed by an earlier item).
  • PackageDiffIgnore.xml (6.6 baseline): entries for the removed Control holder and the flag's property / getter / setter, mirroring the sibling UseLegacyLazyApplyTemplate removal.
  • Migration note: added to migrating-to-uno-7.md for apps that set the flag.

Validation

  • Compile: SamplesApp.Skia.Generic (net10.0 Skia) builds clean (0 warnings / 0 errors). This is the real proof the removal is consistent — a stale generator would leave a dangling reference to the deleted flag and fail the build.
  • Runtime (Skia Desktop): Given_ContentControl.When_Default_ContentAlignment_Is_Center — 1/1 pass. Constructs a fresh unstyled ContentControl and asserts HorizontalContentAlignment and VerticalContentAlignment are Center. This is a forward regression guard (Center/Center was already the default), not a fails-before test — a genuine fails-before test is structurally impossible here since the flag defaulted to false and nothing set it true.
  • Native Android/iOS heads and the WinAppSDK sync generator are not built locally — CI validates them. No PackageDiffIgnore API-diff surprises expected beyond the four flag entries above.

Breaking change

FeatureConfiguration.Control.UseLegacyContentAlignment is removed with no [Obsolete] shim (per the 7.0 hard-remove policy).

Impact: a compile error for any code referencing the flag. No runtime behaviour change for default users — the default was already Center/Center.

Migration: apps that set UseLegacyContentAlignment = true to keep the legacy Left/Top default should instead set HorizontalContentAlignment / VerticalContentAlignment explicitly (via a Style or per control). See migrating-to-uno-7.md.

🤖 Generated with Claude Code

@github-actions github-actions Bot added area/code-generation Categorizes an issue or PR as relevant to code generation area/build Categorizes an issue or PR as relevant to build infrastructure kind/documentation labels Jul 22, 2026
@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 223675 found UI Test snapshots differences: skia-linux-screenshots: 67, skia-windows-screenshots: 94

Details
  • skia-linux-screenshots: 67 changed over 2368

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • DataTransferManager.png
    • Gamepad_Enumeration.png-dark
    • DoubleImageBrushInList.png
    • ButtonClippingTestsControl.png-dark
    • Buttons.png-dark
    • Buttons.png
    • DynamicFont.png
    • Image_Margin_Large.png-dark
    • ClipboardTests.png-dark
    • Focus_FocusVisual_Properties.png-dark
    • Focus_FocusVisual_Properties.png
    • ContextRequested.png-dark
    • ContextRequested.png
    • EllipsemaskingEllipseGrid.png
    • Examples.png-dark
    • Examples.png
    • Image_AnimatedWebP.png
    • Gamepad_CurrentReading.png-dark
  • skia-windows-screenshots: 94 changed over 2392

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ClipboardTests.png-dark
    • ClipboardTests.png
    • DropDownButtonPage.png-dark
    • DropDownButtonPage.png
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • Gamepad_CurrentReading.png-dark
    • Buttons.png-dark
    • Buttons.png
    • DoubleImageBrushInList.png-dark
    • DoubleImageBrushInList.png
    • Examples.png
    • ExpanderColorValidationPage.png-dark
    • ImagesInlineInFlipView.png-dark
    • ImagesInlineInFlipView.png
    • Image_UseTargetSize.png
    • Gamepad_Enumeration.png-dark
    • ImageBrushInList.png-dark

@unodevops

Copy link
Copy Markdown
Contributor

⚠️⚠️ The build 223675 has failed on Uno.UI - CI.

@Xiaoy312
Xiaoy312 force-pushed the dev/xygu/20260722/bc45-drop-uselegacycontentalignment branch from 84d3f5d to e5cc9b8 Compare July 27, 2026 19:05
@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 224340 found UI Test snapshots differences: skia-linux-screenshots: 67, skia-windows-screenshots: 97

Details
  • skia-linux-screenshots: 67 changed over 2368

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • DataTransferManager.png
    • Gamepad_CurrentReading.png-dark
    • DoubleImageBrushInList.png
    • ContextRequested.png-dark
    • ContextRequested.png
    • Examples.png-dark
    • Examples.png
    • Image_Margin_Large.png-dark
    • BitmapIcon_Foreground.png
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • DisplayInformation.png-dark
    • DynamicFont.png
    • EllipsemaskingEllipseGrid.png
    • Image_AnimatedWebP.png
    • ElementLevelTheme.png-dark
    • ButtonClippingTestsControl.png-dark
    • ClipboardTests.png-dark
    • Gamepad_Enumeration.png-dark
    • ImageIconPage.png-dark
  • skia-windows-screenshots: 97 changed over 2392

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Gamepad_Enumeration.png-dark
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • ElementLevelTheme.png-dark
    • ElementLevelTheme.png
    • Focus_FocusVisual_Properties.png-dark
    • Image_UseTargetSize.png-dark
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • ContextRequested.png-dark
    • ImageBrushInList.png-dark
    • ImageBrushInList.png
    • ImageIconPage.png-dark
    • ColorPickerSample.png-dark
    • Image_AnimatedWebP.png-dark
    • Buttons.png-dark
    • Buttons.png
    • ClipboardTests.png-dark
    • ClipboardTests.png
    • DropDownButtonPage.png-dark

@Xiaoy312
Xiaoy312 force-pushed the dev/xygu/20260722/bc45-drop-uselegacycontentalignment branch from e5cc9b8 to 883dc14 Compare July 28, 2026 07:09
@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 224465 found UI Test snapshots differences: skia-linux-screenshots: 67, skia-windows-screenshots: 99

Details
  • skia-linux-screenshots: 67 changed over 2368

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • BitmapIcon_Foreground.png
    • DynamicFont.png
    • Gamepad_CurrentReading.png-dark
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • ContextRequested.png-dark
    • ContextRequested.png
    • DisplayInformation.png-dark
    • Image_AnimatedWebP.png
    • ButtonClippingTestsControl.png-dark
    • ElementLevelTheme.png-dark
    • DoubleImageBrushInList.png
    • Focus_FocusVisual_Properties.png-dark
    • Focus_FocusVisual_Properties.png
    • Buttons.png-dark
    • Buttons.png
    • ClipboardTests.png-dark
    • Gamepad_Enumeration.png-dark
    • ImageBrush_Stretch.png-dark
    • ImageIconPage.png-dark
  • skia-windows-screenshots: 99 changed over 2392

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • DisplayInformation.png-dark
    • Image_UseTargetSize.png-dark
    • Focus_FocusVisual_Properties.png-dark
    • ClipboardTests.png-dark
    • ClipboardTests.png
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • Buttons.png-dark
    • Buttons.png
    • ColorPickerSample.png-dark
    • DoubleImageBrushInList.png-dark
    • DoubleImageBrushInList.png
    • Gamepad_CurrentReading.png-dark
    • ImageBrushAlignmentXY.png-dark
    • ImageBrushAlignmentXY.png
    • ImageBrushInList.png-dark
    • ImageBrushInList.png
    • ImageIconPage.png-dark
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png

@unodevops

Copy link
Copy Markdown
Contributor

⚠️⚠️ The build 224465 has failed on Uno.UI - CI.

FeatureConfiguration.Control.UseLegacyContentAlignment was a Uno-only opt-in
that flipped Control's default HorizontalContentAlignment/VerticalContentAlignment
from the WinUI-correct Center/Center back to legacy Left/Top. It defaulted to
false, so removal is source-breaking only: the default was already Center/Center;
only apps that explicitly set the flag to true are affected.

Hard-remove it (no [Obsolete] shim):
- DependencyPropertyMixinGenerator: inline the Center/Center defaults, dropping
  the ternary that read the flag.
- FeatureConfiguration: delete the now-empty Control holder.
- PackageDiffIgnore (6.6): ignore the removed Control holder + the flag get/set.
- Given_ContentControl: regression guard locking the Center/Center default.
- migrating-to-uno-7.md: migration note for apps that set the flag.

BC45 of the 7.0 breaking-changes rollup (#8339).

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@Xiaoy312
Xiaoy312 force-pushed the dev/xygu/20260722/bc45-drop-uselegacycontentalignment branch from 883dc14 to bdb4aaf Compare July 29, 2026 14:08
@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 224741 found UI Test snapshots differences: skia-linux-screenshots: 88, skia-windows-screenshots: 88

Details
  • skia-linux-screenshots: 88 changed over 2392

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • DataTransferManager.png
    • Gamepad_Enumeration.png-dark
    • ImageSourceUrlMsAppDataScheme.png
    • Examples.png
    • ExpanderColorValidationPage.png-dark
    • Buttons.png-dark
    • Buttons.png
    • EllipsemaskingEllipseGrid.png
    • ImageBrushInList.png-dark
    • ImageBrushInList.png
    • Image_UseTargetSizeLate.png-dark
    • Image_UseTargetSizeLate.png
    • Gamepad_CurrentReading.png-dark
    • Gamepad_CurrentReading.png
    • Image_AnimatedWebP.png-dark
    • ClipboardTests.png-dark
    • ClipboardTests.png
    • DisplayInformation.png-dark
  • skia-windows-screenshots: 88 changed over 2392

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • DropDownButtonPage.png-dark
    • Gamepad_Enumeration.png-dark
    • ClipboardTests.png-dark
    • ClipboardTests.png
    • Examples.png
    • ExpanderColorValidationPage.png-dark
    • DynamicFont.png
    • ImageBrushAlignmentXY.png
    • Image_UseTargetSize.png-dark
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • Buttons.png-dark
    • ElementLevelTheme.png-dark
    • ElementLevelTheme.png
    • ImageIconPage.png-dark
    • DoubleImageBrushInList.png-dark
    • DoubleImageBrushInList.png
    • ImageBrushInList.png-dark
    • ImageBrushInList.png
    • CalendarView_Theming.png-dark

@unodevops

Copy link
Copy Markdown
Contributor

⚠️⚠️ The build 224741 has failed on Uno.UI - CI.

@mergify

mergify Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@Xiaoy312
Xiaoy312 merged commit 1a728bd into feature/breakingchanges Aug 3, 2026
68 checks passed
@Xiaoy312
Xiaoy312 deleted the dev/xygu/20260722/bc45-drop-uselegacycontentalignment branch August 3, 2026 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/build Categorizes an issue or PR as relevant to build infrastructure area/code-generation Categorizes an issue or PR as relevant to code generation kind/documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants