[Windows] Fix Indicator View Causing Looping Issue with CarouselView#27880
[Windows] Fix Indicator View Causing Looping Issue with CarouselView#27880Tamilarasan-Paranthaman wants to merge 8 commits intodotnet:mainfrom
Conversation
|
/rebase |
d4dd6c0 to
6d63ed5
Compare
|
/rebase |
6d63ed5 to
44d1664
Compare
|
/rebase |
44d1664 to
fc83861
Compare
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
|
||
| [Test] | ||
| [Category(UITestCategories.CarouselView)] | ||
| public void VerifyCarouselViewScrolling() |
There was a problem hiding this comment.
The test is failing on Mac and Windows:

at UITest.Appium.HelperExtensions.Wait(Func`1 query, Func`2 satisfactory, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2367
at UITest.Appium.HelperExtensions.WaitForAtLeastOne(Func`1 query, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2384
at UITest.Appium.HelperExtensions.WaitForElement(IApp app, String marked, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency, Nullable`1 postTimeout) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 665
at Microsoft.Maui.TestCases.Tests.Issues.Issue27563.VerifyCarouselViewScrolling() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue27563.cs:line 21
at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
There was a problem hiding this comment.
The test failed with a timeout exception on both Windows and Mac.
On Mac, this appears to be due to the lack of support for SwipeRightToLeft. We can modify the test case specifically for the Mac platform.
On Windows, the test ran for an extended period before failing with a timeout exception.
I conducted further testing on a local machine and found that the test passed when CarouselView.Loop was set to false. This suggests that the issue occurs only when CarouselView.Loop is set to true. Additionally, I identified other test cases where Loop is enabled, and they also include the TEST_FAILS_ON_WINDOWS condition referencing this issue (e.g., Script: 12574 - Sample - 12574).
However, in the CI environment, the failure when Loop is enabled appears to be due to a different issue.
@jsuarezruiz, could you please share your insights on this and suggest how we should proceed on Windows platforms?
There was a problem hiding this comment.
@jsuarezruiz @Tamilarasan-Paranthaman is there a way forward with this PR?
|
@jsuarezruiz friendly ping |
|
/rebase |
0feecdd to
7b3fa97
Compare
|
Rebased and running a new build. |
|
|
||
| [Test] | ||
| [Category(UITestCategories.CarouselView)] | ||
| public void VerifyCarouselViewScrolling() |
There was a problem hiding this comment.
Can extend the new test to cover loop initial centering and the reentrancy case (tap indicator repeatedly while swiping), and a test that toggles Position to the same value to ensure no scroll storm occurs.
|
Hi, is this still valid? |
7b3fa97 to
c55024a
Compare
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 27880Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 27880" |
@kubaflo I have verified this on my end, and it is still valid PR. The issue still reproduces on the latest main source and is resolved by the changes made in this PR.
|
📋 PR Finalization ReviewTitle: ✅ GoodCurrent: Description:
|
| Before Issue Fix | After Issue Fix |
|---|---|
Before-Fix.mp4 |
After-Fix.mp4 |
Code Review: ⚠️ Issues Found
🔴 Critical Issues
1. Removed Loop centering code in UpdateInitialPosition
- File:
src/Controls/src/Core/Handlers/Items/CarouselViewHandler.Windows.cs - Problem: The original code had a block that set
_loopableCollectionView.CenterMode = true, calledListViewBase.ScrollIntoView(item), then resetCenterMode = falsewhenElement.Loopwas enabled. This entire block was removed. For Loop mode, the carousel needs to be centered in the virtualized list to allow bi-directional scrolling. Without this, Loop mode initial positioning may regress on Windows. - Recommendation: Verify that Loop mode still works correctly on initial load. If the centering was removed intentionally, add a code comment explaining why it is no longer needed.
2. UI test excluded from Windows — the target platform
- File:
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue27563.cs - Problem: The test uses
#if TEST_FAILS_ON_WINDOWS && TEST_FAILS_ON_CATALYSTwhich excludes it from both Windows and MacCatalyst. Since this is a Windows-targeted fix, the test cannot verify the fix on the platform it targets. The comment references issue [Testing] Appium test does not perform the tap action with CarouselView. #29245 (TimeoutException with Loop), but the test page does not even useLoop = true. - Recommendation: Investigate whether the Windows exclusion is still necessary. If the Loop-related issue ([Testing] Appium test does not perform the tap action with CarouselView. #29245) does not affect this test scenario (no Loop in the test page), consider removing the Windows exclusion so CI validates the fix on Windows.
🟡 Suggestions
-
Snapshot label shows stale position — Both Android and iOS reference snapshots show "CarouselView Position - 0" even though the carousel is visually at position 2 ("Percentage View"). The HostApp button handler reads
carousel.Positionsynchronously after settingindicatorView.Position = 2, before the carousel finishes scrolling. Consider using aPropertyChangedhandler on CarouselView.Position to update the label asynchronously for accurate snapshot verification. -
CarouselScrolledreset edge case — The tracker reset (_lastScrolledToPosition = -1) inCarouselScrolledonly fires whenposition != _lastScrolledToPosition. If a user manually scrolls back to the same position the tracker already holds, it will not reset, which could prevent a subsequent programmatic scroll to that index. -
Missing newline at end of file — Both
Issue27563.csfiles (HostApp and Shared.Tests) are missing a trailing newline.
✅ Looks Good
- The
_lastScrolledToPositiontracking mechanism is a clean, effective approach to break the infinite ScrollTo → Scrolled → UpdatePosition loop - Good use of
IsDraggingandIsScrollingguards inUpdatePositionto prevent programmatic scrolls during user interaction - Proper reset of
_lastScrolledToPositioninOnCollectionItemsSourceChangedensures stale state does not persist after data changes - The HostApp test page uses C# only (preferred pattern), has correct
AutomationIdattributes, and appropriate[Issue]attribute - Single
[Category(UITestCategories.CarouselView)]on the test (correct per guidelines) - Fixes 3 long-standing related issues ([Windows] Indicator view causes looping with CarouselView #27563, CarouselView behaves strangely when manipulating position in ViewModel #22468, [Windows] [Scenario Day] Scroll by Object not working the first time #7149) with a single cohesive approach
|
🤖 AI Summary📊 Expand Full Review —
|
| # | Source | Approach | Test Result | Files Changed | Notes |
|---|---|---|---|---|---|
| PR | PR #27880 | _lastScrolledToPosition tracker field to gate re-entrant ScrollTo calls |
❌ Gate FAILED (no Windows test) | CarouselViewHandler.Windows.cs |
Tests excluded on Windows |
🔧 Fix — Analysis & Comparison
Fix Candidates
| # | Source | Approach | Test Result | Files Changed | Notes |
|---|---|---|---|---|---|
| 1 | try-fix (claude-opus-4.6) | _isProgrammaticScroll boolean flag + remove #if !WINDOWS |
FAIL | 2 files | WinAppDriver can't access elements inside CarouselView DataTemplate; 240s timeout |
| 2 | try-fix (claude-sonnet-4.6) | Test rewrite with external labels + layout reorder | FAIL | 3 files | LoopableCollectionView floods UIA StructureChanged events; WinAppDriver hangs indefinitely |
| 3 | try-fix (gpt-5.3-codex) | CarouselScrollSyncState state machine + unit tests |
PASS | 3 files | 10 unit tests; validates scroll guard logic without WinAppDriver dependency |
| 4 | try-fix (gpt-5.4) | Unsubscribe CarouselScrolled during programmatic ScrollTo + unit tests |
PASS | 2 files | 8 unit tests; clean event suppression but brief window of missed events |
| 5 | try-fix (claude-sonnet-4.6) | _settingPositionFromScroll bool in SetCarouselViewPosition + unit tests |
PASS | 2 files | 9 unit tests; targets exact re-entry point; minimal change |
| PR | PR #27880 | _lastScrolledToPosition int tracker |
Gate FAILED | 1 file | Both tests excluded on Windows with #if !WINDOWS; no Windows test validates the fix |
Cross-Pollination
| Model | Round | New Ideas? | Details |
|---|---|---|---|
| claude-opus-4.6 | 2 | Yes | Windows device test (Controls.DeviceTests bypasses WinAppDriver) |
| claude-sonnet-4.6 | 2 | Yes | Equality guard at binding source (IndicatorView setter early exit) |
| gpt-5.3-codex | 2 | Yes | Versioned coalescing sync with origin/version tracking |
| claude-opus-4.6 | 3 | Yes | IsIntermediate filtering on ViewChanged events |
| gpt-5.3-codex | 3 | Yes | Snap-point completion sync |
| gpt-5.4 | 3 | Yes | SetValueFromRenderer instead of direct property assignment |
Exhausted: Yes (3 rounds, 3 passing alternatives found)
Selected Fix: Candidate #5 (_settingPositionFromScroll bool) is the most targeted and minimal. However, the PR fix logic may also be correct primary issue is missing Windows test coverage and Loop regression risk. Recommendation: REQUEST CHANGES.
📋 Report — Final Recommendation
⚠️ Final Recommendation: REQUEST CHANGES
Phase Status
| Phase | Status | Notes |
|---|---|---|
| Pre-Flight | ✅ COMPLETE | Windows-only CarouselView+IndicatorView loop; 5 changed files |
| Gate | ❌ FAILED | Windows — both tests excluded with #if !WINDOWS; no tests ran |
| Try-Fix | ✅ COMPLETE | 5 attempts; 3 passing alternatives found |
| Report | ✅ COMPLETE |
Summary
PR #27880 fixes a real Windows-specific bug (#27563) where CarouselView + IndicatorView creates an infinite scroll loop. The handler fix logic using _lastScrolledToPosition is conceptually sound, but the PR cannot be approved because:
- Gate failed on Windows — both new tests are excluded with
#if !WINDOWS, leaving the Windows-only bug completely unvalidated by automated tests - The
UpdateInitialPositionLoop centering removal is an unreviewed regression risk - Three alternative fix approaches (attempts 3, 4, 5) all passed unit tests and provide better testability
Root Cause
The infinite loop: IndicatorView.Position = N → MapPosition → UpdatePosition → ItemsView.ScrollTo(N) → CarouselScrolled(N) → SetCarouselViewPosition(N) → ItemsView.Position = N → MapPosition → UpdatePosition → loop.
Fix Quality
PR's fix (_lastScrolledToPosition int tracker):
- ✅ Correct concept: prevents re-entrant
ScrollTocalls - ✅ Also handles
OnCollectionItemsSourceChangedreset - ❌ No Windows test coverage — both tests guarded by
#if !WINDOWS - ❌ Loop centering removed from
UpdateInitialPositionwithout test coverage - ❌ Reset logic in
CarouselScrolledresets to-1(notposition) — subtle but correct
Best alternative (Attempt 5 — _settingPositionFromScroll bool):
- ✅ Most targeted: wraps
ItemsView.Position = positioninSetCarouselViewPositionwith a flag - ✅ Guards the exact re-entry point (synchronous MAUI property callbacks)
- ✅ Cannot be corrupted by intermediate position values (unlike int tracker)
- ✅
finallyblock guarantees cleanup - ✅ 9 unit tests validate the behavior
- ✅ Minimal: 2 files, ~15 lines
Windows test infrastructure finding:
Attempts 1 & 2 confirmed that Windows UI tests for CarouselView are structurally blocked: LoopableCollectionView fires continuous UIA StructureChanged events ~326ms after page load, causing WinAppDriver to hang indefinitely. This means the #if !WINDOWS guard, while wrong in principle, reflects a real infrastructure limitation. The correct path is Windows device tests (Controls.DeviceTests) which bypass WinAppDriver entirely.
Required Changes
- Add Windows unit tests or device tests — The fix needs test coverage on Windows. Unit tests (
dotnet test Core.UnitTests) are immediately viable and can validate the scroll guard logic without WinAppDriver. - Review Loop regression — The removed
CenterModeblock inUpdateInitialPositionneeds a test or justification that Loop+initial position still works correctly. - Consider simpler alternative — The
_settingPositionFromScrollapproach (attempt 5 diff intry-fix/attempt-5/fix.diff) is cleaner and more directly targets the re-entry path. - Address unresolved review thread —
jsuarezruizrequested tests covering loop initial centering, reentrancy with indicator tapping, and scroll-storm prevention (thread unresolved).
Selected Fix: PR's fix (with required test additions) — the underlying approach is valid; tests are missing.
#34575) <!-- 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! ## Description Adds Windows platform support to the `maui-copilot` CI pipeline (AzDO definition 27723), enabling Copilot PR reviews on Windows-targeted PRs. ### Changes **`eng/pipelines/ci-copilot.yml`** - Add `catalyst` and `windows` to Platform parameter values - Add per-platform pool selection (`androidPool`, `iosPool`, `macPool`, `windowsPool`) - Skip Xcode, Android SDK, simulator setup for Windows/Catalyst - Add Windows-specific "Set screen resolution" step (1920x1080) - Add MacCatalyst-specific "Disable Notification Center" step - Fix `sed` command for `Directory.Build.Override.props` on Windows (Git Bash uses GNU sed) - Handle Copilot CLI PATH detection on Windows vs Unix - Change `script:` steps to `bash:` for cross-platform consistency **`.github/scripts/Review-PR.ps1`** - Add `catalyst` to ValidateSet for Platform parameter **`.github/scripts/BuildAndRunHostApp.ps1`** - Add Windows test assembly directory for artifact collection **`.github/scripts/post-ai-summary-comment.ps1` / `post-pr-finalize-comment.ps1`** - Various improvements for cross-platform comment posting ### Validation Successfully ran the pipeline with `Platform=windows` on multiple Windows-specific PRs: - PR #27713 — ✅ Succeeded - PR #34337 — ✅ Succeeded - PR #26217, #27609, #27880, #28617, #29927, #30068 — Triggered and running --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The concern in the AI summary is that the fix is specific to Windows, but the test is restricted on Windows. The AI suggested adding a Windows test to validate the fix. |
🚦 Gate - Test Before and After Fix📊 Expand Full Gate —
|
| Test | Without Fix (expect FAIL) | With Fix (expect PASS) |
|---|---|---|
🖥️ Issue27563 Issue27563 |
✅ FAIL — 518s | ❌ FAIL — 425s |
🔴 Without fix — 🖥️ Issue27563: FAIL ✅ · 518s
Determining projects to restore...
Restored D:\a\1\s\src\Controls\src\Core\Controls.Core.csproj (in 39.66 sec).
Restored D:\a\1\s\src\Controls\Maps\src\Controls.Maps.csproj (in 39.71 sec).
Restored D:\a\1\s\src\Controls\Foldable\src\Controls.Foldable.csproj (in 251 ms).
Restored D:\a\1\s\src\BlazorWebView\src\Maui\Microsoft.AspNetCore.Components.WebView.Maui.csproj (in 3.8 sec).
Restored D:\a\1\s\src\Graphics\src\Graphics.Win2D\Graphics.Win2D.csproj (in 25 ms).
Restored D:\a\1\s\src\Essentials\src\Essentials.csproj (in 16 ms).
Restored D:\a\1\s\src\Core\src\Core.csproj (in 67 ms).
Restored D:\a\1\s\src\Core\maps\src\Maps.csproj (in 25 ms).
Restored D:\a\1\s\src\Graphics\src\Graphics\Graphics.csproj (in 3.95 sec).
Restored D:\a\1\s\src\Controls\src\Xaml\Controls.Xaml.csproj (in 27 ms).
Restored D:\a\1\s\src\Controls\tests\TestCases.HostApp\Controls.TestCases.HostApp.csproj (in 650 ms).
3 of 14 projects are up-to-date for restore.
##vso[build.updatebuildnumber]10.0.60-ci+azdo.13684418
Graphics -> D:\a\1\s\artifacts\bin\Graphics\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Graphics.dll
##vso[build.updatebuildnumber]10.0.60-ci+azdo.13684418
##vso[build.updatebuildnumber]10.0.60-ci+azdo.13684418
Graphics.Win2D -> D:\a\1\s\artifacts\bin\Graphics.Win2D\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Graphics.Win2D.WinUI.Desktop.dll
Essentials -> D:\a\1\s\artifacts\bin\Essentials\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Essentials.dll
##vso[build.updatebuildnumber]10.0.60-ci+azdo.13684418
Core -> D:\a\1\s\artifacts\bin\Core\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.dll
##vso[build.updatebuildnumber]10.0.60-ci+azdo.13684418
Maps -> D:\a\1\s\artifacts\bin\Maps\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Maps.dll
Controls.BindingSourceGen -> D:\a\1\s\artifacts\bin\Controls.BindingSourceGen\Debug\netstandard2.0\Microsoft.Maui.Controls.BindingSourceGen.dll
##vso[build.updatebuildnumber]10.0.60-ci+azdo.13684418
Controls.Core -> D:\a\1\s\artifacts\bin\Controls.Core\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Controls.dll
##vso[build.updatebuildnumber]10.0.60-ci+azdo.13684418
##vso[build.updatebuildnumber]10.0.60-ci+azdo.13684418
##vso[build.updatebuildnumber]10.0.60-ci+azdo.13684418
Controls.Foldable -> D:\a\1\s\artifacts\bin\Controls.Foldable\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Controls.Foldable.dll
Microsoft.AspNetCore.Components.WebView.Maui -> D:\a\1\s\artifacts\bin\Microsoft.AspNetCore.Components.WebView.Maui\Debug\net10.0-windows10.0.19041.0\Microsoft.AspNetCore.Components.WebView.Maui.dll
Controls.Xaml -> D:\a\1\s\artifacts\bin\Controls.Xaml\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Controls.Xaml.dll
##vso[build.updatebuildnumber]10.0.60-ci+azdo.13684418
Controls.Maps -> D:\a\1\s\artifacts\bin\Controls.Maps\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Controls.Maps.dll
Controls.TestCases.HostApp -> D:\a\1\s\artifacts\bin\Controls.TestCases.HostApp\Debug\net10.0-windows10.0.19041.0\win-x64\Controls.TestCases.HostApp.dll
Build succeeded.
0 Warning(s)
0 Error(s)
Time Elapsed 00:05:44.99
Determining projects to restore...
Restored D:\a\1\s\src\Controls\tests\CustomAttributes\Controls.CustomAttributes.csproj (in 872 ms).
Restored D:\a\1\s\src\TestUtils\src\VisualTestUtils\VisualTestUtils.csproj (in 4 ms).
Restored D:\a\1\s\src\TestUtils\src\VisualTestUtils.MagickNet\VisualTestUtils.MagickNet.csproj (in 5.65 sec).
Restored D:\a\1\s\src\Controls\tests\TestCases.WinUI.Tests\Controls.TestCases.WinUI.Tests.csproj (in 8.43 sec).
Restored D:\a\1\s\src\TestUtils\src\UITest.Core\UITest.Core.csproj (in 2 ms).
Restored D:\a\1\s\src\TestUtils\src\UITest.Appium\UITest.Appium.csproj (in 2 ms).
Restored D:\a\1\s\src\TestUtils\src\UITest.NUnit\UITest.NUnit.csproj (in 3.02 sec).
Restored D:\a\1\s\src\TestUtils\src\UITest.Analyzers\UITest.Analyzers.csproj (in 5.14 sec).
7 of 15 projects are up-to-date for restore.
##vso[build.updatebuildnumber]10.0.60-ci+azdo.13684418
Graphics -> D:\a\1\s\artifacts\bin\Graphics\Debug\net10.0\Microsoft.Maui.Graphics.dll
##vso[build.updatebuildnumber]10.0.60-ci+azdo.13684418
Essentials -> D:\a\1\s\artifacts\bin\Essentials\Debug\net10.0\Microsoft.Maui.Essentials.dll
Controls.CustomAttributes -> D:\a\1\s\artifacts\bin\Controls.CustomAttributes\Debug\net10.0\Controls.CustomAttributes.dll
##vso[build.updatebuildnumber]10.0.60-ci+azdo.13684418
Core -> D:\a\1\s\artifacts\bin\Core\Debug\net10.0\Microsoft.Maui.dll
Controls.Core.Design -> D:\a\1\s\artifacts\bin\Controls.Core.Design\Debug\net472\Microsoft.Maui.Controls.DesignTools.dll
Controls.BindingSourceGen -> D:\a\1\s\artifacts\bin\Controls.BindingSourceGen\Debug\netstandard2.0\Microsoft.Maui.Controls.BindingSourceGen.dll
##vso[build.updatebuildnumber]10.0.60-ci+azdo.13684418
Controls.Core -> D:\a\1\s\artifacts\bin\Controls.Core\Debug\net10.0\Microsoft.Maui.Controls.dll
UITest.Core -> D:\a\1\s\artifacts\bin\UITest.Core\Debug\net10.0\UITest.Core.dll
UITest.Appium -> D:\a\1\s\artifacts\bin\UITest.Appium\Debug\net10.0\UITest.Appium.dll
UITest.NUnit -> D:\a\1\s\artifacts\bin\UITest.NUnit\Debug\net10.0\UITest.NUnit.dll
VisualTestUtils -> D:\a\1\s\artifacts\bin\VisualTestUtils\Debug\netstandard2.0\VisualTestUtils.dll
VisualTestUtils.MagickNet -> D:\a\1\s\artifacts\bin\VisualTestUtils.MagickNet\Debug\netstandard2.0\VisualTestUtils.MagickNet.dll
UITest.Analyzers -> D:\a\1\s\artifacts\bin\UITest.Analyzers\Debug\netstandard2.0\UITest.Analyzers.dll
Controls.TestCases.WinUI.Tests -> D:\a\1\s\artifacts\bin\Controls.TestCases.WinUI.Tests\Debug\net10.0\Controls.TestCases.WinUI.Tests.dll
Test run for D:\a\1\s\artifacts\bin\Controls.TestCases.WinUI.Tests\Debug\net10.0\Controls.TestCases.WinUI.Tests.dll (.NETCoreApp,Version=v10.0)
VSTest version 18.0.1 (x64)
Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
D:\a\1\s\artifacts\bin\Controls.TestCases.WinUI.Tests\Debug\net10.0\Controls.TestCases.WinUI.Tests.dll
NUnit Adapter 4.5.0.0: Test execution started
Running selected tests in D:\a\1\s\artifacts\bin\Controls.TestCases.WinUI.Tests\Debug\net10.0\Controls.TestCases.WinUI.Tests.dll
NUnit3TestExecutor discovered 0 of 0 NUnit test cases using Current Discovery mode, Explicit run
NUnit Adapter 4.5.0.0: Test execution complete
[xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.8.2+699d445a1a (64-bit .NET 10.0.0)
[xUnit.net 00:00:00.08] Discovering: Controls.TestCases.WinUI.Tests
[xUnit.net 00:00:00.27] Discovered: Controls.TestCases.WinUI.Tests
No test matches the given testcase filter `Issue27563` in D:\a\1\s\artifacts\bin\Controls.TestCases.WinUI.Tests\Debug\net10.0\Controls.TestCases.WinUI.Tests.dll
🟢 With fix — 🖥️ Issue27563: FAIL ❌ · 425s
Determining projects to restore...
All projects are up-to-date for restore.
##vso[build.updatebuildnumber]10.0.60-ci+azdo.13684418
Graphics -> D:\a\1\s\artifacts\bin\Graphics\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Graphics.dll
##vso[build.updatebuildnumber]10.0.60-ci+azdo.13684418
##vso[build.updatebuildnumber]10.0.60-ci+azdo.13684418
Graphics.Win2D -> D:\a\1\s\artifacts\bin\Graphics.Win2D\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Graphics.Win2D.WinUI.Desktop.dll
Essentials -> D:\a\1\s\artifacts\bin\Essentials\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Essentials.dll
##vso[build.updatebuildnumber]10.0.60-ci+azdo.13684418
Core -> D:\a\1\s\artifacts\bin\Core\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.dll
Controls.BindingSourceGen -> D:\a\1\s\artifacts\bin\Controls.BindingSourceGen\Debug\netstandard2.0\Microsoft.Maui.Controls.BindingSourceGen.dll
##vso[build.updatebuildnumber]10.0.60-ci+azdo.13684418
##vso[build.updatebuildnumber]10.0.60-ci+azdo.13684418
Maps -> D:\a\1\s\artifacts\bin\Maps\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Maps.dll
Controls.Core -> D:\a\1\s\artifacts\bin\Controls.Core\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Controls.dll
##vso[build.updatebuildnumber]10.0.60-ci+azdo.13684418
##vso[build.updatebuildnumber]10.0.60-ci+azdo.13684418
##vso[build.updatebuildnumber]10.0.60-ci+azdo.13684418
##vso[build.updatebuildnumber]10.0.60-ci+azdo.13684418
Controls.Maps -> D:\a\1\s\artifacts\bin\Controls.Maps\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Controls.Maps.dll
Microsoft.AspNetCore.Components.WebView.Maui -> D:\a\1\s\artifacts\bin\Microsoft.AspNetCore.Components.WebView.Maui\Debug\net10.0-windows10.0.19041.0\Microsoft.AspNetCore.Components.WebView.Maui.dll
Controls.Xaml -> D:\a\1\s\artifacts\bin\Controls.Xaml\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Controls.Xaml.dll
Controls.Foldable -> D:\a\1\s\artifacts\bin\Controls.Foldable\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Controls.Foldable.dll
Controls.TestCases.HostApp -> D:\a\1\s\artifacts\bin\Controls.TestCases.HostApp\Debug\net10.0-windows10.0.19041.0\win-x64\Controls.TestCases.HostApp.dll
Build succeeded.
0 Warning(s)
0 Error(s)
Time Elapsed 00:05:32.03
Determining projects to restore...
All projects are up-to-date for restore.
##vso[build.updatebuildnumber]10.0.60-ci+azdo.13684418
Graphics -> D:\a\1\s\artifacts\bin\Graphics\Debug\net10.0\Microsoft.Maui.Graphics.dll
##vso[build.updatebuildnumber]10.0.60-ci+azdo.13684418
Essentials -> D:\a\1\s\artifacts\bin\Essentials\Debug\net10.0\Microsoft.Maui.Essentials.dll
##vso[build.updatebuildnumber]10.0.60-ci+azdo.13684418
Core -> D:\a\1\s\artifacts\bin\Core\Debug\net10.0\Microsoft.Maui.dll
Controls.CustomAttributes -> D:\a\1\s\artifacts\bin\Controls.CustomAttributes\Debug\net10.0\Controls.CustomAttributes.dll
Controls.Core.Design -> D:\a\1\s\artifacts\bin\Controls.Core.Design\Debug\net472\Microsoft.Maui.Controls.DesignTools.dll
Controls.BindingSourceGen -> D:\a\1\s\artifacts\bin\Controls.BindingSourceGen\Debug\netstandard2.0\Microsoft.Maui.Controls.BindingSourceGen.dll
##vso[build.updatebuildnumber]10.0.60-ci+azdo.13684418
Controls.Core -> D:\a\1\s\artifacts\bin\Controls.Core\Debug\net10.0\Microsoft.Maui.Controls.dll
VisualTestUtils -> D:\a\1\s\artifacts\bin\VisualTestUtils\Debug\netstandard2.0\VisualTestUtils.dll
UITest.Core -> D:\a\1\s\artifacts\bin\UITest.Core\Debug\net10.0\UITest.Core.dll
UITest.Appium -> D:\a\1\s\artifacts\bin\UITest.Appium\Debug\net10.0\UITest.Appium.dll
UITest.NUnit -> D:\a\1\s\artifacts\bin\UITest.NUnit\Debug\net10.0\UITest.NUnit.dll
VisualTestUtils.MagickNet -> D:\a\1\s\artifacts\bin\VisualTestUtils.MagickNet\Debug\netstandard2.0\VisualTestUtils.MagickNet.dll
UITest.Analyzers -> D:\a\1\s\artifacts\bin\UITest.Analyzers\Debug\netstandard2.0\UITest.Analyzers.dll
Controls.TestCases.WinUI.Tests -> D:\a\1\s\artifacts\bin\Controls.TestCases.WinUI.Tests\Debug\net10.0\Controls.TestCases.WinUI.Tests.dll
Test run for D:\a\1\s\artifacts\bin\Controls.TestCases.WinUI.Tests\Debug\net10.0\Controls.TestCases.WinUI.Tests.dll (.NETCoreApp,Version=v10.0)
VSTest version 18.0.1 (x64)
Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
D:\a\1\s\artifacts\bin\Controls.TestCases.WinUI.Tests\Debug\net10.0\Controls.TestCases.WinUI.Tests.dll
NUnit Adapter 4.5.0.0: Test execution started
Running selected tests in D:\a\1\s\artifacts\bin\Controls.TestCases.WinUI.Tests\Debug\net10.0\Controls.TestCases.WinUI.Tests.dll
NUnit3TestExecutor discovered 0 of 0 NUnit test cases using Current Discovery mode, Explicit run
NUnit Adapter 4.5.0.0: Test execution complete
[xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.8.2+699d445a1a (64-bit .NET 10.0.0)
[xUnit.net 00:00:00.09] Discovering: Controls.TestCases.WinUI.Tests
[xUnit.net 00:00:00.28] Discovered: Controls.TestCases.WinUI.Tests
No test matches the given testcase filter `Issue27563` in D:\a\1\s\artifacts\bin\Controls.TestCases.WinUI.Tests\Debug\net10.0\Controls.TestCases.WinUI.Tests.dll
⚠️ Issues found
- ❌ Issue27563 FAILED with fix (should pass)
📁 Fix files reverted (2 files)
eng/pipelines/ci-copilot.ymlsrc/Controls/src/Core/Handlers/Items/CarouselViewHandler.Windows.cs
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 of the issue
Description of Change
_lastScrolledToPositiontracking field to prevent re-entrant ScrollTo calls that cause the infinite loop.UpdateCurrentItemto only issue ScrollTo when the position actually differs AND has not already been scrolled to.UpdatePosition(guarded byIsDragging/IsScrollingchecks) so IndicatorView-driven position changes scroll the carousel correctly.CarouselScrolled) and collection source changes (OnCollectionItemsSourceChanged).UpdateInitialPosition(see code review note about potential regression).Why tests are restricted on Windows and Mac:
Issues Fixed
Fixes #27563
Fixes #22468
Fixes #7149
Tested the behaviour in the following platforms
Screenshot
Before-Fix.mp4
After-Fix.mp4