Skip to content

feat: Add text scaling (accessibility) support across all platforms - #22928

Merged
morning4coffe-dev merged 20 commits into
masterfrom
dev/mazi/a11y-text-scaling
May 7, 2026
Merged

morning4coffe-dev merged 20 commits into
masterfrom
dev/mazi/a11y-text-scaling

Conversation

@MartinZikmund

@MartinZikmund MartinZikmund commented Mar 31, 2026 •

Copy link
Copy Markdown
Member

Summary

Implements WinUI-compatible text scaling support, allowing Uno Platform apps to respect OS-level accessibility text size settings on all platforms. This was previously stubbed as [NotImplemented].

Closes #19056
Closes #20296
Closes https://github.com/unoplatform/kahua-private/issues/443

What changed

Core infrastructure

  • TextScaleHelper — Ports the WinUI logarithmic scaling formula (s_o = s_i + max(-e * ln(s_i) + 18, 0) * (f - 1)) from TextFormatting.cpp. Smaller fonts receive proportionally more scaling than larger fonts, matching WinUI behavior.
  • CoreServices.FontScale — Central font scale state with UpdateFontScale() that fires UISettings.TextScaleFactorChanged and recursively invalidates measure on all text elements when the scale changes.
  • FeatureConfiguration.Font — Existing IgnoreTextScaleFactor and MaximumTextScaleFactor are wired in; added TextScaleFactor override for testing/manual control.

Platform-specific text scale factor reading

  • Android — Reads FontScale from Resources.Configuration (already provided by the OS).
  • iOS/tvOS — Computes scale from UIFont.PreferredFontForTextStyle(Body).PointSize / 17.0 to derive relative scale from Dynamic Type.
  • Windows (Win32/Skia) — Reads HKCU\SOFTWARE\Microsoft\Accessibility\TextScaleFactor via registry P/Invoke.
  • Linux (X11/Skia) — Reads org.gnome.desktop.interface text-scaling-factor via the freedesktop Settings DBus portal.
  • macOS (Skia) — Returns 1.0 (macOS has no system-wide text scaling API; documented as known limitation).
  • Skia extension model — New ITextScaleFactorExtension interface via ApiExtensibility pattern, consistent with other Skia platform extensions.

Text control integration

  • TextBlock, RichTextBlock, ContentPresenter, Control — IsTextScaleFactorEnabled DependencyProperty implemented (default: true, inheritable, affects measure).
  • TextElement — IsTextScaleFactorEnabled DependencyProperty with change callback to invalidate Skia font info.
  • Skia rendering — Inline.skia.cs applies TextScaleHelper.GetScaledFontSize() when resolving font size.
  • WASM rendering — TextBlock.wasm.cs applies scaled font size to DOM element styles.

Application lifecycle

  • Application.InitializeTextScaling() reads the initial OS text scale factor at startup.
  • On Skia, subscribes to ITextScaleFactorExtension.TextScaleFactorChanged for live updates without app restart.
  • On Android, picks up changes via Activity.onConfigurationChanged.
  • On iOS, picks up changes via UIContentSizeCategoryDidChangeNotification.

Generated stubs updated

  • Removed [NotImplemented] from TextScaleFactor property and TextScaleFactorChanged event on UISettings.
  • Removed [NotImplemented] from IsTextScaleFactorEnabled on TextBlock, RichTextBlock, ContentPresenter, Control, and TextElement.

Tests

  • Unit tests (Given_TextScaleHelper) — Validate the logarithmic formula at various font sizes and scale factors, boundary conditions, and FeatureConfiguration overrides.
  • Runtime tests (Given_TextBlock_TextScaling) — Verify IsTextScaleFactorEnabled default values, property behavior, UISettings.TextScaleFactor returns valid values, and (on Skia) that scaled text blocks produce larger measured sizes than unscaled ones.
  • Sample page (TextScalingSample) — Interactive sample with configurable scale factor slider for visual validation.

Test plan

  • Build passes on Skia Desktop (Uno.UI-Skia-only.slnf)
  • Unit tests pass (Given_TextScaleHelper)
  • Runtime tests pass on Skia Desktop (Given_TextBlock_TextScaling)
  • Sample page renders correctly in SamplesApp
  • Verify on Android emulator: change system font size → app text scales
  • Verify on iOS simulator: change Dynamic Type size → app text scales
  • Verify on Windows: change Ease of Access text size → app text scales (after restart)
  • Verify IsTextScaleFactorEnabled=false opts out individual controls

🤖 Generated with Claude Code

MartinZikmund and others added 6 commits March 31, 2026 13:38
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Copilot AI review requested due to automatic review settings March 31, 2026 11:47
@github-actions github-actions Bot added platform/wasm 🌐 Categorizes an issue or PR as relevant to the WebAssembly platform platform/android 🤖 Categorizes an issue or PR as relevant to the Android platform platform/macos 🍏 Categorizes an issue or PR as relevant to the macOS platform platform/ios 🍎 Categorizes an issue or PR as relevant to the iOS platform area/skia ✏️ Categorizes an issue or PR as relevant to Skia area/automation Categorizes an issue or PR as relevant to project automation platform/x11 🐧 Categorizes an issue or PR as relevant to X11 labels Mar 31, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Implements WinUI-compatible accessibility text scaling across Uno by introducing a central font-scale state, wiring text-scale enablement through core text controls, and adding platform-specific text scale factor providers (Android/iOS + Skia extension model), along with tests and a SamplesApp page.

Changes:

  • Added text scaling core infrastructure (TextScaleHelper, CoreServices.FontScale/UpdateFontScale, FeatureConfiguration.Font.TextScaleFactor override) and OS change observation plumbing.
  • Implemented IsTextScaleFactorEnabled on key text-related controls (TextBlock, RichTextBlock, ContentPresenter, Control, TextElement) and applied scaled font sizes in Skia/WASM rendering paths.
  • Added Skia platform text scale factor extensions (Win32/X11/macOS), plus unit/runtime tests and a SamplesApp demo page.

Reviewed changes

Copilot reviewed 31 out of 36 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/Uno.UWP/UI/ViewManagement/UISettings.UIKit.cs Adds iOS/tvOS UISettings.TextScaleFactor implementation based on Dynamic Type.
src/Uno.UWP/UI/ViewManagement/UISettings.skia.cs Adds Skia extension interface + resolution/observation for text scale factor.
src/Uno.UWP/UI/ViewManagement/UISettings.cs Wires TextScaleFactor + change notification event plumbing (partial/platform-specific).
src/Uno.UWP/UI/ViewManagement/UISettings.Android.cs Adds Android UISettings.TextScaleFactor implementation from Configuration.FontScale.
src/Uno.UI/UI/Xaml/Window/Native/NativeWindow.UIKit.cs Updates global font scale on iOS content-size category changes.
src/Uno.UI/UI/Xaml/Internal/TextScaleHelper.cs Introduces WinUI logarithmic scaling formula + FeatureConfiguration overrides.
src/Uno.UI/UI/Xaml/Internal/CoreServices.cs Adds global font scale state, update method, and recursive invalidation of text elements.
src/Uno.UI/UI/Xaml/Documents/TextElement.cs Adds inheritable IsTextScaleFactorEnabled DP for text elements/inlines.
src/Uno.UI/UI/Xaml/Documents/Inline.skia.cs Applies scaled font size for Skia inlines; invalidates cached font info on scaling changes.
src/Uno.UI/UI/Xaml/Controls/TextBlock/TextBlock.wasm.cs Applies scaled font size to DOM styling; adds invalidation hook for scale changes.
src/Uno.UI/UI/Xaml/Controls/TextBlock/TextBlock.skia.cs Applies scaled font size in Skia font resolution.
src/Uno.UI/UI/Xaml/Controls/TextBlock/TextBlock.cs Adds inheritable IsTextScaleFactorEnabled DP (affects measure).
src/Uno.UI/UI/Xaml/Controls/RichTextBlock/RichTextBlock.cs Adds inheritable IsTextScaleFactorEnabled DP (affects measure).
src/Uno.UI/UI/Xaml/Controls/Icons/FontIcon.cs Removes NotImplemented attributes and changes default IsTextScaleFactorEnabled value.
src/Uno.UI/UI/Xaml/Controls/Control/Control.cs Adds inheritable IsTextScaleFactorEnabled DP for controls (affects measure).
src/Uno.UI/UI/Xaml/Controls/ContentPresenter/ContentPresenter.cs Adds inheritable IsTextScaleFactorEnabled DP (affects measure).
src/Uno.UI/UI/Xaml/ApplicationActivity.Android.cs Updates global font scale on Android configuration changes.
src/Uno.UI/UI/Xaml/Application.skia.cs Hooks Skia text scale factor change observation to update global font scale.
src/Uno.UI/UI/Xaml/Application.cs Initializes text scaling during app initialization.
src/Uno.UI/Generated/3.0.0.0/Microsoft.UI.Xaml.Documents/TextElement.cs Updates generated stubs to avoid duplicate IsTextScaleFactorEnabled declarations.
src/Uno.UI/Generated/3.0.0.0/Microsoft.UI.Xaml.Controls/TextBlock.cs Updates generated stubs to avoid duplicate IsTextScaleFactorEnabled declarations.
src/Uno.UI/Generated/3.0.0.0/Microsoft.UI.Xaml.Controls/RichTextBlock.cs Updates generated stubs to avoid duplicate IsTextScaleFactorEnabled declarations.
src/Uno.UI/Generated/3.0.0.0/Microsoft.UI.Xaml.Controls/Control.cs Updates generated stubs to avoid duplicate IsTextScaleFactorEnabled declarations.
src/Uno.UI/Generated/3.0.0.0/Microsoft.UI.Xaml.Controls/ContentPresenter.cs Updates generated stubs to avoid duplicate IsTextScaleFactorEnabled declarations.
src/Uno.UI/FeatureConfiguration.cs Adds FeatureConfiguration.Font.TextScaleFactor override and broadens scaling config availability.
src/Uno.UI.Tests/Windows_UI_Xaml_Internal/Given_TextScaleHelper.cs Adds unit tests for scaling formula + FeatureConfiguration overrides.
src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml_Controls/Given_TextBlock_TextScaling.cs Adds runtime tests for scaling enablement and measured-size impact (Skia).
src/Uno.UI.Runtime.Skia.X11/UI/ViewManagement/X11TextScaleFactorExtension.cs Adds X11 DBus-based scale factor reader extension.
src/Uno.UI.Runtime.Skia.X11/Hosting/X11ApplicationHost.cs Registers X11 text scale extension with ApiExtensibility.
src/Uno.UI.Runtime.Skia.Win32/UI/ViewManagement/Win32TextScaleFactorExtension.cs Adds Win32 registry-based scale factor reader extension.
src/Uno.UI.Runtime.Skia.Win32/Hosting/Win32Host.cs Registers Win32 text scale extension with ApiExtensibility.
src/Uno.UI.Runtime.Skia.MacOS/UI/ViewManagement/MacOSTextScaleFactorExtension.cs Adds macOS extension returning 1.0 (documented limitation).
src/Uno.UI.Runtime.Skia.MacOS/Hosting/MacSkiaHost.cs Registers macOS text scale extension with ApiExtensibility.
src/SamplesApp/UITests.Shared/Windows_UI_ViewManagement/TextScalingSample.xaml.cs Adds sample page code-behind displaying current scale and toggling scaling.
src/SamplesApp/UITests.Shared/Windows_UI_ViewManagement/TextScalingSample.xaml Adds sample page UI for visual validation.
src/SamplesApp/UITests.Shared/UITests.Shared.projitems Includes new sample page in SamplesApp build items.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 204728 found UI Test snapshots differences: android-28-net9: 17, android-28-net9-Snap: 24, ios: 5, ios-Snap: 45, skia-linux-screenshots: 71, skia-windows-screenshots: 89, wasm: 109, wasm-automated-net10.0-WinUI-Benchmarks-automated: 0, wasm-automated-net10.0-WinUI-Default-automated: 12, wasm-automated-net10.0-WinUI-RuntimeTests-0: 0, wasm-automated-net10.0-WinUI-RuntimeTests-1: 0, wasm-automated-net10.0-WinUI-RuntimeTests-2: 0

Details
  • android-28-net9: 17 changed over 758

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Detereminate_ProgressRing_Validation50_[#FF0000_#008000_#008000_#FF0000]_Progress-Ring-Value-50
    • When_ExtendedSelectionWithoutItemClick_Then_PointersEvents_UITests_Windows_UI_Xaml_Controls_ListView_ListView_Selection_Pointers
    • UpDownEnabledTest_UITests_Shared_Microsoft_UI_Xaml_Controls_NumberBoxTests_NumberBoxPage
    • NativeCommandBar_Size_Uno_UI_Samples_Content_UITests_CommandBar_CommandBar_Dynamic
    • ProgressRing_Visibility_Collapsed_UITests_Windows_UI_Xaml_Controls_ProgressRing_WindowsProgressRing_GH1220
    • When_Parent_PointerMoved_After_drag_on_ScrollViewer_-_touch
    • When_NoSelectionWithItemClick_Then_PointersEvents_UITests_Windows_UI_Xaml_Controls_ListView_ListView_Selection_Pointers
    • When_NoSelection_Then_PointersEvents_UITests_Windows_UI_Xaml_Controls_ListView_ListView_Selection_Pointers
    • WebView_NavigateToAnchor_Initial
    • WebView_NavigateToAnchor_Uno_UI_Samples_Content_UITests_WebView_WebView_AnchorNavigation
    • WebView_NavigateToLongString_AfterSuccess
    • When_Parent_PointerMoved_After_drag_on_non-scrolling_ScrollViewer
    • Detereminate_ProgressRing_Validation75_[#FF0000_#008000_#008000_#008000]_Progress-Ring-Value-75
    • ListView_ListViewWithHeader_InitializesTest_SamplesApp_Windows_UI_Xaml_Controls_ListView_HorizontalListViewGrouped
    • ProgressRing_IsEnabled_Running_UITests_Windows_UI_Xaml_Controls_ProgressRing_WindowsProgressRing_GH1220
    • Detereminate_ProgressRing_Validation25_[#FF0000_#008000_#FF0000_#FF0000]_Progress-Ring-Value-25
    • When_MultipleSelectionWithoutItemClick_Then_PointersEvents_UITests_Windows_UI_Xaml_Controls_ListView_ListView_Selection_Pointers
  • android-28-net9-Snap: 24 changed over 1069

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Default_SamplesApp_Wasm_Windows_UI_Xaml_Controls_ListView_ListView_IsSelected_SamplesApp_Wasm_Windows_UI_Xaml_Controls_ListView_ListView_IsSelected
    • NavigationView_MUXControlsTestApp_NavigationViewTopNavPage_MUXControlsTestApp_NavigationViewTopNavPage
    • CommandBar_Examples_Uno_UI_Samples_Content_UITests_CommandBar_CommandBar_Examples
    • Gesture_Recognizer_Pointer_Events_test_bench_UITests_Shared_Windows_UI_Input_GestureRecognizer_PointersEvents
    • ListView_HorizontalListView_Padding_SamplesApp_Windows_UI_Xaml_Controls_ListView_HorizontalListView_Padding
    • MediaPlayerElement_Mini_player_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_Minimal
    • ListView_ListView_With_ListViews_Count_Measure_UITests_Shared_Windows_UI_Xaml_Controls_ListView_ListView_With_ListViews_Count_Measure
    • RatingControl_UITests_Microsoft_UI_Xaml_Controls_RatingControlTests_RatingControlPage_UITests_Microsoft_UI_Xaml_Controls_RatingControlTests_RatingControlPage
    • TabView_MUXControlsTestApp_TabViewPage_MUXControlsTestApp_TabViewPage
    • TextBlock_UITests_Shared_Windows_UI_Xaml_Controls_TextBlockControl_TextBlock_Layout_UITests_Shared_Windows_UI_Xaml_Controls_TextBlockControl_TextBlock_Layout
    • Image_UniformToFill100x100_Uno_UI_Samples_UITests_ImageTestsControl_UniformToFill100x100
    • Scrolling_MUXControlsTestApp_ScrollViewWithScrollControllersPage_MUXControlsTestApp_ScrollViewWithScrollControllersPage
    • Transform_Basics_UITests_Shared_Windows_UI_Xaml_Media_Transform_Basics
    • CommandBarFlyout_MUXControlsTestApp_CommandBarFlyoutPage_MUXControlsTestApp_CommandBarFlyoutPage
    • NavigationView_MUXControlsTestApp_NavigationViewRS4Page_MUXControlsTestApp_NavigationViewRS4Page
    • Projection_PlaneProjection_Basic_UITests_Shared_Windows_UI_Xaml_Media_Projection_PlaneProjection_Basic
    • UIElement_TransformToVisual_Simple_UITests_Shared_Windows_UI_Xaml_UIElementTests_TransformToVisual_Simple
    • Image_Uno_UI_Samples_UITests_Image_Image_Stretch_Uno_UI_Samples_UITests_Image_Image_Stretch
    • MediaPlayerElement_Using_ogg_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_Ogg_Extension
    • Scrolling_MUXControlsTestApp_ScrollViewDynamicPage_MUXControlsTestApp_ScrollViewDynamicPage
  • ios: 5 changed over 213

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ProgressRing_Visibility_Collapsed_UITests_Windows_UI_Xaml_Controls_ProgressRing_WindowsProgressRing_GH1220
    • TextBox_UpdatedBinding_On_OneWay_Mode_UITests_Windows_UI_Xaml_Controls_TextBox_TextBox_Bindings
    • ProgressRing_IsEnabled_Running_UITests_Windows_UI_Xaml_Controls_ProgressRing_WindowsProgressRing_GH1220
    • ListView_SelectedItems_SamplesApp_Windows_UI_Xaml_Controls_ListView_ListViewSelectedItems
    • When_SingleSelectionWithoutItemClick_Then_PointersEvents_UITests_Windows_UI_Xaml_Controls_ListView_ListView_Selection_Pointers
  • ios-Snap: 45 changed over 988

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Buttons_Custom_Button_With_ContentTemplate_Uno_UI_Samples_Content_UITests_ButtonTestsControl_Custom_Button_With_ContentTemplate
    • Microsoft_UI_Xaml_Media_UITests_Windows_UI_Xaml_Media_ThemeShadowTests_ThemeShadow_Overlap_UITests_Windows_UI_Xaml_Media_ThemeShadowTests_ThemeShadow_Overlap
    • Performance_UITests_Windows_UI_Xaml_Performance_Performance_1000ButtonsContinuousRendering_UITests_Windows_UI_Xaml_Performance_Performance_1000ButtonsContinuousRendering
    • Brushes_GenericApp_Views_Content_UITests_ImageBrushTestControl_BorderImageBrushRelativeTransform_GenericApp_Views_Content_UITests_ImageBrushTestControl_BorderImageBrushRelativeTransform
    • Default_SamplesApp_Wasm_Windows_UI_Xaml_Controls_ListView_ListView_IsSelected_SamplesApp_Wasm_Windows_UI_Xaml_Controls_ListView_ListView_IsSelected
    • Grid_Grid_DataBound_ColumnRow_Definitions_Uno_UI_Samples_Content_UITests_GridTestsControl_Grid_DataBound_ColumnRow_Definitions
    • Image_UITests_Windows_UI_Xaml_Controls_ImageTests_Image_Formats_UITests_Windows_UI_Xaml_Controls_ImageTests_Image_Formats
    • Image_Uno_UI_Samples_UITests_Image_Image_Stretch_Alignment_Smaller_Uno_UI_Samples_UITests_Image_Image_Stretch_Alignment_Smaller
    • Microsoft_UI_Composition_UITests_Windows_UI_Composition_InteractionTrackerAndExpressionAnimationSample_UITests_Windows_UI_Composition_InteractionTrackerAndExpressionAnimationSample
    • Image_Uno_UI_Samples_UITests_Image_Image_Stretch_Alignment_Taller_Uno_UI_Samples_UITests_Image_Image_Stretch_Alignment_Taller
    • Image_Uno_UI_Samples_UITests_Image_Image_Stretch_Alignment_Wider_Uno_UI_Samples_UITests_Image_Image_Stretch_Alignment_Wider
    • NavigationView_MUXControlsTestApp_NavigationViewCustomThemeResourcesPage_MUXControlsTestApp_NavigationViewCustomThemeResourcesPage
    • NavigationView_MUXControlsTestApp_NavigationViewMenuItemStretchPage_MUXControlsTestApp_NavigationViewMenuItemStretchPage
    • Default_Uno_UI_Samples_Content_UITests_WebView_WebView_AnchorNavigation_Uno_UI_Samples_Content_UITests_WebView_WebView_AnchorNavigation
    • Grid_CenteredGridinGridwiththreefixedsizechildren_Uno_UI_Samples_Content_UITests_GridTestsControl_CenteredGridinGridwiththreefixedsizechildren
    • Grid_UITests_Windows_UI_Xaml_Controls_GridTestsControl_Grid_DynamicRowColumn_UITests_Windows_UI_Xaml_Controls_GridTestsControl_Grid_DynamicRowColumn
    • Image_UITests_Shared_Windows_UI_Xaml_Controls_ImageTests_Image_Stretch_Algmnt_Inf_Horizontal_UITests_Shared_Windows_UI_Xaml_Controls_ImageTests_Image_Stretch_Algmnt_Inf_Horizontal
    • Image_UITests_Shared_Windows_UI_Xaml_Controls_ImageTests_Image_Stretch_Alignment_SizeOnControl_UITests_Shared_Windows_UI_Xaml_Controls_ImageTests_Image_Stretch_Alignment_SizeOnControl
    • NavigationView_MUXControlsTestApp_NavigationViewMinimalPage_MUXControlsTestApp_NavigationViewMinimalPage
    • UIElement_TransformToVisual_Simple_UITests_Shared_Windows_UI_Xaml_UIElementTests_TransformToVisual_Simple
  • skia-linux-screenshots: 71 changed over 2322

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ColorPickerSample.png-dark
    • ColorPickerSample.png
    • DropDownButtonPage.png-dark
    • ClipboardTests.png-dark
    • ClipboardTests.png
    • DynamicFont.png-dark
    • DynamicFont.png
    • Gamepad_CurrentReading.png-dark
    • Gamepad_CurrentReading.png
    • Gamepad_Enumeration.png-dark
    • Gamepad_Enumeration.png
    • ImagesInlineInFlipView.png-dark
    • ImagesInlineInFlipView.png
    • DisplayInformation.png-dark
    • DisplayInformation.png
    • Buttons.png-dark
    • CalendarView_Theming.png-dark
    • Focus_FocusVisual_Properties.png-dark
    • CompositionEffectBrush.png-dark
    • CompositionEffectBrush.png
  • skia-windows-screenshots: 89 changed over 2324

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ContentPresenter_Template.png-dark
    • ContentPresenter_Template.png
    • ContentPresenter_TextProperties.png-dark
    • ContentPresenter_TextProperties.png
    • Focus_FocusVisual_Properties.png-dark
    • Focus_FocusVisual_Properties.png
    • ButtonClippingTestsControl.png-dark
    • ClipboardTests.png-dark
    • FluentStyle_NavigationViewSample.png-dark
    • FluentStyle_NavigationViewSample.png
    • HierarchicalNavigationViewMarkup.png-dark
    • HierarchicalNavigationViewMarkup.png
    • Gamepad_CurrentReading.png-dark
    • Gamepad_CurrentReading.png
    • Gamepad_Enumeration.png-dark
    • Gamepad_Enumeration.png
    • BitmapIcon_Foreground.png
    • Image_Stretch_Alignment_Bigger.png-dark
    • Image_Stretch_Alignment_Bigger.png
    • CalendarView_Theming.png-dark
  • wasm: 109 changed over 1068

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • GenericApp.Views.Samples.Shared.Content.UITests.GridViewMultipleSelectionMode
    • MUXControlsTestApp.CommandBarFlyoutPage
    • UITests.Shared.Windows_UI_Xaml.UIElementTests.TransformToVisual_Simple
    • UITests.Shared.Windows_UI_Xaml_Controls.Pivot.Pivot_CustomContent_Automated
    • UITests.Windows_UI_Xaml.FocusTests.Focus_FocusVisual_Properties
    • UITests.Windows_UI_Xaml_Controls.TextBox.TextBox_Foreground_Changing
    • UITests.Windows_UI_Xaml_Controls.TextBox.TextBox_ImplicitParentTextBlockStyle
    • UITests.Shared.Windows_UI_Xaml_Controls.TextBoxTests.TextBox_MaxLength
    • UITests.Shared.Windows_UI_Xaml_Controls.TextBoxTests.TextBox_Selection
    • UITests.Shared.Windows_UI_Xaml_Controls.TextBoxTests.TextBox_TextChanged
    • UITests.Windows_UI_Xaml_Controls.Repeater.ItemsRepeater_Nested
    • UITests.Windows_UI_Xaml_Controls.TextBox.TextBox_SelectionHighlightColor
    • UITests.Windows_UI_Xaml_Controls.TextBox.TextBox_Visibility
    • SamplesApp.Windows_UI_Xaml.Clipping.DoubleAnimationClipping
    • SamplesApp.Windows_UI_Xaml_Controls.ListView.ListView_Expandable_Item
    • SamplesApp.Wasm.Windows_UI_Xaml_Controls.ListView.ListView_IsSelected
    • SamplesApp.Windows_UI_Xaml_Controls.ListView.ListViewLegacy
    • UITests.Shared.Microsoft_UI_Xaml_Controls.ExpanderTests.WinUIExpanderPage
    • UITests.Shared.Windows_UI_Input.GestureRecognizerTests.Button_Inside_Border
    • SamplesApp.Windows_UI_Xaml_Controls.ListView.ListView_TextBox
  • wasm-automated-net10.0-WinUI-Benchmarks-automated: 0 changed over 1

  • wasm-automated-net10.0-WinUI-Default-automated: 12 changed over 877

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Default_StrokeThickness_MyPolygon
    • Default_StrokeThickness_MyPolyline
    • Default_StrokeThickness_MyLine
    • Default_StrokeThickness_MyPath
    • SequentialAnimations_SamplesApp_Windows_UI_Xaml_Media_Animation_SequentialAnimationsPage
    • TestProgressRing_InitialState_UITests_Microsoft_UI_Xaml_Controls_ProgressRing_WinUIProgressRing_Features
    • When_SingleSelectionWithoutItemClick_Then_PointersEvents_UITests_Windows_UI_Xaml_Controls_ListView_ListView_Selection_Pointers
    • When_StretchAndAlignmentNone_ImageBrush-50-50-None-XLeft-YBottom
    • Default_StrokeThickness_MyRect
    • Default_StrokeThickness_MyEllipse
    • When_Theme_Changed_No_Crash_UITests_Windows_UI_Xaml_Controls_CalendarView_CalendarView_Theming
    • ListView_SelectedItems_SamplesApp_Windows_UI_Xaml_Controls_ListView_ListViewSelectedItems
  • wasm-automated-net10.0-WinUI-RuntimeTests-0: 0 changed over 1

  • wasm-automated-net10.0-WinUI-RuntimeTests-1: 0 changed over 1

  • wasm-automated-net10.0-WinUI-RuntimeTests-2: 0 changed over 1

@morning4coffe-dev

Copy link
Copy Markdown
Member

@copilot resolve the merge conflicts in this pull request

Copilot AI and others added 2 commits April 23, 2026 11:05
…scaling

# Conflicts:
#	src/Uno.UI/Generated/3.0.0.0/Microsoft.UI.Xaml.Controls/ContentPresenter.cs
#	src/Uno.UI/Generated/3.0.0.0/Microsoft.UI.Xaml.Controls/Control.cs
#	src/Uno.UI/Generated/3.0.0.0/Microsoft.UI.Xaml.Controls/RichTextBlock.cs
#	src/Uno.UI/Generated/3.0.0.0/Microsoft.UI.Xaml.Controls/TextBlock.cs
#	src/Uno.UI/Generated/3.0.0.0/Microsoft.UI.Xaml.Documents/TextElement.cs

Co-authored-by: morning4coffe-dev <[email protected]>
@CLAassistant

CLAassistant commented Apr 23, 2026 •

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
2 out of 3 committers have signed the CLA.

✅ morning4coffe-dev
✅ MartinZikmund
❌ Copilot
You have signed the CLA already but the status is still pending? Let us recheck it.

Copilot AI commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

@copilot resolve the merge conflicts in this pull request

Resolved the merge conflicts in commit 469d0fc. The 5 generated files (ContentPresenter.cs, Control.cs, RichTextBlock.cs, TextBlock.cs, TextElement.cs) had conflicts due to a regeneration on master — resolved by taking the master structure and keeping our IsTextScaleFactorEnabled as "already declared" skip comments.

Also addressed the code review feedback in commit cf72513:

  • TextScaleHelper.GetScaledFontSize() now returns the original font size unchanged when fontScale <= 1.0, preventing negative values on Android/iOS
  • X11TextScaleFactorExtension now disposes the DBusConnection and raises TextScaleFactorChanged after the initial async read completes
  • FontIcon.IsTextScaleFactorEnabledProperty default aligned to true (matching FontIconSource)

Copilot AI review requested due to automatic review settings May 4, 2026 22:31
@MartinZikmund
MartinZikmund removed the request for review from Copilot May 4, 2026 22:31
Copilot AI review requested due to automatic review settings May 4, 2026 22:36
@MartinZikmund
MartinZikmund removed the request for review from Copilot May 4, 2026 22:36

Copilot AI commented May 4, 2026 •

Copy link
Copy Markdown
Contributor

@copilot investigate CI failures for this PR with a focus on text scaling changes.

Context:
...

Investigated and pushed fixes in 10c73e8 (plus 62b65d7 / 2db0787). I couldn’t access the Azure/GitHub CI logs directly from this session, so I narrowed it from the repo + local validation.

Root causes grouped by behavior:

  1. Effective scale inconsistency for fontScale < 1.0: GetScaledFontSize() treated <= 1.0 as no scaling, but GetEffectiveFontScale() still returned raw values below 1.0. That meant Android/iOS could trigger global UpdateFontScale() relayout/invalidation even when rendered text size should remain unchanged. Fixed by clamping effective scale to >= 1.0 and adding unit coverage.
  2. Nested inline cache invalidation gap: only top-level TextBlock.Inlines were invalidated, so nested Span -> Run trees could keep stale font info after scale changes. Fixed by traversing the full inline tree and adding a runtime test for nested inlines.
  3. Repeated UISettings allocations in change handlers: Android/iOS/Skia callbacks were creating fresh UISettings instances on each notification. Fixed by switching those paths to a shared static text-scale reader.
  4. Skia/X11 startup/update robustness: Skia extension lookup could cache “not found”, startup could read before subscription, and X11 updates needed explicit UI-thread marshaling. Fixed by retrying extension resolution, subscribing before the initial read, and routing X11 updates/watch callbacks through the UI thread.
  5. XAML Style Check: src/SamplesApp/UITests.Shared/Windows_UI_ViewManagement/TextScalingSample.xaml was the formatter drift; it is now formatted.

Direct text-scaling assertions that map into the failing mobile shards:

  • Android Runtime Tests 2: Given_TextBlock_TextScaling.When_ContentPresenter_IsTextScaleFactorEnabled_Default_Is_True (Assert.IsTrue(presenter.IsTextScaleFactorEnabled)), Given_TextBlock_TextScaling.When_TextScaleFactor_Returns_Valid_Value (Assert.IsTrue(uiSettings.TextScaleFactor > 0, ...))
  • Android Runtime Tests 4: Given_FontIcon.When_Defaults (Assert.IsTrue(fontIcon.IsTextScaleFactorEnabled))
  • iOS Runtime Tests 0: Given_TextBlock_TextScaling.When_IsTextScaleFactorEnabled_Default_Is_True
  • iOS Runtime Tests 1: the direct default/property assertions above plus Given_FontIcon.When_Defaults
  • iOS Runtime Tests 4 / 7: no direct text-scaling assertion tests shard there, which points to indirect layout/measure side effects rather than a single explicit text-scaling assertion.

Local validation:

  • dotnet xstyler -d src/SamplesApp -r -p ✅
  • dotnet build src/Uno.UI/Uno.UI.Tests.csproj --no-restore -v:q ✅
  • dotnet build src/SamplesApp/SamplesApp.Skia.Generic/SamplesApp.Skia.Generic.csproj -c Release -f net10.0 --no-restore ✅
  • Runtime execution attempt was blocked in this sandbox by missing Skia host/framebuffer access (No platform host could be selected).

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • dev.azure.com
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 210756 found UI Test snapshots differences: skia-linux-screenshots: 0, skia-windows-screenshots: 522, wasm: 0

Details
  • skia-linux-screenshots: 0 changed over 2338

  • skia-windows-screenshots: 522 changed over 2340

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • AppXamlDefinedResources.png-dark
    • AutomationProperties_Name.png-dark
    • ClippingRoundedCorners.png-dark
    • ClippingRoundedCorners.png
    • DisplayInformation.png-dark
    • DisplayInformation.png
    • Dopes.png-dark
    • Dopes.png
    • ElevatedView_Tester.png-dark
    • ElevatedView_Tester.png
    • Elevation.png-dark
    • Elevation.png
    • Focus_VisualStates.png-dark
    • Focus_VisualStates.png
    • Focus_WASM_Tab.png-dark
    • Focus_WASM_Tab.png
    • ApplicationViewMode.png-dark
    • AutomationProperties_AutomationId.png-dark
    • BadgeNotificationTests.png
    • DataTransferManager.png-dark
  • wasm: 0 changed over 1073

Copilot AI review requested due to automatic review settings May 5, 2026 10:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 34 out of 39 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 210843 found UI Test snapshots differences: skia-linux-screenshots: 0, skia-windows-screenshots: 88, wasm: 0

Details
  • skia-linux-screenshots: 0 changed over 2338

  • skia-windows-screenshots: 88 changed over 2340

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • Focus_FocusVisual_Properties.png-dark
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • DropDownButtonPage.png-dark
    • DropDownButtonPage.png
    • HierarchicalNavigationViewMarkup.png-dark
    • HierarchicalNavigationViewMarkup.png
    • Gamepad_CurrentReading.png
    • Gamepad_Enumeration.png-dark
    • Gamepad_Enumeration.png
    • ElementLevelTheme.png-dark
    • ElementLevelTheme.png
    • Examples.png-dark
    • Examples.png
    • ContentPresenter_TextProperties.png-dark
    • ContentPresenter_TextProperties.png
    • FluentStyle_NavigationViewSample.png-dark
    • FluentStyle_NavigationViewSample.png
  • wasm: 0 changed over 1073

@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 211011 found UI Test snapshots differences: skia-linux-screenshots: 0, skia-windows-screenshots: 89, wasm: 0

Details
  • skia-linux-screenshots: 0 changed over 2338

  • skia-windows-screenshots: 89 changed over 2340

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • FluentStyle_NavigationViewSample.png-dark
    • FluentStyle_NavigationViewSample.png
    • Gamepad_CurrentReading.png-dark
    • Gamepad_Enumeration.png-dark
    • Gamepad_Enumeration.png
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • ContentPresenter_TextProperties.png-dark
    • ContentPresenter_TextProperties.png
    • DoubleImageBrushInList.png-dark
    • DropDownButtonPage.png-dark
    • DoubleImageBrushInList.png
    • HierarchicalNavigationViewMarkup.png-dark
    • HierarchicalNavigationViewMarkup.png
    • Image_Stretch_Alignment_Bigger.png-dark
    • Image_Stretch_Alignment_Bigger.png
    • Buttons.png-dark
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • ContentPresenter_NativeEmbedding_ZIndex.png
  • wasm: 0 changed over 1073

@unodevops

Copy link
Copy Markdown
Contributor

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

Copilot AI review requested due to automatic review settings May 7, 2026 10:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 35 out of 40 changed files in this pull request and generated 3 comments.

@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 211423 found UI Test snapshots differences: skia-linux-screenshots: 0, skia-windows-screenshots: 91, wasm: 0

Details
  • skia-linux-screenshots: 0 changed over 2338

  • skia-windows-screenshots: 91 changed over 2344

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • HierarchicalNavigationViewMarkup.png-dark
    • HierarchicalNavigationViewMarkup.png
    • Buttons.png-dark
    • Buttons.png
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • ClipboardTests.png-dark
    • ClipboardTests.png
    • DropDownButtonPage.png-dark
    • DropDownButtonPage.png
    • DoubleImageBrushInList.png-dark
    • DoubleImageBrushInList.png
    • FluentStyle_NavigationViewSample.png-dark
    • FluentStyle_NavigationViewSample.png
    • Focus_FocusVisual_Properties.png-dark
    • Focus_FocusVisual_Properties.png
    • Image_Stretch_None.png-dark
    • Image_Stretch_None.png
    • Image_Stretch_Alignment_Bigger.png-dark
    • Image_Stretch_Alignment_Bigger.png
  • wasm: 0 changed over 1073

@morning4coffe-dev
morning4coffe-dev merged commit 07033da into master May 7, 2026
77 checks passed
@morning4coffe-dev
morning4coffe-dev deleted the dev/mazi/a11y-text-scaling branch May 7, 2026 21:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/automation Categorizes an issue or PR as relevant to project automation area/skia ✏️ Categorizes an issue or PR as relevant to Skia platform/android 🤖 Categorizes an issue or PR as relevant to the Android platform platform/ios 🍎 Categorizes an issue or PR as relevant to the iOS platform platform/macos 🍏 Categorizes an issue or PR as relevant to the macOS platform platform/wasm 🌐 Categorizes an issue or PR as relevant to the WebAssembly platform platform/x11 🐧 Categorizes an issue or PR as relevant to X11

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Android/iOS SkiaRenderer] System text size setting is not respected Accessibility Scaling Doesn't Work

7 participants