[Windows] Fix CollectionView ScrollTo related test cases failed in CI#34907
Conversation
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 34907Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 34907" |
|
Hey there @@HarishwaranVijayakumar! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
There was a problem hiding this comment.
Pull request overview
Improves Windows CI reliability for CollectionView ScrollTo-related UI tests that became flaky after ScrollIntoView started running asynchronously on Windows (via DispatcherQueue.TryEnqueue).
Changes:
- Re-enabled previously skipped Windows UI tests for CollectionView scrolling/ScrollTo scenarios.
- Added a delay before resetting scroll event labels on the scrolling feature-matrix page to avoid deferred scroll callbacks overwriting the reset state.
- Disabled animated
ScrollToon Windows for Issue33614’s HostApp page to reduce timing-related flakiness.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue33614.cs | Removes Windows-only compilation guard so the Issue33614 UI test runs on Windows again. |
| src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/CollectionView_ScrollingFeatureTests.cs | Removes/relaxes Windows skip conditions so ScrollTo-related feature-matrix tests run on Windows. |
| src/Controls/tests/TestCases.HostApp/Issues/Issue33614.cs | Makes Issue33614’s ScrollTo non-animated on Windows to reduce flaky timing in the HostApp scenario. |
| src/Controls/tests/TestCases.HostApp/FeatureMatrix/CollectionView/ScrollingFeature/CollectionViewScrollPage.xaml.cs | Adds an awaitable delay before resetting scroll event labels to avoid deferred Windows callbacks overwriting expected label state. |
|
/azp run maui-pr-uitests |
|
Azure Pipelines successfully started running 1 pipeline(s). |
🤖 AI Summary
📊 Review Session —
|
| # | Source | Approach | Test Result | Files Changed | Notes |
|---|---|---|---|---|---|
| PR | PR #34907 | Test-only: add Task.Delay(300) on Windows before label reset + disable animation on Windows for Issue33614 + remove TEST_FAILS_ON_WINDOWS guards |
⏳ PENDING (Gate failed: test-only PR, no fix files) | CollectionViewScrollPage.xaml.cs, Issue33614.cs, CollectionView_ScrollingFeatureTests.cs, Issue33614.cs (tests) |
Original PR |
🔬 Code Review — Deep Analysis
Code Review — PR #34907
Independent Assessment
What this changes: Four files, all in the test layer:
- A
#if WINDOWSTask.Delay(300)inNavigateToOptionsPage_ClickedbeforeResetScrollEventLabels()in HostApp - A
#if WINDOWSswitch fromanimate: true→animate: falseinIssue33614's scroll button handler - Removal of
TEST_FAILS_ON_WINDOWSguards from theIssue33614UI test class - Narrowing
#if TEST_FAILS_ON_ANDROID && TEST_FAILS_ON_WINDOWS→#if TEST_FAILS_ON_ANDROIDonVerifyKeepScrollOffsetWithObservableList - Removal of
#if TEST_FAILS_ON_WINDOWSblock guardingVerifyScrollToByIndexWithMakeVisiblePositionAndVerticalList_Carrotand following ScrollTo tests
Inferred motivation: Windows CollectionView ScrollTo tests were racing against async scroll triggered by items loading. PR #24867 wrapped ListViewBase.ScrollIntoView in DispatcherQueue.TryEnqueue(), making the initial auto-scroll deferred — labels get reset before the deferred callback fires, then overwritten.
Reconciliation with PR Narrative
Agreement: Root cause analysis precisely matches the code. The Task.Delay(300) lets the dispatcher queue flush before label reset. The animate: false avoids intermediate Scrolled events from animation that would set a non-final FirstVisibleItemIndex when the test reads it. Both are technically sound workarounds.
Findings
⚠️ Warning — Task.Delay(300) may be larger than necessary and risks future flakiness
File: CollectionViewScrollPage.xaml.cs:25
#if WINDOWS
await Task.Delay(300);
#endifOn WinUI, await checkpoints yield control back to the DispatcherQueue, meaning the enqueued callback will process when the await completes — not after 300ms of wall-clock time. This means await Task.Delay(0) (or await Task.Yield()) would achieve the same flush semantics.
The 300ms:
- Adds 300ms to every test that navigates through this page on Windows
- Doesn't provide stronger guarantees than
Task.Delay(0)for the stated use case - Could theoretically fail on a severely degraded CI machine
Recommendation: await Task.Delay(0) or await Task.Yield() for semantically clearer, faster, equally correct behavior.
💡 Suggestion — [Issue] attribute PlatformAffected doesn't reflect Windows coverage
File: src/Controls/tests/TestCases.HostApp/Issues/Issue33614.cs:5
[Issue(IssueTracker.Github, 33614, "...", PlatformAffected.iOS | PlatformAffected.macOS)]This HostApp page now includes Windows-specific code. The PlatformAffected annotation should be updated to include Windows.
💡 Suggestion — Trailing space in comment
File: src/Controls/tests/TestCases.HostApp/Issues/Issue33614.cs:75
// Disable animation on Windows to avoid flaky test results Minor trailing whitespace.
Blast Radius
Scope: Test files only. No production code path affected. No handler, renderer, or platform layer changed.
Impacted test categories: CollectionView, ScrollView (indirectly)
Failure modes:
Task.Delay(300)not long enough →scrolledEventLabel.Text= "Fired" when test expects "Not Fired" → test fails obviously (no silent pass risk)- Animation disabled on Windows for Issue33614 → reduces coverage of animated-scroll path on Windows (known accepted trade-off)
Verdict: LGTM
Confidence: high
Summary: Pure test-layer fix. Removes Windows skip guards and adds targeted workarounds for known Windows async dispatch behavior. Task.Delay(300) could be Task.Delay(0) for equivalent correctness and faster tests, and PlatformAffected should include Windows, but neither is a blocking issue. No production code changed.
🔧 Fix — Analysis & Comparison
Fix Candidates
| # | Source | Approach | Test Result | Files Changed | Notes |
|---|---|---|---|---|---|
| 1 | try-fix (claude-opus-4.6) | Replace Task.Delay(300) with Task.Yield() for dispatcher-flush semantics |
CollectionViewScrollPage.xaml.cs, Issue33614.cs, test files |
Test-only PR, no fix files for baseline script | |
| 2 | try-fix (claude-sonnet-4.6) | DispatcherQueue.TryEnqueue(Low priority) + TaskCompletionSource for deterministic flush |
CollectionViewScrollPage.xaml.cs, Issue33614.cs |
Test-only PR, deterministic but cannot be tested | |
| 3 | try-fix (gpt-5.3-codex) | Deterministic label polling in UI test assertions; remove animate:false |
All 4 test files | Test-only PR, Windows UI tests cannot run on Android agent | |
| 4 | try-fix (gpt-5.4) | Production code fix in ItemsViewHandler.Windows.cs — suppress auto-scroll when ListViewBase.IsLoaded is false |
ItemsViewHandler.Windows.cs |
Only attempt targeting production code; cannot run Windows UI tests on Android | |
| PR | PR #34907 | Test-only: Task.Delay(300) on Windows before label reset + animate:false on Windows + remove TEST_FAILS_ON_WINDOWS guards |
❌ Gate FAILED (test-only, no fix files detected) | 4 test files | Original PR |
Cross-Pollination
| Model | Round | New Ideas? | Details |
|---|---|---|---|
| claude-opus-4.6 | 2 | No | All approaches identified correctly. Attempt 4 (production code fix in ItemsViewHandler.Windows.cs) is the right direction but needs Windows agent. |
Exhausted: Yes
Selected Fix: PR's fix — No test-executable alternative found (all blocked due to test-only PR + Android-only agent). PR's test-only approach is the pragmatic choice and code review rated LGTM.
Notes
- All try-fix attempts were BLOCKED because: (1) this is a test-only PR with no non-test source files changed, so
EstablishBrokenBaseline.ps1cannot establish a broken baseline; (2) the target platform is Android but the issue and tests are Windows-specific - Attempt 4 proposed a potentially stronger production code fix in
ItemsViewHandler.Windows.csthat would eliminate the root cause entirely, but cannot be empirically tested on this agent
📋 Report — Final Recommendation
⚠️ Final Recommendation: REQUEST CHANGES
Phase Status
| Phase | Status | Notes |
|---|---|---|
| Pre-Flight | ✅ COMPLETE | Test-only PR, issue #34772, Windows CollectionView ScrollTo flakiness |
| Code Review | LGTM (high) | 0 errors, 1 warning, 2 suggestions |
| Gate | ❌ FAILED | Android — "No fix files detected" (expected: test-only PR) |
| Try-Fix | ✅ COMPLETE | 4 attempts, 0 passing (all BLOCKED: test-only + Android agent) |
| Report | ✅ COMPLETE |
Code Review Impact on Try-Fix
The code review Task.Delay(300) being replaceable with Task.Yield() or Task.Delay(0) was reflected in Attempts 1 and 2, which explored Task.Yield() and a DispatcherQueue.TryEnqueue(Low) + TaskCompletionSource flush respectively. Attempt 4 (gpt-5.4) went further and proposed a production-code fix in ItemsViewHandler.Windows.cs to eliminate the root cause entirely. The code review finding guided all models toward more deterministic synchronization approaches.
Summary
PR #34907 is a test-only fix for Windows CollectionView ScrollTo flakiness caused by PR #24867's async DispatcherQueue.TryEnqueue wrapper. The fix is pragmatically sound: a Task.Delay(300) to allow deferred callbacks to complete before resetting labels, animate:false on Windows to avoid intermediate scroll events, and removal of TEST_FAILS_ON_WINDOWS guards. Code review rated LGTM with one warning.
Recommendation is REQUEST CHANGES for the following reasons:
- Gate failed — tests did not behave as expected (per prompt). While the gate failure is due to a test-only PR detection issue (not actual test failures), the gate outcome is ❌ FAILED.
- Stronger alternative identified — Try-Fix Attempt 4 proposed a production-code fix in
ItemsViewHandler.Windows.csthat would suppress the auto-scroll on pre-load item population (!ListViewBase.IsLoaded). This would fix the root cause instead of working around it in tests, and would benefit all users — not just test reliability. Task.Delay(300)is fragile — The 300ms arbitrary delay could be replaced withTask.Delay(0)or aDispatcherQueue.TryEnqueue(Low)flush for equivalent correctness. As noted by Copilot's inline review comment (which the author dismissed), the timing-based approach may still be flaky on heavily loaded CI machines.
Root Cause
PR #24867 changed ScrollIntoView in OnItemsVectorChanged from synchronous to asynchronous via DispatcherQueue.TryEnqueue() on Windows. This introduced a race: when a test navigates to the scroll page, items load → OnItemsVectorChanged fires → ScrollIntoView is queued async → test code resets labels → queued scroll fires → labels overwritten with "Fired" instead of "Not Fired".
Fix Quality
The PR's test-layer fix is reasonable and pragmatic for immediate CI stabilization. However:
Task.Delay(300)is an arbitrary timing heuristic — it works in practice but could silently become flaky if CI machines are slower, or waste 300ms whenTask.Delay(0)would be sufficient- Disabling animation on Windows for Issue33614 reduces test coverage of the animated scroll path (this concern was raised by Copilot inline review but dismissed by the author)
- Attempt 4's
!ListViewBase.IsLoadedcheck inItemsViewHandler.Windows.csoffers a cleaner production-code fix that would make the test-layer workarounds unnecessary
Suggested improvements:
- Replace
await Task.Delay(300)withawait Task.Delay(0)(dispatcher flush) or a deterministicDispatcherQueue-based flush helper - Consider the production code fix: in
ItemsViewHandler.Windows.csOnItemsVectorChanged, capture!ListViewBase.IsLoadedbeforeTryEnqueueand skipScrollIntoViewiftrue - Update
PlatformAffectedinIssue33614's[Issue]attribute to includePlatformAffected.Windows
…#34907) <!-- Please let the below note in for people that find this PR --> > [!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](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! <!-- !!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING MAIN. !!!!!!! --> ### Root Cause - PR [24867](#24867) fixed a COM exception on Windows by wrapping [ListViewBase.ScrollIntoView](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) inside [DispatcherQueue.TryEnqueue()](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) in [ItemsViewHandler.Windows.cs](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) → [OnItemsVectorChanged](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html). This changed [ScrollIntoView](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) from synchronous to asynchronous execution, introducing a race condition in ScrollTo-related UI tests on Windows. - Before [24867](#24867) - Items load → [OnItemsVectorChanged](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) → [ScrollIntoView](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) fires (sync) → Scrolled event updates label → Test resets label → Label = "Not Fired" - After [24867](#24867) (async via TryEnqueue): - Items load → [OnItemsVectorChanged](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) → [ScrollIntoView](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) is queued (async) → Test resets label to "Not Fired" → Queued [ScrollIntoView](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) fires → Scrolled event overwrites label = "Fired" - The deferred [ScrollIntoView](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) callback executes after the test has already reset the scroll event labels, causing stale scroll events to overwrite the expected state. Similarly, for [ScrollTo(animate: true)](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) tests, the animated scroll produces intermediate [Scrolled](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) events that haven't settled to the final index when the test reads the label value. ### Description of Change <!-- Enter description of the fix in this section --> **Test reliability improvements:** * Added a delay in `CollectionViewScrollPage.xaml.cs` before resetting scroll event labels to ensure deferred callbacks complete, preventing test flakiness on Windows. * Disabled animation for `ScrollTo` actions on Windows in `Issue33614.cs` to avoid flaky test results. **Test coverage and platform-specific adjustments:** * Removed Windows-specific test skip conditions in `Issue33614.cs` and `CollectionView_ScrollingFeatureTests.cs`, re-enabling these tests on Windows as the related issues have been resolved. [[1]](diffhunk://#diff-d98964fb2b3496a40f82c4700a38b02be920ba2dc4c500cd6f020d1f74b847d1L1) [[2]](diffhunk://#diff-d98964fb2b3496a40f82c4700a38b02be920ba2dc4c500cd6f020d1f74b847d1L24) [[3]](diffhunk://#diff-d0158d1415828d2b2a784462d5b03cadbc262b1cd822351d96b35b146976da66L1580) [[4]](diffhunk://#diff-d0158d1415828d2b2a784462d5b03cadbc262b1cd822351d96b35b146976da66L1793) * Updated conditional compilation for a grouped list test to only skip on Android, as the Windows issue has been addressed. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Fixes #34772 | Before | After | |----------|----------| | <img src="https://github.com/user-attachments/assets/7db67c75-c970-43b0-bcb8-3232af341fa4"> | <img src="https://github.com/user-attachments/assets/998d74ee-5d4b-48b2-8632-47dc89d2e3e7"> | <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. -->
…#34907) <!-- Please let the below note in for people that find this PR --> > [!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](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! <!-- !!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING MAIN. !!!!!!! --> ### Root Cause - PR [24867](#24867) fixed a COM exception on Windows by wrapping [ListViewBase.ScrollIntoView](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) inside [DispatcherQueue.TryEnqueue()](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) in [ItemsViewHandler.Windows.cs](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) → [OnItemsVectorChanged](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html). This changed [ScrollIntoView](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) from synchronous to asynchronous execution, introducing a race condition in ScrollTo-related UI tests on Windows. - Before [24867](#24867) - Items load → [OnItemsVectorChanged](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) → [ScrollIntoView](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) fires (sync) → Scrolled event updates label → Test resets label → Label = "Not Fired" - After [24867](#24867) (async via TryEnqueue): - Items load → [OnItemsVectorChanged](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) → [ScrollIntoView](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) is queued (async) → Test resets label to "Not Fired" → Queued [ScrollIntoView](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) fires → Scrolled event overwrites label = "Fired" - The deferred [ScrollIntoView](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) callback executes after the test has already reset the scroll event labels, causing stale scroll events to overwrite the expected state. Similarly, for [ScrollTo(animate: true)](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) tests, the animated scroll produces intermediate [Scrolled](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) events that haven't settled to the final index when the test reads the label value. ### Description of Change <!-- Enter description of the fix in this section --> **Test reliability improvements:** * Added a delay in `CollectionViewScrollPage.xaml.cs` before resetting scroll event labels to ensure deferred callbacks complete, preventing test flakiness on Windows. * Disabled animation for `ScrollTo` actions on Windows in `Issue33614.cs` to avoid flaky test results. **Test coverage and platform-specific adjustments:** * Removed Windows-specific test skip conditions in `Issue33614.cs` and `CollectionView_ScrollingFeatureTests.cs`, re-enabling these tests on Windows as the related issues have been resolved. [[1]](diffhunk://#diff-d98964fb2b3496a40f82c4700a38b02be920ba2dc4c500cd6f020d1f74b847d1L1) [[2]](diffhunk://#diff-d98964fb2b3496a40f82c4700a38b02be920ba2dc4c500cd6f020d1f74b847d1L24) [[3]](diffhunk://#diff-d0158d1415828d2b2a784462d5b03cadbc262b1cd822351d96b35b146976da66L1580) [[4]](diffhunk://#diff-d0158d1415828d2b2a784462d5b03cadbc262b1cd822351d96b35b146976da66L1793) * Updated conditional compilation for a grouped list test to only skip on Android, as the Windows issue has been addressed. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Fixes #34772 | Before | After | |----------|----------| | <img src="https://github.com/user-attachments/assets/7db67c75-c970-43b0-bcb8-3232af341fa4"> | <img src="https://github.com/user-attachments/assets/998d74ee-5d4b-48b2-8632-47dc89d2e3e7"> | <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. -->
…ability (#35133) <!-- Please let the below note in for people that find this PR --> > [!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](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! > **Depends on #35136** (pipeline category detection — should merge first) ## What this does Two things: ### 1. UI test category detection in PR review During the PR review workflow, Step 0.5 detects which UI test categories the PR impacts and writes the result to the AI summary comment. This gives reviewers visibility into which UI tests are relevant. **Detection** reuses the 3-tier script from #35136 (test attributes → source paths → AI reasoning). **AI summary** shows a new 🧪 UI Tests section with detected categories before the gate section. ### 2. Gate reliability fixes Multiple fixes to make the gate (`verify-tests-fail.ps1`) more deterministic: | Fix | Problem it solves | |-----|-------------------| | **Absolute path resolution** | Gate scripts not found on Linux CI agents (`Resolve-Path`, `GetFullPath`) | | **File existence check** | Instant cryptic failure when verify script is missing — now logs clear error | | **3x retry on ENV ERROR** | Emulator timeouts, ADB failures, app crashes — transient issues that pass on retry | | **Strip bad report blocks** | Old verify script produces `Passed: False` with empty counts — stripped instead of shown | | **Gate log in fallback** | When report is missing, shows last 20 lines of gate output instead of just `❌ FAILED / Platform: IOS` | ## Files | File | Changes | |------|---------| | `.github/scripts/Review-PR.ps1` | Step 0.5 category detection + all 5 gate fixes | | `.github/scripts/post-ai-summary-comment.ps1` | Add `uitests` phase to render detected categories | | `.github/pr-review/pr-preflight.md` | Step 7: AI identifies impacted UI test categories | ## Validation — PR reviewer builds (Apr 26) 10 builds against real PRs — all succeeded ✅. Category detection shown in AI summary comment. | PR | Categories Detected | Build | AI Summary | |----|-------------------|-------|------------| | #35037 (WebView theme) | `ViewBaseTests,WebView` | [13940071](https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=13940071) | [comment](#35037 (comment)) | | #35031 (Shell memory leak) | `Shell` | [13940072](https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=13940072) | [comment](#35031 (comment)) | | #35020 (XAML Hot Reload) | _(none — XAML only)_ | [13940073](https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=13940073) | ✅ Shows "No UI test categories" | | #35008 (Shell SearchHandler) | `Shell` | [13940074](https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=13940074) | ✅ | | #34997 (RadioButton gradient) | `RadioButton,ViewBaseTests` | [13940075](https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=13940075) | ✅ | | #34980 (DatePicker rotation) | `ViewBaseTests` | [13940076](https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=13940076) | ✅ | | #34974 (Picker CharacterSpacing) | `ViewBaseTests` | [13940077](https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=13940077) | ✅ | | #34923 (SwipeView threshold) | `SwipeView,ViewBaseTests` | [13940078](https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=13940078) | ✅ | | #34907 (CollectionView ScrollTo) | `CollectionView` | [13940079](https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=13940079) | ✅ | | #34845 (RefreshView binding) | `RefreshView,ViewBaseTests` | [13940080](https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=13940080) | ✅ | --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…#34907) <!-- Please let the below note in for people that find this PR --> > [!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](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! <!-- !!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING MAIN. !!!!!!! --> ### Root Cause - PR [24867](#24867) fixed a COM exception on Windows by wrapping [ListViewBase.ScrollIntoView](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) inside [DispatcherQueue.TryEnqueue()](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) in [ItemsViewHandler.Windows.cs](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) → [OnItemsVectorChanged](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html). This changed [ScrollIntoView](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) from synchronous to asynchronous execution, introducing a race condition in ScrollTo-related UI tests on Windows. - Before [24867](#24867) - Items load → [OnItemsVectorChanged](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) → [ScrollIntoView](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) fires (sync) → Scrolled event updates label → Test resets label → Label = "Not Fired" - After [24867](#24867) (async via TryEnqueue): - Items load → [OnItemsVectorChanged](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) → [ScrollIntoView](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) is queued (async) → Test resets label to "Not Fired" → Queued [ScrollIntoView](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) fires → Scrolled event overwrites label = "Fired" - The deferred [ScrollIntoView](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) callback executes after the test has already reset the scroll event labels, causing stale scroll events to overwrite the expected state. Similarly, for [ScrollTo(animate: true)](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) tests, the animated scroll produces intermediate [Scrolled](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) events that haven't settled to the final index when the test reads the label value. ### Description of Change <!-- Enter description of the fix in this section --> **Test reliability improvements:** * Added a delay in `CollectionViewScrollPage.xaml.cs` before resetting scroll event labels to ensure deferred callbacks complete, preventing test flakiness on Windows. * Disabled animation for `ScrollTo` actions on Windows in `Issue33614.cs` to avoid flaky test results. **Test coverage and platform-specific adjustments:** * Removed Windows-specific test skip conditions in `Issue33614.cs` and `CollectionView_ScrollingFeatureTests.cs`, re-enabling these tests on Windows as the related issues have been resolved. [[1]](diffhunk://#diff-d98964fb2b3496a40f82c4700a38b02be920ba2dc4c500cd6f020d1f74b847d1L1) [[2]](diffhunk://#diff-d98964fb2b3496a40f82c4700a38b02be920ba2dc4c500cd6f020d1f74b847d1L24) [[3]](diffhunk://#diff-d0158d1415828d2b2a784462d5b03cadbc262b1cd822351d96b35b146976da66L1580) [[4]](diffhunk://#diff-d0158d1415828d2b2a784462d5b03cadbc262b1cd822351d96b35b146976da66L1793) * Updated conditional compilation for a grouped list test to only skip on Android, as the Windows issue has been addressed. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Fixes #34772 | Before | After | |----------|----------| | <img src="https://github.com/user-attachments/assets/7db67c75-c970-43b0-bcb8-3232af341fa4"> | <img src="https://github.com/user-attachments/assets/998d74ee-5d4b-48b2-8632-47dc89d2e3e7"> | <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. -->
…#34907) <!-- Please let the below note in for people that find this PR --> > [!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](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! <!-- !!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING MAIN. !!!!!!! --> ### Root Cause - PR [24867](#24867) fixed a COM exception on Windows by wrapping [ListViewBase.ScrollIntoView](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) inside [DispatcherQueue.TryEnqueue()](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) in [ItemsViewHandler.Windows.cs](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) → [OnItemsVectorChanged](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html). This changed [ScrollIntoView](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) from synchronous to asynchronous execution, introducing a race condition in ScrollTo-related UI tests on Windows. - Before [24867](#24867) - Items load → [OnItemsVectorChanged](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) → [ScrollIntoView](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) fires (sync) → Scrolled event updates label → Test resets label → Label = "Not Fired" - After [24867](#24867) (async via TryEnqueue): - Items load → [OnItemsVectorChanged](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) → [ScrollIntoView](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) is queued (async) → Test resets label to "Not Fired" → Queued [ScrollIntoView](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) fires → Scrolled event overwrites label = "Fired" - The deferred [ScrollIntoView](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) callback executes after the test has already reset the scroll event labels, causing stale scroll events to overwrite the expected state. Similarly, for [ScrollTo(animate: true)](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) tests, the animated scroll produces intermediate [Scrolled](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) events that haven't settled to the final index when the test reads the label value. ### Description of Change <!-- Enter description of the fix in this section --> **Test reliability improvements:** * Added a delay in `CollectionViewScrollPage.xaml.cs` before resetting scroll event labels to ensure deferred callbacks complete, preventing test flakiness on Windows. * Disabled animation for `ScrollTo` actions on Windows in `Issue33614.cs` to avoid flaky test results. **Test coverage and platform-specific adjustments:** * Removed Windows-specific test skip conditions in `Issue33614.cs` and `CollectionView_ScrollingFeatureTests.cs`, re-enabling these tests on Windows as the related issues have been resolved. [[1]](diffhunk://#diff-d98964fb2b3496a40f82c4700a38b02be920ba2dc4c500cd6f020d1f74b847d1L1) [[2]](diffhunk://#diff-d98964fb2b3496a40f82c4700a38b02be920ba2dc4c500cd6f020d1f74b847d1L24) [[3]](diffhunk://#diff-d0158d1415828d2b2a784462d5b03cadbc262b1cd822351d96b35b146976da66L1580) [[4]](diffhunk://#diff-d0158d1415828d2b2a784462d5b03cadbc262b1cd822351d96b35b146976da66L1793) * Updated conditional compilation for a grouped list test to only skip on Android, as the Windows issue has been addressed. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Fixes #34772 | Before | After | |----------|----------| | <img src="https://github.com/user-attachments/assets/7db67c75-c970-43b0-bcb8-3232af341fa4"> | <img src="https://github.com/user-attachments/assets/998d74ee-5d4b-48b2-8632-47dc89d2e3e7"> | <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. -->
…ability (dotnet#35133) <!-- Please let the below note in for people that find this PR --> > [!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](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! > **Depends on dotnet#35136** (pipeline category detection — should merge first) ## What this does Two things: ### 1. UI test category detection in PR review During the PR review workflow, Step 0.5 detects which UI test categories the PR impacts and writes the result to the AI summary comment. This gives reviewers visibility into which UI tests are relevant. **Detection** reuses the 3-tier script from dotnet#35136 (test attributes → source paths → AI reasoning). **AI summary** shows a new 🧪 UI Tests section with detected categories before the gate section. ### 2. Gate reliability fixes Multiple fixes to make the gate (`verify-tests-fail.ps1`) more deterministic: | Fix | Problem it solves | |-----|-------------------| | **Absolute path resolution** | Gate scripts not found on Linux CI agents (`Resolve-Path`, `GetFullPath`) | | **File existence check** | Instant cryptic failure when verify script is missing — now logs clear error | | **3x retry on ENV ERROR** | Emulator timeouts, ADB failures, app crashes — transient issues that pass on retry | | **Strip bad report blocks** | Old verify script produces `Passed: False` with empty counts — stripped instead of shown | | **Gate log in fallback** | When report is missing, shows last 20 lines of gate output instead of just `❌ FAILED / Platform: IOS` | ## Files | File | Changes | |------|---------| | `.github/scripts/Review-PR.ps1` | Step 0.5 category detection + all 5 gate fixes | | `.github/scripts/post-ai-summary-comment.ps1` | Add `uitests` phase to render detected categories | | `.github/pr-review/pr-preflight.md` | Step 7: AI identifies impacted UI test categories | ## Validation — PR reviewer builds (Apr 26) 10 builds against real PRs — all succeeded ✅. Category detection shown in AI summary comment. | PR | Categories Detected | Build | AI Summary | |----|-------------------|-------|------------| | dotnet#35037 (WebView theme) | `ViewBaseTests,WebView` | [13940071](https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=13940071) | [comment](dotnet#35037 (comment)) | | dotnet#35031 (Shell memory leak) | `Shell` | [13940072](https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=13940072) | [comment](dotnet#35031 (comment)) | | dotnet#35020 (XAML Hot Reload) | _(none — XAML only)_ | [13940073](https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=13940073) | ✅ Shows "No UI test categories" | | dotnet#35008 (Shell SearchHandler) | `Shell` | [13940074](https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=13940074) | ✅ | | dotnet#34997 (RadioButton gradient) | `RadioButton,ViewBaseTests` | [13940075](https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=13940075) | ✅ | | dotnet#34980 (DatePicker rotation) | `ViewBaseTests` | [13940076](https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=13940076) | ✅ | | dotnet#34974 (Picker CharacterSpacing) | `ViewBaseTests` | [13940077](https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=13940077) | ✅ | | dotnet#34923 (SwipeView threshold) | `SwipeView,ViewBaseTests` | [13940078](https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=13940078) | ✅ | | dotnet#34907 (CollectionView ScrollTo) | `CollectionView` | [13940079](https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=13940079) | ✅ | | dotnet#34845 (RefreshView binding) | `RefreshView,ViewBaseTests` | [13940080](https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=13940080) | ✅ | --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…dotnet#34907) <!-- Please let the below note in for people that find this PR --> > [!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](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! <!-- !!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING MAIN. !!!!!!! --> ### Root Cause - PR [24867](dotnet#24867) fixed a COM exception on Windows by wrapping [ListViewBase.ScrollIntoView](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) inside [DispatcherQueue.TryEnqueue()](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) in [ItemsViewHandler.Windows.cs](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) → [OnItemsVectorChanged](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html). This changed [ScrollIntoView](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) from synchronous to asynchronous execution, introducing a race condition in ScrollTo-related UI tests on Windows. - Before [24867](dotnet#24867) - Items load → [OnItemsVectorChanged](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) → [ScrollIntoView](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) fires (sync) → Scrolled event updates label → Test resets label → Label = "Not Fired" - After [24867](dotnet#24867) (async via TryEnqueue): - Items load → [OnItemsVectorChanged](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) → [ScrollIntoView](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) is queued (async) → Test resets label to "Not Fired" → Queued [ScrollIntoView](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) fires → Scrolled event overwrites label = "Fired" - The deferred [ScrollIntoView](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) callback executes after the test has already reset the scroll event labels, causing stale scroll events to overwrite the expected state. Similarly, for [ScrollTo(animate: true)](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) tests, the animated scroll produces intermediate [Scrolled](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) events that haven't settled to the final index when the test reads the label value. ### Description of Change <!-- Enter description of the fix in this section --> **Test reliability improvements:** * Added a delay in `CollectionViewScrollPage.xaml.cs` before resetting scroll event labels to ensure deferred callbacks complete, preventing test flakiness on Windows. * Disabled animation for `ScrollTo` actions on Windows in `Issue33614.cs` to avoid flaky test results. **Test coverage and platform-specific adjustments:** * Removed Windows-specific test skip conditions in `Issue33614.cs` and `CollectionView_ScrollingFeatureTests.cs`, re-enabling these tests on Windows as the related issues have been resolved. [[1]](diffhunk://#diff-d98964fb2b3496a40f82c4700a38b02be920ba2dc4c500cd6f020d1f74b847d1L1) [[2]](diffhunk://#diff-d98964fb2b3496a40f82c4700a38b02be920ba2dc4c500cd6f020d1f74b847d1L24) [[3]](diffhunk://#diff-d0158d1415828d2b2a784462d5b03cadbc262b1cd822351d96b35b146976da66L1580) [[4]](diffhunk://#diff-d0158d1415828d2b2a784462d5b03cadbc262b1cd822351d96b35b146976da66L1793) * Updated conditional compilation for a grouped list test to only skip on Android, as the Windows issue has been addressed. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Fixes dotnet#34772 | Before | After | |----------|----------| | <img src="https://github.com/user-attachments/assets/7db67c75-c970-43b0-bcb8-3232af341fa4"> | <img src="https://github.com/user-attachments/assets/998d74ee-5d4b-48b2-8632-47dc89d2e3e7"> | <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. -->
## What's Coming .NET MAUI inflight/candidate introduces significant improvements across all platforms with focus on quality, performance, and developer experience. This release includes 85 commits with various improvements, bug fixes, and enhancements. ## Button - [Android, iOS] Button: Fix VisualState properties not restored when leaving custom state by @BagavathiPerumal in #33346 <details> <summary>🔧 Fixes</summary> - [Button VisualStates do not work](#19690) </details> ## CollectionView - Fix CollectionView grid spacing updates for first row and column by @KarthikRajaKalaimani in #34527 <details> <summary>🔧 Fixes</summary> - [[MAUI] I2_Vertical grid for horizontal Item Spacing and Vertical Item Spacing - horizontally updating the spacing only applies to the second column](#34257) </details> - CarouselView: Fix cascading PositionChanged/CurrentItemChanged events on collection update by @praveenkumarkarunanithi in #31275 <details> <summary>🔧 Fixes</summary> - [[Windows] CurrentItemChangedEventArgs and PositionChangedEventArgs Not Working Properly in CarouselView](#29529) </details> - [Windows] Fixed ItemSpacing doesn't work in Carousel View by @SubhikshaSf4851 in #30014 <details> <summary>🔧 Fixes</summary> - [ItemSpacing on CarouselView is not applied on Windows.](#29772) </details> - Fix CollectionView not scrolling to top on iOS status bar tap by @jfversluis in #34687 <details> <summary>🔧 Fixes</summary> - [[iOS] UICollectionView ScrollToTop does not work](#19866) </details> - [iOS] Fixed CollectionView Scroll Jitter for TextType HTML Labels by @SubhikshaSf4851 in #34383 <details> <summary>🔧 Fixes</summary> - [CollectionView scrolling is jittery when ItemTemplate contains Label with TextType="Html" in .NET 10](#33065) </details> - Fix CollectionView Header is not visible when ItemsSource is not set and an EmptyView is set in iOS, Mac platform by @KarthikRajaKalaimani in #34989 <details> <summary>🔧 Fixes</summary> - [CollectionView Header is not visible when ItemsSource is not set and EmptyView is set in iOS, Mac platform](#34897) </details> - [Android] Fix CollectionView EmptyView not displayed correctly by @KarthikRajaKalaimani in #34956 <details> <summary>🔧 Fixes</summary> - [[Android] CollectionView - EmptyView not displayed correctly](#34861) </details> - [iOS] Fix CollectionView ScrollOffset not resetting when ItemsSource changes by @SyedAbdulAzeemSF4852 in #34488 <details> <summary>🔧 Fixes</summary> - [[IOS] CollectionView ScrollOffset does not reset when the ItemSource is changed in iOS.](#26366) - [Re-enable Issue7993 test on iOS/Catalyst - CollectionView scroll position not reset when updating ItemsSource](#33500) </details> - [Revert] [iOS] Fixed CollectionView Scroll Jitter for TextType HTML Labels by @SubhikshaSf4851 in #35341 ## Core Lifecycle - [Android] Fix NRE in ContainerView when Android Context is null during lifecycle transition by @rmarinho in #34901 <details> <summary>🔧 Fixes</summary> - [[Android] NullReferenceException in NavigationRootManager.Connect when mapping Window content](#34900) </details> ## DateTimePicker - [Android] Fix for TimePicker Dialog doesn't update the layout when rotating the device with dialog open by @HarishwaranVijayakumar in #31910 <details> <summary>🔧 Fixes</summary> - [[Android] TimePicker Dialog doesn't update the layout when rotating the device with dialog open](#31658) </details> - [Android, iOS] Fixed TimePicker FlowDirection Not Applied Across Platforms by @Dhivya-SF4094 in #30369 <details> <summary>🔧 Fixes</summary> - [TimePicker FlowDirection Not Working on All Platforms](#30192) </details> - [Windows] Fixed TimePicker CharacterSpacing issue by @SubhikshaSf4851 in #30533 <details> <summary>🔧 Fixes</summary> - [[Windows] TimePicker CharacterSpacing Property Not Working on Windows](#30199) </details> - [MacCatalyst] Fix DatePicker Opened/Closed events not being raised by @SubhikshaSf4851 in #34970 <details> <summary>🔧 Fixes</summary> - [[MacCatalyst] DatePicker Opened and Closed events are not raised on Mac platform](#34848) </details> ## Dialogalert - [Android] Fix AlertDialog, ActionSheet, and Prompt render with Material 2 styles when Material 3 is enabled by @HarishwaranVijayakumar in #35121 <details> <summary>🔧 Fixes</summary> - [[Android] AlertDialog, ActionSheet, and Prompt render with Material 2 styles when Material 3 is enabled](#35119) </details> ## Docs - docs: Add UITesting-Guide, ReleasePlanning, and ReleaseProcess to docs/README.md index by @PureWeen in #35195 - docs: Fix hardcoded path and add library overview in Essentials.AI README by @PureWeen in #35194 - docs: Update branch reference from net10.0 to net11.0 in DEVELOPMENT.md by @PureWeen in #35193 ## Drawing - Fix Path Rendering Issue Inside StackLayout When Margin Is Set by @Shalini-Ashokan in #28071 <details> <summary>🔧 Fixes</summary> - [Path does not render if it has Margin](#13801) </details> - Fixed FlowDirection property not working on Drawable control and GraphicsView by @Dhivya-SF4094 in #34557 <details> <summary>🔧 Fixes</summary> - [[Android, Windows, iOS, macOS] FlowDirection property not working on BoxView Control](#34402) </details> - [iOS & Mac] Fix image tile misalignment in GraphicsView ImagePaint by @SubhikshaSf4851 in #34935 <details> <summary>🔧 Fixes</summary> - [[iOS] Image resized with ResizeMode.Fit is not rendered correctly in GraphicsView](#34755) </details> - Fix Shadow does not honour Styles by @KarthikRajaKalaimani in #35081 <details> <summary>🔧 Fixes</summary> - [Shadow does not honour Styles](#19560) </details> ## Entry - [iOS/macCatalyst] Fix Entry and Editor BackgroundColor reset when set to null by @Shalini-Ashokan in #34741 <details> <summary>🔧 Fixes</summary> - [[iOS, Maccatalyst] Entry & Editor BackgroundColor not reset to Null](#34611) </details> - [Windows] Fix password Entry crash when setting text on empty field by @praveenkumarkarunanithi in #33891 <details> <summary>🔧 Fixes</summary> - [[WinUI] Password Obfuscation causes unhandled crash](#33334) </details> ## Essentials - [Essentials] Use mean sea level altitude on Android API 34+ by @KitKeen in #35097 <details> <summary>🔧 Fixes</summary> - [Add support for MslAltitudeMeters in Essentials Geolocation on Android](#27554) </details> ## Flyout - Fixed Flyout Not Displayed on Android When FlyoutWidth Is Set Only for Desktop via OnIdiom by @NanthiniMahalingam in #29028 <details> <summary>🔧 Fixes</summary> - [[Android] FlyoutWidth with OnIdiom shows no flyout](#13243) </details> - Revert "[Windows] Fix Flyout/Locked mode header collapse regression causing UI test failures on candidate branch" by @kubaflo in #35339 - Revert "Revert "[Windows] Fix Flyout/Locked mode header collapse regression causing UI test failures on candidate branch"" by @kubaflo in #35342 ## Flyoutpage - Fix [Android] Title of FlyOutPage is not updating anymore after showing a NonFlyOutPage by @KarthikRajaKalaimani in #34839 <details> <summary>🔧 Fixes</summary> - [[Android] Title of FlyOutPage is not updating anymore after showing a NonFlyOutPage](#33615) </details> ## Label - [iOS] Fix span Tap gesture on wrapped Label lines in iOS 26+ by @SubhikshaSf4851 in #34640 <details> <summary>🔧 Fixes</summary> - [[iOS]Span TapGestureRecognizer does not work on the second line of the span, if the span is wrapped to the next line](#34504) </details> ## Layout - Fixed Stacklayout is not rendered when clip is applied and StackLayout placed child to the Border control in iOS/ Mac platform by @KarthikRajaKalaimani in #33330 <details> <summary>🔧 Fixes</summary> - [[Mac/iOS] StackLayout fails to render content while applying Clip, and the layout is placed inside a Border with Background in .NET MAUI](#33241) </details> ## Map - Fix Changing Location on a Pin does nothing by @NirmalKumarYuvaraj in #30201 <details> <summary>🔧 Fixes</summary> - [[Maps] [Regression from Xamarin.Forms.Maps] Changing Location on a Pin does nothing](#12916) </details> ## Mediapicker - [iOS] Fix HEIC images picked via PickPhotosAsync not displayed by @HarishwaranVijayakumar in #34954 <details> <summary>🔧 Fixes</summary> - [[iOS] [Regression] HEIC images picked via PickPhotosAsync not displayed](#34953) </details> - [Android] Fix MediaPicker.PickPhotosAsync UnauthorizedAccessException on API 28 and below by @HarishwaranVijayakumar in #34981 <details> <summary>🔧 Fixes</summary> - [MediaPicker.PickPhotos fails to modify image, tries to load original source, fails to load source on Android 9.0](#34889) </details> ## Pages - [iOS] Fix ContentPage with ToolbarItem Clicked event leaks when presented as modal page by @devanathan-vaithiyanathan in #35009 <details> <summary>🔧 Fixes</summary> - [ContentPage with ToolbarItem Clicked event leaks when presented as modal page](#34892) </details> ## Platform - [Android] Fix OnBackButtonPressed not invoked for Shell by @Dhivya-SF4094 in #35150 <details> <summary>🔧 Fixes</summary> - [On Screen Back Button Does Not Fire OnBackButtonPressed in Android](#9095) </details> ## RadioButton - Fix RadioButtonGroup not working with ContentView by @Dhivya-SF4094 in #34781 <details> <summary>🔧 Fixes</summary> - [RadioButtonGroup not working with ContentView](#34759) </details> - [Windows] Fix for RadioButton BorderColor and BorderWidth not updated at runtime by @SyedAbdulAzeemSF4852 in #28335 <details> <summary>🔧 Fixes</summary> - [RadioButton Border color not working for focused visual state](#15806) </details> - [iOS] Fix RadioButton BackgroundColor bleeding outside CornerRadius by @SyedAbdulAzeemSF4852 in #34844 <details> <summary>🔧 Fixes</summary> - [[iOS] RadioButton BackgroundColor bleeds outside CornerRadius](#34842) </details> ## SafeArea - [iOS] Fix stale bottom safe area after changing SafeAreaEdges with keyboard open by @praveenkumarkarunanithi in #35083 <details> <summary>🔧 Fixes</summary> - [[iOS] ContentPage bottom has white space after changing SafeAreaEdges while keyboard is open](#34846) </details> ## ScrollView - [Windows] Fix Preserve ScrollView offsets when Orientation changes to Neither by @SubhikshaSf4851 in #34827 <details> <summary>🔧 Fixes</summary> - [[Windows] ScrollView offsets do not preserve when Orientation changes to Neither](#34671) </details> ## Searchbar - [iOS] Fix SearchBar unexpected left margin in iPad windowed mode on 26 Version by @SubhikshaSf4851 in #34704 <details> <summary>🔧 Fixes</summary> - [in iPad windowed mode SearchBar adds left margin equivaltent to SafeAreaInsets when placed inside grid](#34551) </details> ## Shell - [Windows] Fix for Shell.FlyoutBehavior="Flyout" forces the title height space above the tab bar even if the page title is empty by @BagavathiPerumal in #30382 <details> <summary>🔧 Fixes</summary> - [(Windows) Shell.FlyoutBehavior="Flyout" forces the title height space above the tab bar even if the page title is empty](#30254) </details> - Fix Shell flyout items scrolling behind FlyoutHeader on iOS by @Qythyx in #34936 <details> <summary>🔧 Fixes</summary> - [Shell flyout items scroll behind FlyoutHeader on iOS](#34925) </details> - [iOS, Mac] Fix Shell.CurrentState.Location stale in OnNavigated after GoToAsync by @Vignesh-SF3580 in #34880 <details> <summary>🔧 Fixes</summary> - [Shell.OnNavigated not called for route navigation](#34662) </details> - [iOS26]Fix BackButtonBehavior_IsEnabled_False_BackButtonDoesNotNavigate UITest fails by @devanathan-vaithiyanathan in #34890 <details> <summary>🔧 Fixes</summary> - [[iOS 26] BackButtonBehavior_IsEnabled_False_BackButtonDoesNotNavigate test fails with TimeoutException](#34771) </details> - [iOS] Fix Shell page memory leak when using TitleView with x:Name by @Shalini-Ashokan in #35082 <details> <summary>🔧 Fixes</summary> - [[iOS] Title view memory leak](#34975) </details> - [Material 3] Fix Material 2 color flash in AppBar when switching tabs for the first time by @Dhivya-SF4094 in #35117 <details> <summary>🔧 Fixes</summary> - [Material 3: AppBar briefly displays Material 2 colors when switching tabs for the first time](#35116) </details> - [Android] Fix Shell/TabbedPage "More" BottomSheet uses hard-coded M2 colors when Material3 is enabled by @HarishwaranVijayakumar in #35129 <details> <summary>🔧 Fixes</summary> - [[Android] Shell/TabbedPage "More" BottomSheet uses hard-coded M2 colors when Material3 is enabled](#35127) </details> - [Android] Shell: Fix top-tab unselected text visibility in Material 3 light theme by @SyedAbdulAzeemSF4852 in #35128 <details> <summary>🔧 Fixes</summary> - [[Android] Shell top-tab unselected text appears too faint in Material 3 light theme](#35125) </details> - Fix Shell.Items.Clear() memory leak by disconnecting child handlers on removal (#34898) by @Shalini-Ashokan in #35031 <details> <summary>🔧 Fixes</summary> - [Shell.Items.Clear() does not disconnect handlers correctly](#34898) </details> - [iOS&Mac] Fix Shell SearchHandler Query update on Initial load by @SubhikshaSf4851 in #35008 <details> <summary>🔧 Fixes</summary> - [[iOS&Mac] Shell SearchHandler Query not shown in search bar on initial load](#35005) </details> ## SwipeView - [iOS,MacCatalyst] Fix for SwipeView.Open() throwing an ArgumentException on the second programmatic call by @BagavathiPerumal in #34982 <details> <summary>🔧 Fixes</summary> - [[net 11.0][iOS,MacCatalyst] SwipeView.Open() throws ArgumentException on second programmatic call](#34917) </details> - [Android/iOS] Fix SwipeItem visibility change causing double command execution in Execute mode by @praveenkumarkarunanithi in #35087 <details> <summary>🔧 Fixes</summary> - [Changing visibility on an SwipeItem causes multiple items to be executed](#7580) </details> ## Switch - [iOS] Fix Switch ThumbColor reset on iOS 26+ theme changes. by @Shalini-Ashokan in #33953 <details> <summary>🔧 Fixes</summary> - [Switch ThumbColor not Initialized Using VisualStateManager on iOS Device](#33783) - [I9-On macOS 26.2, the "Animate scroll" button is white by default on iOS and Maccatalyst platforms.](#33767) </details> ## TabbedPage - [Windows] TabbedPage: Refresh layout when NavigationView size changes by @BagavathiPerumal in #26217 <details> <summary>🔧 Fixes</summary> - [TabbedPage - ScrollView not allowing scrolling when it should](#26103) - [TabbedPage App on resize hides page bottom content](#11402) - [Grid overflows child ContentPage of parent TabbedPage on initial load and when resizing on Windows](#20028) </details> - [Android] Material 3 Fixed BottomNavigationView overflowing in Tabbed page by @NirmalKumarYuvaraj in #35064 <details> <summary>🔧 Fixes</summary> - [[Android] Material3 - TabbedPage bottom tabs overflowing the contents](#35063) </details> - [Windows] Fix for Multiple Tabs Being Selected in WinUI TabbedPage by @SyedAbdulAzeemSF4852 in #33312 <details> <summary>🔧 Fixes</summary> - [WinUI TabbedPage can have multiple tabs selected](#31799) </details> ## Theming - [iOS] Fix StaticResource Hot Reload crash on iOS by @StephaneDelcroix in #35020 <details> <summary>🔧 Fixes</summary> - [The maui app quit and no errors in error list after editing ResourceDictionary XAML file on iOS Simulator with MAUI SR6 10.0.60](#35018) </details> ## Toolbar - [Windows] Fix for CS1061 build error caused by missing HasMenuBarContent property in MauiToolbar by @BagavathiPerumal in #35040 ## Tooling - Fix VisualStateGroups duplicate name crash with implicit styles (#34716) by @StephaneDelcroix in #34719 <details> <summary>🔧 Fixes</summary> - [SourceGen: VisualStateManager.VisualStateGroups causes 'Names must be unique' at startup](#34716) </details> ## WebView - Refactor the HybridWebView and properly support complex parameters by @mattleibow in #32491 - [Android] Fix WebView scrolling inside ScrollView by @Shalini-Ashokan in #33133 <details> <summary>🔧 Fixes</summary> - [[Android] WebView's content does not scroll when placed inside a ScrollView](#32971) </details> <details> <summary>🔧 Infrastructure (1)</summary> - [Windows] Fix Narrator announcing ContentView children twice when Description is set by @praveenkumarkarunanithi in #33979 <details> <summary>🔧 Fixes</summary> - [[Windows] SemanticProperties.Description announced twice when set on focusable container cell (Label inside)](#33373) </details> </details> <details> <summary>🧪 Testing (14)</summary> - [Testing] SafeArea Feature Matrix Test Cases for ContentPage by @TamilarasanSF4853 in #34877 - [Windows] Fix CollectionView ScrollTo related test cases failed in CI by @HarishwaranVijayakumar in #34907 <details> <summary>🔧 Fixes</summary> - [[Testing][Windows]CollectionView ScrollTo related test cases failed in CI](#34772) </details> - [Testing] Fixed Build error on inflight/ candidate PR 35234 by @HarishKumarSF4517 in #35241 - Fix CI for ValidateKeyboardRuntime_SwitchContainerToSoftInput_WhileKeyboardOpen test failure in May 4th Candidate by @devanathan-vaithiyanathan in #35307 - [Windows] Fix Flyout/Locked mode header collapse regression causing UI test failures on candidate branch by @BagavathiPerumal in #35312 - [iOS/macCatalyst] [Candidate Fix] Editor shadow and theme regression caused by BackgroundColor reset on initial handler connection by @Shalini-Ashokan in #35343 - [Testing] Fixed UI test image failure in PR 35234 - [30/03/2026] Candidate - 1 by @HarishKumarSF4517 in #35325 - [iOS] Fix ShellFeatureMatrix test failures on candidate branch by @Vignesh-SF3580 in #35346 - [Windows] Fix Issue29529VerifyPreviousPositionOnInsert test failure on candidate branch by @praveenkumarkarunanithi in #35398 - [Android] [Candidate Fix] Shell: Fix handler disconnect timing to preserve WebView navigation and memory leak fix by @Shalini-Ashokan in #35417 - [Testing]Revert 'Fix Preserve ScrollView offsets when Orientation changes to Neither' by @TamilarasanSF4853 in #35412 - [Windows] Fix VerifyAllIndicatorDotsShowShadowsWhenIndicatorSize test failure on candidate branch by @praveenkumarkarunanithi in #35458 - [Testing] Fixed test failure in PR 35234 - [05/08/2026] Candidate by @TamilarasanSF4853 in #35362 - [Testing] Fixed test failure in PR 35234 - [05/04/2026] Candidate - 3 by @TamilarasanSF4853 in #35639 </details> <details> <summary>📦 Other (6)</summary> - [UIKit] Avoid useless measure invalidation propagation cycles by @albyrock87 in #33459 - BindableObject property access micro-optimizations by @albyrock87 in #33584 - Extract filename from DisplayName and add extension if missing by @mattleibow in #35050 - [core] Add keyed-DI screenshot extensibility for 3rd-party platform backends by @Redth in #35096 <details> <summary>🔧 Fixes</summary> - [`ViewExtensions.CaptureAsync(IView)` and `IPlatformScreenshot` need extensibility for third-party platform backends](#34266) </details> - Fix MainThread throwing on custom platform backends by @Redth in #35070 <details> <summary>🔧 Fixes</summary> - [`MainThread.BeginInvokeOnMainThread` throws on custom platform backends - Common UI-thread marshaling pattern crashes; `Dispatcher` works but isn't the documented/recommended path](#34101) </details> - Tests: Add 11 missing UnitConverters unit tests by @PureWeen in #35191 </details> <details> <summary>📝 Issue References</summary> Fixes #7580, Fixes #9095, Fixes #11402, Fixes #12916, Fixes #13243, Fixes #13801, Fixes #15806, Fixes #19560, Fixes #19690, Fixes #19866, Fixes #20028, Fixes #26103, Fixes #26366, Fixes #27554, Fixes #29529, Fixes #29772, Fixes #30192, Fixes #30199, Fixes #30254, Fixes #31658, Fixes #31799, Fixes #32971, Fixes #33065, Fixes #33241, Fixes #33334, Fixes #33373, Fixes #33500, Fixes #33615, Fixes #33767, Fixes #33783, Fixes #34101, Fixes #34257, Fixes #34266, Fixes #34402, Fixes #34504, Fixes #34551, Fixes #34611, Fixes #34662, Fixes #34671, Fixes #34716, Fixes #34755, Fixes #34759, Fixes #34771, Fixes #34772, Fixes #34842, Fixes #34846, Fixes #34848, Fixes #34861, Fixes #34889, Fixes #34892, Fixes #34897, Fixes #34898, Fixes #34900, Fixes #34917, Fixes #34925, Fixes #34953, Fixes #34975, Fixes #35005, Fixes #35018, Fixes #35063, Fixes #35116, Fixes #35119, Fixes #35125, Fixes #35127 </details> **Full Changelog**: main...inflight/candidate
…ability (dotnet#35133) <!-- Please let the below note in for people that find this PR --> > [!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](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! > **Depends on dotnet#35136** (pipeline category detection — should merge first) ## What this does Two things: ### 1. UI test category detection in PR review During the PR review workflow, Step 0.5 detects which UI test categories the PR impacts and writes the result to the AI summary comment. This gives reviewers visibility into which UI tests are relevant. **Detection** reuses the 3-tier script from dotnet#35136 (test attributes → source paths → AI reasoning). **AI summary** shows a new 🧪 UI Tests section with detected categories before the gate section. ### 2. Gate reliability fixes Multiple fixes to make the gate (`verify-tests-fail.ps1`) more deterministic: | Fix | Problem it solves | |-----|-------------------| | **Absolute path resolution** | Gate scripts not found on Linux CI agents (`Resolve-Path`, `GetFullPath`) | | **File existence check** | Instant cryptic failure when verify script is missing — now logs clear error | | **3x retry on ENV ERROR** | Emulator timeouts, ADB failures, app crashes — transient issues that pass on retry | | **Strip bad report blocks** | Old verify script produces `Passed: False` with empty counts — stripped instead of shown | | **Gate log in fallback** | When report is missing, shows last 20 lines of gate output instead of just `❌ FAILED / Platform: IOS` | ## Files | File | Changes | |------|---------| | `.github/scripts/Review-PR.ps1` | Step 0.5 category detection + all 5 gate fixes | | `.github/scripts/post-ai-summary-comment.ps1` | Add `uitests` phase to render detected categories | | `.github/pr-review/pr-preflight.md` | Step 7: AI identifies impacted UI test categories | ## Validation — PR reviewer builds (Apr 26) 10 builds against real PRs — all succeeded ✅. Category detection shown in AI summary comment. | PR | Categories Detected | Build | AI Summary | |----|-------------------|-------|------------| | dotnet#35037 (WebView theme) | `ViewBaseTests,WebView` | [13940071](https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=13940071) | [comment](dotnet#35037 (comment)) | | dotnet#35031 (Shell memory leak) | `Shell` | [13940072](https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=13940072) | [comment](dotnet#35031 (comment)) | | dotnet#35020 (XAML Hot Reload) | _(none — XAML only)_ | [13940073](https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=13940073) | ✅ Shows "No UI test categories" | | dotnet#35008 (Shell SearchHandler) | `Shell` | [13940074](https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=13940074) | ✅ | | dotnet#34997 (RadioButton gradient) | `RadioButton,ViewBaseTests` | [13940075](https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=13940075) | ✅ | | dotnet#34980 (DatePicker rotation) | `ViewBaseTests` | [13940076](https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=13940076) | ✅ | | dotnet#34974 (Picker CharacterSpacing) | `ViewBaseTests` | [13940077](https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=13940077) | ✅ | | dotnet#34923 (SwipeView threshold) | `SwipeView,ViewBaseTests` | [13940078](https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=13940078) | ✅ | | dotnet#34907 (CollectionView ScrollTo) | `CollectionView` | [13940079](https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=13940079) | ✅ | | dotnet#34845 (RefreshView binding) | `RefreshView,ViewBaseTests` | [13940080](https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=13940080) | ✅ | --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…dotnet#34907) <!-- Please let the below note in for people that find this PR --> > [!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](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! <!-- !!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING MAIN. !!!!!!! --> ### Root Cause - PR [24867](dotnet#24867) fixed a COM exception on Windows by wrapping [ListViewBase.ScrollIntoView](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) inside [DispatcherQueue.TryEnqueue()](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) in [ItemsViewHandler.Windows.cs](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) → [OnItemsVectorChanged](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html). This changed [ScrollIntoView](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) from synchronous to asynchronous execution, introducing a race condition in ScrollTo-related UI tests on Windows. - Before [24867](dotnet#24867) - Items load → [OnItemsVectorChanged](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) → [ScrollIntoView](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) fires (sync) → Scrolled event updates label → Test resets label → Label = "Not Fired" - After [24867](dotnet#24867) (async via TryEnqueue): - Items load → [OnItemsVectorChanged](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) → [ScrollIntoView](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) is queued (async) → Test resets label to "Not Fired" → Queued [ScrollIntoView](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) fires → Scrolled event overwrites label = "Fired" - The deferred [ScrollIntoView](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) callback executes after the test has already reset the scroll event labels, causing stale scroll events to overwrite the expected state. Similarly, for [ScrollTo(animate: true)](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) tests, the animated scroll produces intermediate [Scrolled](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) events that haven't settled to the final index when the test reads the label value. ### Description of Change <!-- Enter description of the fix in this section --> **Test reliability improvements:** * Added a delay in `CollectionViewScrollPage.xaml.cs` before resetting scroll event labels to ensure deferred callbacks complete, preventing test flakiness on Windows. * Disabled animation for `ScrollTo` actions on Windows in `Issue33614.cs` to avoid flaky test results. **Test coverage and platform-specific adjustments:** * Removed Windows-specific test skip conditions in `Issue33614.cs` and `CollectionView_ScrollingFeatureTests.cs`, re-enabling these tests on Windows as the related issues have been resolved. [[1]](diffhunk://#diff-d98964fb2b3496a40f82c4700a38b02be920ba2dc4c500cd6f020d1f74b847d1L1) [[2]](diffhunk://#diff-d98964fb2b3496a40f82c4700a38b02be920ba2dc4c500cd6f020d1f74b847d1L24) [[3]](diffhunk://#diff-d0158d1415828d2b2a784462d5b03cadbc262b1cd822351d96b35b146976da66L1580) [[4]](diffhunk://#diff-d0158d1415828d2b2a784462d5b03cadbc262b1cd822351d96b35b146976da66L1793) * Updated conditional compilation for a grouped list test to only skip on Android, as the Windows issue has been addressed. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Fixes dotnet#34772 | Before | After | |----------|----------| | <img src="https://github.com/user-attachments/assets/7db67c75-c970-43b0-bcb8-3232af341fa4"> | <img src="https://github.com/user-attachments/assets/998d74ee-5d4b-48b2-8632-47dc89d2e3e7"> | <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. -->
…dotnet#34907) <!-- Please let the below note in for people that find this PR --> > [!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](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! <!-- !!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING MAIN. !!!!!!! --> ### Root Cause - PR [24867](dotnet#24867) fixed a COM exception on Windows by wrapping [ListViewBase.ScrollIntoView](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) inside [DispatcherQueue.TryEnqueue()](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) in [ItemsViewHandler.Windows.cs](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) → [OnItemsVectorChanged](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html). This changed [ScrollIntoView](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) from synchronous to asynchronous execution, introducing a race condition in ScrollTo-related UI tests on Windows. - Before [24867](dotnet#24867) - Items load → [OnItemsVectorChanged](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) → [ScrollIntoView](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) fires (sync) → Scrolled event updates label → Test resets label → Label = "Not Fired" - After [24867](dotnet#24867) (async via TryEnqueue): - Items load → [OnItemsVectorChanged](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) → [ScrollIntoView](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) is queued (async) → Test resets label to "Not Fired" → Queued [ScrollIntoView](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) fires → Scrolled event overwrites label = "Fired" - The deferred [ScrollIntoView](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) callback executes after the test has already reset the scroll event labels, causing stale scroll events to overwrite the expected state. Similarly, for [ScrollTo(animate: true)](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) tests, the animated scroll produces intermediate [Scrolled](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) events that haven't settled to the final index when the test reads the label value. ### Description of Change <!-- Enter description of the fix in this section --> **Test reliability improvements:** * Added a delay in `CollectionViewScrollPage.xaml.cs` before resetting scroll event labels to ensure deferred callbacks complete, preventing test flakiness on Windows. * Disabled animation for `ScrollTo` actions on Windows in `Issue33614.cs` to avoid flaky test results. **Test coverage and platform-specific adjustments:** * Removed Windows-specific test skip conditions in `Issue33614.cs` and `CollectionView_ScrollingFeatureTests.cs`, re-enabling these tests on Windows as the related issues have been resolved. [[1]](diffhunk://#diff-d98964fb2b3496a40f82c4700a38b02be920ba2dc4c500cd6f020d1f74b847d1L1) [[2]](diffhunk://#diff-d98964fb2b3496a40f82c4700a38b02be920ba2dc4c500cd6f020d1f74b847d1L24) [[3]](diffhunk://#diff-d0158d1415828d2b2a784462d5b03cadbc262b1cd822351d96b35b146976da66L1580) [[4]](diffhunk://#diff-d0158d1415828d2b2a784462d5b03cadbc262b1cd822351d96b35b146976da66L1793) * Updated conditional compilation for a grouped list test to only skip on Android, as the Windows issue has been addressed. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Fixes dotnet#34772 | Before | After | |----------|----------| | <img src="https://github.com/user-attachments/assets/7db67c75-c970-43b0-bcb8-3232af341fa4"> | <img src="https://github.com/user-attachments/assets/998d74ee-5d4b-48b2-8632-47dc89d2e3e7"> | <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. -->
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!
Root Cause
PR 24867 fixed a COM exception on Windows by wrapping ListViewBase.ScrollIntoView inside DispatcherQueue.TryEnqueue() in ItemsViewHandler.Windows.cs → OnItemsVectorChanged. This changed ScrollIntoView from synchronous to asynchronous execution, introducing a race condition in ScrollTo-related UI tests on Windows.
Before 24867
After 24867 (async via TryEnqueue):
The deferred ScrollIntoView callback executes after the test has already reset the scroll event labels, causing stale scroll events to overwrite the expected state. Similarly, for ScrollTo(animate: true) tests, the animated scroll produces intermediate Scrolled events that haven't settled to the final index when the test reads the label value.
Description of Change
Test reliability improvements:
CollectionViewScrollPage.xaml.csbefore resetting scroll event labels to ensure deferred callbacks complete, preventing test flakiness on Windows.ScrollToactions on Windows inIssue33614.csto avoid flaky test results.Test coverage and platform-specific adjustments:
Issue33614.csandCollectionView_ScrollingFeatureTests.cs, re-enabling these tests on Windows as the related issues have been resolved. [1] [2] [3] [4]Issues Fixed
Fixes #34772