Skip to content

chore(winui-sync): Track TitleBar - #26600

Merged
MartinZikmund merged 4 commits into
masterfrom
dev/mazi/winui-sync-titlebar
Nov 23, 2026
Merged

MartinZikmund merged 4 commits into
masterfrom
dev/mazi/winui-sync-titlebar

Conversation

@MartinZikmund

@MartinZikmund MartinZikmund commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

GitHub Issue: closes unoplatform/uno-private#2641

Part of unoplatform/uno-private#2616.

PR Type:

🤖 Project automation

What changed? 🚀

This adds TitleBar (titlebar) to the WinUI port sync (build/winui-sync/areas/titlebar.json) at winui3/release/2.7.0 (1b5b1a0ccc0). Before recording it, I caught the port up, reviewed it line by line against 2.7.0, and audited its Uno workarounds.

Mapping

Upstream Uno
Sources controls/dev/TitleBar src/Uno.UI/UI/Xaml/Controls/TitleBar
Tests controls/dev/TitleBar/InteractionTests src/Uno.UI.RuntimeTests/Microsoft/UI/Xaml/Controls/TitleBar (new)
Strings controls/dev/TitleBar/Strings src/Uno.UI/UI/Xaml/Controls/TitleBar/Strings
Mirrors TitleBar.xaml, TitleBar_themeresources.xaml Uno.UI.FluentTheme/Resources/PriorityDefault/ (same names)

The two theme XAML files are byte-for-byte upstream apart from their header, so they are mapped as mirrors (same as InfoBadge, DropDownButton and ScrollView). Given_TitleBar.cs is Uno-written and stays out of the mapping.

Starting point

The headers named 5f9e85113 (6 files: automation peer, template settings, TitleBar.cs), fc2f82117 (3 files: TitleBar.mux.cs, .mux.h.cs, .Properties.cs) and winui3/release/2.5.1 (the 2 theme XAML files). 5f9e85113 is an ancestor of fc2f82117, so I took the oldest one, 5f9e85113, as the starting point.

Release tags are "Syncing content" squash commits, so neither main-line commit is an ancestor of the 2.7.0 tag. I compared trees instead of history. Detection reported +1103/−47 from 5f9e85113. Nearly all of that is code the port already had from fc2f82117, plus tests, TestUI and the perf2026 XAML. The TitleBar folder is identical between 2.5.1 and 2.7.0.

Upstream changes (5f9e85113 → 2.7.0)

Ported

  • TitleBar.cpp/.h/.idl: custom drag regions (AutoRefreshDragRegions, RecomputeDragRegions(), the IsDragRegion attached property, FindInteractableElements, OnContentLayoutUpdated, skipping unchanged passthrough rects), title reset (HandleTitleChange, ResetTitle, default-title capture) and the cached AppWindow. These were already in the port from fc2f82117. The review checked each of them against 2.7.0.
  • InteractionTests/TitleBarTests.cs → TitleBarInteractionTests.mux.cs: all 8 tests ported as runtime tests. Upstream drives a TestUI page through UI Automation; here the page's TitleBar is built in code and the APIs are called directly, following DropDownButtonInteractionTests.mux.cs.

Not applicable

  • WinAppSdk::Containment::IsChangeEnabled<WINAPPSDK_CHANGEID_61831627>() gates and the "old code path" branches in OnPropertyChanged, UpdateInteractableElementsList and friends. This is WinAppSDK servicing containment, a kill switch for a shipped change. Uno takes the enabled path, which is what WinUI runs by default.
  • [MUX_PREVIEW] → [MUX_PUBLIC_V11] on the new API: IDL contract metadata. The API is already public in Uno.
  • TitleBar_themeresources_perf2026.xaml and its vcxitems entries: Uno has no perf2026 resource variants.
  • TestUI/* (TitleBarPage, TitleBarPageWindow): Uno has no sample ported from them. The interaction tests above build the page in code.
  • TitleBarTrace.h: tracing. The trace calls stay commented out, as in the rest of the port.

Skipped: none, so there is no skipped-items issue.

Review table (line by line against 2.7.0)

Upstream Uno Members compared Gaps fixed Still differing (marker)
TitleBar.cpp TitleBar.mux.cs ctor, dtor, OnApplyTemplate, HandleTitleChange, OnPropertyChanged, GoToState, all event handlers, OnIsDragRegionPropertyChanged, every Update*, GetBounds, RecomputeDragRegions, Load*Button, GetAppWindowId, GetInputNonClientPointerSource, TryGetAppWindow, FindInteractableElements none InputActivationListener on Loaded/Unloaded; dtor commented out; AttachInsetsChangedListener; UpdateRegionsAfterLayout (all Uno specific)
TitleBar.h TitleBar.mux.h.cs all fields, revokers, part and state names added missing s_layoutRootPartName; moved the Uno-only m_insetsChangedRevoker/m_paddingLayoutUpdatedRevoker out from among the upstream fields, under an Uno specific marker none
TitleBar.idl (+ generated properties) TitleBar.Properties.cs, TitleBar.cs 11 DPs incl. AutoRefreshDragRegions and attached IsDragRegion (types, defaults, callbacks), GetIsDragRegion/SetIsDragRegion, 2 events, [ContentProperty] none none
TitleBarAutomationPeer.cpp/.h TitleBarAutomationPeer.mux.cs, .cs ctor, GetAutomationControlTypeCore, GetClassNameCore, GetNameCore none none
TitleBarTemplateSettings.cpp/.h/idl TitleBarTemplateSettings*.cs ctor, IconElement DP none none
TitleBar.xaml, TitleBar_themeresources.xaml same names (mirrors) whole file none (verbatim) none
Strings/* (86 locales) Strings/* mirrored with Sync-AreaStrings none (identical) none

Workaround audit

Location What it does Verdict Evidence
TitleBar.mux.cs ctor / OnLoaded / OnUnloaded / AttachInputActivationListener Subscribes to the window's InputActivationListener on Loaded and drops it on Unloaded, instead of in OnApplyTemplate kept WinUI revokes this in ~TitleBar. C# has no deterministic destructor, and the listener is window-scoped, so subscribing in OnApplyTemplate would root every TitleBar for the window's lifetime.
TitleBar.mux.cs commented ~TitleBar Keeps the destructor visible but unported kept No finalizer equivalent. The title reset on GC cannot be reproduced; reset on title change still works through HandleTitleChange.
TitleBar.mux.cs AttachInsetsChangedListener Implements WinUI's own open TODO 50724421 (rebind padding on AppWindowTitleBar.InsetsChanged) kept With it removed, Given_TitleBar.When_Extended_Into_TitleBar_RightHeader_Avoids_Caption_Buttons fails (caption-button insets are only known after the XAML chrome is laid out).
TitleBar.mux.cs UpdateRegionsAfterLayout Refreshes drag and icon regions after the padding columns re-layout kept With it removed, When_FlowDirection_Changes_Passthrough_Regions_Follow and When_Insets_Change_Passthrough_Regions_Follow fail.

There are no #if blocks in the area and no disabled tests.

Tests

Run on Skia Desktop (Win32):

  • Given_TitleBar: 6 passed, 1 skipped (macOS-only).
  • TitleBarInteractionTests: 8 passed.

Workaround experiments: two extra runs with the workarounds removed, with the failures listed above.

Builds: Uno.UI and Uno.UI.RuntimeTests.Generic built in Release without UnoFastDevBuild, with analyzers on. CI's build then failed on IDE0051 for s_layoutRootPartName, which upstream TitleBar.h declares but never uses; it is kept for port fidelity with a scoped suppression (rebuilt clean after rebasing onto master). Detection reports titlebar up to date. The tooling tests build/winui-sync/tests/run.ps1 pass (134/0).

No project or MSBuild files changed.

PR Checklist ✅

🤖 Generated with Claude Code

https://claude.ai/code/session_01TXMNtzDYsFtkCZh1wz4Lkf

@mergify

mergify Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

This pull request is merged.

@github-actions github-actions Bot added the area/build Categorizes an issue or PR as relevant to build infrastructure label Nov 19, 2026
@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @MartinZikmund's task in 20s —— View job


Review summary

Verdict: ship. I found no blocking issues, so I posted no inline comments.

Severity Count
Blocking 0
Non-blocking 0
Nits 2 (below)

I read the diff and the new test file. I did not build or run anything, so the test results in the PR description are unverified by me.

What I checked

  • areas.json: the titlebar entry matches the repo's existing area schema. It has sources, tests, strings and two mirror entries, and the mirrors use the same names as upstream.
  • Headers: the MUX Reference markers are reduced to the file name only. The baseline now carries the version, and the XAML mirrors match the pattern of the other mirrored areas.
  • TitleBar.mux.h.cs: the Uno-only revokers are now under an Uno specific marker, away from the upstream fields. That makes later syncs diff cleanly. The m_insetsChangedRevoker and m_paddingLayoutUpdatedRevoker declarations are unchanged apart from their position.
  • Tests: the 8 interaction tests are ported without [Ignore], skips or Inconclusive. They follow the DropDownButtonInteractionTests pattern and are wrapped in #if HAS_UNO_WINUI || WINDOWS.
  • Conventions: no event Action, no #if __ANDROID__ or similar platform guards, and no Generated/ edits.

Nits (take or leave)

  • s_layoutRootPartName was added to match the upstream header, but nothing in src/Uno.UI uses it. That is fine for header parity. Be aware that UnoFastDevBuild=false analyzers may flag an unused private const (IDE0051). The PR says the Release build was clean, so this is probably not an issue.
  • Several ported tests, such as the IsDragRegion and AutoRefreshDragRegions ones, only check a property round-trip. This is faithful to upstream. The behavioral coverage for drag and passthrough regions comes from Given_TitleBar, which the PR says passes.

The workaround audit looks sound. The PR describes experiments that remove the AttachInsetsChangedListener and UpdateRegionsAfterLayout workarounds and shows tests failing without them. That is good evidence for keeping them.
· branch dev/mazi/winui-sync-titlebar

🤖 Generated with Claude Code

@MartinZikmund
MartinZikmund force-pushed the dev/mazi/winui-sync-titlebar branch from 9b09532 to e0e37d6 Compare November 22, 2026 21:50
@github-actions

github-actions Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @MartinZikmund's task in 13s —— View job


Review summary

Verdict: ship. No blocking issues, so I posted no inline comments.

Severity Count
Blocking 0
Non-blocking 0
Nits 1

I re-read the areas.json entry and the TitleBar.mux.h.cs diff. I did not build or run anything, so the test results in the PR description are unverified by me.

  • areas.json: the titlebar entry has sources, tests, strings and two mirrors. It follows the same shape as the other areas.
  • TitleBar.mux.h.cs: the Uno-only revokers are now under an Uno specific marker, which keeps later syncs diffing cleanly.
  • Nit: s_layoutRootPartName is added for header parity, but I did not check whether anything uses it. If nothing does, the analyzers could flag an unused private const (IDE0051). The PR says the Release build with analyzers on was clean, so this is probably fine.
  • Screenshot differences: the CI report shows about 223 (Linux) and 257 (Windows) snapshot differences. The changes here are header comments, a test file and tracking metadata, so I would expect these to come from the baseline rather than this PR. Please confirm that when you validate the Screenshots Compare Test Run item in the checklist.

@unodevops

Copy link
Copy Markdown
Contributor

🤖 Your WebAssembly Sample App stage site is ready! Visit it here:

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 248282 found UI Test snapshots differences: skia-linux-screenshots: 213, skia-windows-screenshots: 276

Details
  • skia-linux-screenshots: 213 changed over 2500

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • AnimatedBackVisualSourceSamplePage.png
    • AutomationProperties_AutomationId.png-dark
    • AutomationProperties_AutomationId.png
    • Accessibility_Showcase.png-dark
    • AnimatedBackVisualSourceSamplePage.png-dark
    • BasicAcrylicBrushTest.png-dark
    • BasicAcrylicBrushTest.png
    • Border_CornerRadius_Binding.png-dark
    • Border_CornerRadius_Binding.png
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • CalendarView_Theming.png-dark
    • ComboBox_MaxDropdownHeight.png-dark
    • ComboBox_MaxDropdownHeight.png
    • AppWindowTitleBar Properties.png
    • AutomationProperties_StructureAndProps.png-dark
    • AutomationProperties_StructureAndProps.png
    • Basics.png-dark
    • Basics.png
    • ClipboardTests.png-dark
  • skia-windows-screenshots: 276 changed over 2500

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • BenchmarkDotNet.png-dark
    • BenchmarkDotNet.png
    • ClipboardTests.png-dark
    • ClipboardTests.png
    • Accessibility_Showcase.png-dark
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • Basics.png-dark
    • Basics.png
    • BreadcrumbBarPage.png-dark
    • BreadcrumbBarPage.png
    • CalendarView_Theming.png-dark
    • BasicAcrylicBrushTest2.png-dark
    • BasicAcrylicBrushTest2.png
    • Border_CornerRadius_BorderThickness.png-dark
    • Border_CornerRadius_BorderThickness.png
    • Buttons.png-dark
    • ElementLevelTheme.png-dark
    • ElementLevelTheme.png
    • ElevatedViewTests.png-dark

@unoplatform unoplatform deleted a comment from nventive-devops Nov 23, 2026
@unoplatform unoplatform deleted a comment from unodevops Nov 23, 2026
@MartinZikmund
MartinZikmund force-pushed the dev/mazi/winui-sync-titlebar branch from e0e37d6 to 66304d9 Compare November 23, 2026 07:46
@github-actions

github-actions Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @MartinZikmund's task in 10s —— View job


Review summary

Verdict: ship. No blocking issues, so I posted no inline comments.

Severity Count
Blocking 0
Non-blocking 0
Nits 1

I read the diff for areas.json and TitleBar.mux.h.cs. I did not build or run anything, so the test results in the PR description are unverified by me.

  • areas.json: the titlebar entry has sources, tests, strings and two mirrors, in the same shape as the other areas.
  • TitleBar.mux.h.cs: the Uno-only revokers now sit under an Uno specific marker. s_layoutRootPartName is wrapped in a scoped #pragma warning disable IDE0051 with a one-line reason. That narrow suppression addresses the earlier unused-const concern, so the pragma is justified.
  • Nit: s_layoutRootPartName has no users in src/Uno.UI. Keeping it is fine for header parity with upstream.
  • Screenshot differences: the CI report lists 213 (Linux) and 276 (Windows) snapshot differences. This PR only changes header comments, a runtime test file and sync metadata, and no rendering code. They most likely come from the baseline, not from this PR. Please confirm that when you tick the Screenshots Compare Test Run item.
    · branch dev/mazi/winui-sync-titlebar

@unodevops

Copy link
Copy Markdown
Contributor

🤖 Your WebAssembly Sample App stage site is ready! Visit it here:

MartinZikmund and others added 4 commits November 23, 2026 09:30
The port already carried the 2.7.0 behaviour (custom drag regions,
AutoRefreshDragRegions, IsDragRegion, title reset); 2.7.0 only adds
WinAppSDK servicing containment around it, which does not apply to Uno.
The line-by-line review found two header gaps: the missing
s_layoutRootPartName constant, and Uno-only revoker fields that were
mixed in with the upstream ones without a marker.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01TXMNtzDYsFtkCZh1wz4Lkf
Port the eight upstream TitleBar interaction tests (AutoRefreshDragRegions,
RecomputeDragRegions, IsDragRegion) as runtime tests. Upstream drives a
TestUI page through UI Automation; here the page's TitleBar is built in
code and the APIs are called directly.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01TXMNtzDYsFtkCZh1wz4Lkf
Record TitleBar at winui3/release/2.7.0 (1b5b1a0ccc0). The port matches
upstream there: the review compared every member of TitleBar.cpp/.h/.idl,
the automation peer and the template settings, and the theme XAML is
byte-for-byte upstream, so it is mapped as mirrors. Header versions are
dropped now that the manifest records the baseline.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01TXMNtzDYsFtkCZh1wz4Lkf
Upstream TitleBar.h declares s_layoutRootPartName without using it; keep
it for port fidelity and silence the analyzer that fails the CI build.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01TXMNtzaC5dx4oo2ZVG5BHB
@MartinZikmund
MartinZikmund force-pushed the dev/mazi/winui-sync-titlebar branch from 66304d9 to 92daa82 Compare November 23, 2026 08:34
@github-actions

github-actions Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @MartinZikmund's task in 13s —— View job


Review summary

Verdict: ship. I found no blocking issues, so I posted no inline comments.

Severity Count
Blocking 0
Non-blocking 0
Nits 1

I read the areas.json-style entry (build/winui-sync/areas/titlebar.json) and the TitleBar.mux.h.cs diff. I did not build or run anything, so the test results in the PR description are unverified by me.

  • titlebar.json: it has sources, tests, strings and two mirrors, in the same shape as the other areas. The baseline is a full SHA.
  • TitleBar.mux.h.cs: the Uno-only revokers sit under an Uno specific marker. s_layoutRootPartName has a narrowly scoped #pragma warning disable IDE0051 with a one-line reason. That is not a broad suppression.
  • Nit: s_layoutRootPartName has no users. Keeping it is fine for header parity with upstream.
  • Screenshot differences: the latest CI run lists 213 (Linux) and 276 (Windows) snapshot differences. This PR changes no rendering code. Only header comments, a runtime test file and sync metadata changed, so the differences most likely come from the baseline. Please confirm that when you tick the Screenshots Compare Test Run item.
    · branch dev/mazi/winui-sync-titlebar

@unodevops

Copy link
Copy Markdown
Contributor

🤖 Your WebAssembly Sample App stage site is ready! Visit it here:

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 248336 found UI Test snapshots differences: skia-linux-screenshots: 218, skia-windows-screenshots: 300

Details
  • skia-linux-screenshots: 218 changed over 2502

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Accessibility_Showcase.png
    • BenchmarkDotNet.png-dark
    • BenchmarkDotNet.png
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • Accessibility_Showcase.png-dark
    • AnimatedVisualsTestbedPage.png-dark
    • ClipboardTests.png-dark
    • ClipboardTests.png
    • ComboBox_MaxDropdownHeight.png-dark
    • ComboBox_MaxDropdownHeight.png
    • AppWindowTitleBar Properties.png
    • AutomationProperties_StructureAndProps.png-dark
    • AutomationProperties_StructureAndProps.png
    • BasicAcrylicBrushTest2.png-dark
    • BasicAcrylicBrushTest2.png
    • Border_CornerRadius_Binding.png-dark
    • Border_CornerRadius_Binding.png
  • skia-windows-screenshots: 300 changed over 2502

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • AnimatedVisualsTestbedPage.png-dark
    • AutomationProperties_AutomationId.png-dark
    • AutomationProperties_AutomationId.png
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • AnimatedBackVisualSourceSamplePage.png-dark
    • AnimatedVisualsTestbedPage.png
    • AutomationProperties_StructureAndProps.png-dark
    • BasicAcrylicBrushTest2.png-dark
    • BasicAcrylicBrushTest2.png
    • Border_CornerRadius_BorderThickness.png-dark
    • Border_CornerRadius_BorderThickness.png
    • Accessibility_Showcase.png-dark
    • AutomationProperties_StructureAndProps.png
    • BasicAcrylicBrushTest.png-dark
    • BasicAcrylicBrushTest.png
    • BreadcrumbBarPage.png-dark
    • BreadcrumbBarPage.png

@MartinZikmund
MartinZikmund merged commit f136222 into master Nov 23, 2026
52 checks passed
@MartinZikmund
MartinZikmund deleted the dev/mazi/winui-sync-titlebar branch November 23, 2026 09:47
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants