Skip to content

refactor(controls)!: Remove no-op OnVerticalContentAlignmentChanged (BC34) - #23747

Merged
Xiaoy312 merged 1 commit into
feature/breakingchangesfrom
dev/xygu/20260713/bc34-remove-onverticalcontentalignmentchanged
Jul 29, 2026
Merged

Xiaoy312 merged 1 commit into
feature/breakingchangesfrom
dev/xygu/20260713/bc34-remove-onverticalcontentalignmentchanged

Conversation

@Xiaoy312

Copy link
Copy Markdown
Contributor

GitHub Issue: #8339

PR Type:

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

What changed? 🚀

Removes a Uno-only no-op API surface around content-alignment change notifications (BC34 of the Phase 5 breaking-changes wave):

  • TextBox.OnVerticalContentAlignmentChanged — deleted the empty protected override. It overrode Control's (mixin-generated) virtual with an empty body to suppress it, but that base is itself a no-op (its …Partial hooks are never implemented), so the override suppressed nothing.
  • ContentPresenter.OnVerticalContentAlignmentChanged / OnHorizontalContentAlignmentChanged — deleted both protected virtual methods and their unused partial void …Partial hooks. WinUI's ContentPresenter exposes neither. Layout invalidation is unchanged: it is driven by the FrameworkPropertyMetadataOptions.AffectsArrange option already on both DependencyProperty registrations. The change-callback lambdas (which only forwarded to the removed methods) are dropped, leaving a FrameworkPropertyMetadata(defaultValue, AffectsArrange) metadata.

The Horizontal twin is removed alongside Vertical so ContentPresenter stays symmetric and closer to the WinUI surface.

⚠️ Generator check (resolved): the DependencyPropertyMixinGenerator emits On…ContentAlignmentChanged only for Control (not TextBox, not ContentPresenter). Both removed members are hand-written and re-emitted by nothing, so no generator change was needed. Control's base virtual is untouched, so TextBox still inherits an (inherited, no-op) OnVerticalContentAlignmentChanged.

Validation

  • Compile: SamplesApp.Skia.Generic (net10.0 Skia) builds clean (0 warnings / 0 errors), transitively compiling Uno.UI, Uno.UI.RuntimeTests, and the samples.
  • Non-behavioural: all removed members are provable no-ops (the …Partial hooks were never implemented on any platform; AffectsArrange retained), so compile + PackageDiff coverage is sufficient — no runtime test added.
  • Native Android/iOS heads not built locally — CI validates them; grep confirmed no native partial implementation of the removed hooks.

PackageDiffIgnore.xml (6.5 baseline) gets three <Methods> entries for the removed TextBox / ContentPresenter methods.

PR Checklist ✅

  • 🧪 Added Runtime tests / UI tests / manual sample — N/A: not a behaviour change (removed members were no-ops; AffectsArrange unchanged).
  • 📚 Docs added/updated — N/A (migration note below).
  • 🖼️ Validated PR Screenshots Compare Test Run results — N/A (no visual change).
  • ❗ Contains NO breaking changes — intentionally left unchecked; this is a breaking change (see below).
  • 👀 Reviewed 2 other open pull requests

Breaking change — impact & migration path

  • Impact (source-breaking): subclasses that override ContentPresenter.OnVerticalContentAlignmentChanged / OnHorizontalContentAlignmentChanged, or TextBox.OnVerticalContentAlignmentChanged, no longer compile.
  • Migration: these overrides can be deleted — they were no-ops. To react to a content-alignment change, use a DependencyPropertyChangedCallback on VerticalContentAlignmentProperty / HorizontalContentAlignmentProperty instead. This matches WinUI, which never exposed these virtuals.

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

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 222144 found UI Test snapshots differences: skia-linux-screenshots: 68, skia-windows-screenshots: 82

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

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Focus_FocusVisual_Properties.png-dark
    • EllipsemaskingEllipseGrid.png
    • ImageBrushInList.png-dark
    • ImageBrushInList.png
    • Image_Margin_Large.png
    • ClipboardTests.png-dark
    • ClipboardTests.png
    • Buttons.png-dark
    • Buttons.png
    • ColorPickerSample.png
    • CompositionPath.png
    • DisplayInformation.png-dark
    • CornerRadiusControls.png
    • DoubleImageBrushInList.png-dark
    • DoubleImageBrushInList.png
    • ElementLevelTheme.png-dark
    • Examples.png-dark
    • Examples.png
    • ExpanderColorValidationPage.png-dark
    • Gamepad_CurrentReading.png-dark
  • skia-windows-screenshots: 82 changed over 2368

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Examples.png
    • ExpanderColorValidationPage.png-dark
    • Gamepad_CurrentReading.png-dark
    • Basics Pivot Test.png
    • Image_UseTargetSize.png
    • DoubleImageBrushInList.png-dark
    • DoubleImageBrushInList.png
    • CalendarView_Theming.png-dark
    • Gamepad_Enumeration.png-dark
    • ImageBrushInList.png-dark
    • ImageBrushInList.png
    • ClipboardTests.png-dark
    • DropDownButtonPage.png-dark
    • DropDownButtonPage.png
    • Focus_FocusVisual_Properties.png-dark
    • Buttons.png-dark
    • Buttons.png
    • DisplayInformation.png-dark
    • ElementLevelTheme.png-dark
    • ElementLevelTheme.png

@unodevops

Copy link
Copy Markdown
Contributor

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

@Xiaoy312
Xiaoy312 force-pushed the dev/xygu/20260713/bc34-remove-onverticalcontentalignmentchanged branch from 337380a to 3949a80 Compare July 16, 2026 14:59
@Xiaoy312
Xiaoy312 enabled auto-merge July 16, 2026 14:59
@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 222655 found UI Test snapshots differences: skia-linux-screenshots: 67, skia-windows-screenshots: 95

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

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

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ColorPickerSample.png-dark
    • DisplayInformation.png-dark
    • CalendarView_Theming.png-dark
    • ElementLevelTheme.png-dark
    • ElementLevelTheme.png
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • Image_AnimatedWebP.png-dark
    • Gamepad_Enumeration.png-dark
    • DoubleImageBrushInList.png-dark
    • DoubleImageBrushInList.png
    • Buttons.png-dark
    • Buttons.png
    • ContentPresenter_NativeEmbedding_ZIndex.png
    • Focus_FocusVisual_Properties.png-dark
    • ClipboardTests.png-dark
    • ClipboardTests.png
    • ImageBrushAlignmentXY.png-dark
    • ImageBrushAlignmentXY.png
    • Examples.png

@Xiaoy312
Xiaoy312 force-pushed the dev/xygu/20260713/bc34-remove-onverticalcontentalignmentchanged branch from 3949a80 to 7fd95c0 Compare July 22, 2026 14:33
@Xiaoy312 Xiaoy312 added the ready-to-merge Automatically merge the PR once all '.mergify.yml' policies are met label Jul 22, 2026
@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 223588 found UI Test snapshots differences: skia-linux-screenshots: 67, skia-windows-screenshots: 100

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

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

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ColorPickerSample.png-dark
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • DisplayInformation.png-dark
    • Gamepad_Enumeration.png-dark
    • DropDownButtonPage.png-dark
    • DropDownButtonPage.png
    • ElementLevelTheme.png-dark
    • ElementLevelTheme.png
    • Focus_FocusVisual_Properties.png-dark
    • Image_UseTargetSize.png-dark
    • ContextRequested.png-dark
    • DoubleImageBrushInList.png-dark
    • DoubleImageBrushInList.png
    • Gamepad_CurrentReading.png-dark
    • ImageBrushInList.png-dark
    • ImageBrushInList.png
    • Buttons.png-dark

@unodevops

Copy link
Copy Markdown
Contributor

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

@Xiaoy312
Xiaoy312 force-pushed the dev/xygu/20260713/bc34-remove-onverticalcontentalignmentchanged branch from 7fd95c0 to 8cef550 Compare July 27, 2026 19:24
@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 224356 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) 🚨🚨
    • DisplayInformation.png-dark
    • EllipsemaskingEllipseGrid.png
    • BitmapIcon_Foreground.png
    • ClipboardTests.png-dark
    • Examples.png-dark
    • Examples.png
    • Image_Margin_Large.png-dark
    • Buttons.png
    • Buttons.png-dark
    • ContextRequested.png-dark
    • ContextRequested.png
    • Gamepad_CurrentReading.png-dark
    • DataTransferManager.png
    • Image_AnimatedWebP.png
    • ButtonClippingTestsControl.png-dark
    • CalendarView_Theming.png-dark
    • DoubleImageBrushInList.png
    • ElementLevelTheme.png-dark
    • Gamepad_Enumeration.png-dark
    • Focus_FocusVisual_Properties.png-dark
  • skia-windows-screenshots: 97 changed over 2392

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • Examples.png
    • ExpanderColorValidationPage.png-dark
    • ImageBrushInList.png-dark
    • ImageBrushInList.png
    • Image_UseTargetSize.png-dark
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • ClipboardTests.png-dark
    • ClipboardTests.png
    • DropDownButtonPage.png-dark
    • DropDownButtonPage.png
    • Focus_FocusVisual_Properties.png-dark
    • Buttons.png-dark
    • Buttons.png
    • Gamepad_CurrentReading.png-dark
    • DisplayInformation.png-dark
    • ElementLevelTheme.png-dark
    • ElementLevelTheme.png

@unodevops

Copy link
Copy Markdown
Contributor

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

@Xiaoy312
Xiaoy312 force-pushed the dev/xygu/20260713/bc34-remove-onverticalcontentalignmentchanged branch from 8cef550 to 2c8bc23 Compare July 28, 2026 07:14
@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 224472 found UI Test snapshots differences: skia-linux-screenshots: 67, skia-windows-screenshots: 93

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

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

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Focus_FocusVisual_Properties.png-dark
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • ButtonClippingTestsControl.png-dark
    • HierarchicalNavigationViewMarkup.png-dark
    • ClipboardTests.png-dark
    • ClipboardTests.png
    • ElementLevelTheme.png-dark
    • ElementLevelTheme.png
    • Gamepad_Enumeration.png-dark
    • ColorPickerSample.png-dark
    • ColorPickerSample.png
    • DisplayInformation.png-dark
    • Gamepad_CurrentReading.png-dark
    • ImageIconPage.png-dark
    • Buttons.png-dark
    • Buttons.png
    • DropDownButtonPage.png-dark
    • DropDownButtonPage.png
    • DoubleImageBrushInList.png-dark

@mergify

mergify Bot commented Jul 28, 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

…BC34)

Delete the empty `TextBox.OnVerticalContentAlignmentChanged` override and the
`ContentPresenter` base `On[Vertical|Horizontal]ContentAlignmentChanged`
virtuals. All were no-ops: the `...Partial` hooks were never implemented on any
platform, and layout invalidation is still driven by the `AffectsArrange`
metadata option on the DependencyProperties. Neither is emitted by the
DependencyProperty mixin generator (it only emits the Control base), so nothing
regenerates them. The Horizontal twin is removed alongside Vertical to keep
ContentPresenter symmetric and closer to the WinUI surface.

Registered the removals under PackageDiffIgnore <IgnoreSet baseVersion="6.5">.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@Xiaoy312
Xiaoy312 force-pushed the dev/xygu/20260713/bc34-remove-onverticalcontentalignmentchanged branch from 2c8bc23 to 88f59da Compare July 29, 2026 14:13
@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

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

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

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • ClipboardTests.png-dark
    • CalendarView_Theming.png-dark
    • ClipboardTests.png
    • CalendarView_Theming.png
    • DataTransferManager.png
    • DoubleImageBrushInList.png-dark
    • DoubleImageBrushInList.png
    • Buttons.png-dark
    • Buttons.png
    • Basics Pivot Test.png
    • ColorPickerSample.png
    • Focus_FocusVisual_Properties.png-dark
    • Focus_FocusVisual_Properties.png
    • Examples.png
    • ElementLevelTheme.png-dark
    • ExpanderColorValidationPage.png-dark
    • ElementLevelTheme.png
    • Gamepad_CurrentReading.png-dark
  • skia-windows-screenshots: 91 changed over 2392

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ClipboardTests.png-dark
    • ClipboardTests.png
    • DisplayInformation.png-dark
    • DisplayInformation.png
    • ElementLevelTheme.png-dark
    • ElementLevelTheme.png
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • ImageBrushInList.png-dark
    • ImageBrushInList.png
    • Examples.png
    • ExpanderColorValidationPage.png-dark
    • ContextRequested.png-dark
    • CalendarView_Theming.png-dark
    • Buttons.png-dark
    • CalendarView_Theming.png
    • Buttons.png
    • DoubleImageBrushInList.png-dark
    • DoubleImageBrushInList.png
    • ImageBrushAlignmentXY.png-dark

@Xiaoy312
Xiaoy312 merged commit 5a1f517 into feature/breakingchanges Jul 29, 2026
68 checks passed
@Xiaoy312
Xiaoy312 deleted the dev/xygu/20260713/bc34-remove-onverticalcontentalignmentchanged branch July 29, 2026 19:21
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 kind/documentation ready-to-merge Automatically merge the PR once all '.mergify.yml' policies are met

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants