Skip to content

[iOS] CarouselView2: Update internal scroll indicators for compositional layout#33639

Open
SubhikshaSf4851 wants to merge 4 commits intodotnet:inflight/currentfrom
SubhikshaSf4851:Fix-29390
Open

[iOS] CarouselView2: Update internal scroll indicators for compositional layout#33639
SubhikshaSf4851 wants to merge 4 commits intodotnet:inflight/currentfrom
SubhikshaSf4851:Fix-29390

Conversation

@SubhikshaSf4851
Copy link
Contributor

@SubhikshaSf4851 SubhikshaSf4851 commented Jan 21, 2026

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 :

When using CV2, UICollectionViewCompositionalLayout relies on an internal UIScrollView. Scrollbar visibility were applied only to the UICollectionView, but for the scrollbars to render correctly, the visibility must also be updated on the internal scroll view.

Description of Change

  • Updated the Extension methods in CollectionViewExtensions.cs to also update the scroll indicator visibility on the internal UIScrollView when a UICollectionViewCompositionalLayout is used.
  • Added retry logic to apply the update when the internal scroll view is not yet created.

Snapshot Updates — macOS (Intentional)

The following macOS snapshots were updated as part of this PR:

These changes are intentional because, after this PR, the scrollbars are now rendered on macOS as expected. Previously, they were not visible due to the underlying issue. With the fix in place, the visual output has been corrected, and the regenerated snapshots reflect this expected behavior rather than a regression.

Issues Fixed

Fixes #29390

Tested the behavior in the following platforms

  • Windows
  • Android
  • iOS
  • MacCatalyst
Before Issue Fix After Issue Fix
BeforeFix29390.mov
AfterFix29390.mov

@dotnet-policy-service dotnet-policy-service bot added community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration labels Jan 21, 2026
@Tamilarasan-Paranthaman Tamilarasan-Paranthaman added platform/ios area-controls-collectionview CollectionView, CarouselView, IndicatorView labels Jan 21, 2026
@SubhikshaSf4851 SubhikshaSf4851 changed the title [iOS] Fixed scrollbar visibility in Carousel view [iOS] Fixed Scrollbar should render correctly in Carousel View2 Jan 21, 2026
@sheiksyedm sheiksyedm marked this pull request as ready for review January 27, 2026 12:03
Copilot AI review requested due to automatic review settings January 27, 2026 12:03
@sheiksyedm
Copy link
Contributor

/azp run maui-pr-uitests 

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes iOS (and Mac Catalyst) CarouselView2 scroll indicator visibility by propagating ScrollBarVisibility updates to the internal UIScrollView used by UICollectionViewCompositionalLayout.

Changes:

  • Update iOS UICollectionView scrollbar visibility extensions to also update the internal UIScrollView when using UICollectionViewCompositionalLayout.
  • Add a device test to validate CarouselView2 scrollbar visibility updates on iOS.

Reviewed changes

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

File Description
src/Core/src/Platform/iOS/CollectionViewExtensions.cs Propagates scroll indicator visibility to the internal UIScrollView used by compositional layouts (CV2).
src/Controls/tests/DeviceTests/Elements/CollectionView/CollectionViewTests.iOS.cs Adds an iOS device test intended to validate the CarouselView2 scroll indicator behavior.

@rmarinho rmarinho added s/agent-changes-requested AI agent recommends changes - found a better alternative or issues s/agent-fix-win AI found a better alternative fix than the PR s/agent-reviewed PR was reviewed by AI agent workflow (full 4-phase review) labels Feb 18, 2026
@SubhikshaSf4851
Copy link
Contributor Author

🤖 AI Summary

📊 Expand Full Review
📋 Expand PR Finalization Review

I’ve updated the changes based on the review. Specifically:

  • Fixed potential null dereference to prevent test failures
  • Added the missing key assertion to properly validate the bug fix
  • Addressed the timing race condition to avoid flaky CI test failures

@rmarinho rmarinho added s/agent-approved AI agent recommends approval - PR fix is correct and optimal and removed s/agent-changes-requested AI agent recommends changes - found a better alternative or issues labels Feb 18, 2026
kubaflo
kubaflo previously approved these changes Feb 18, 2026
@kubaflo kubaflo added s/agent-fix-implemented PR author implemented the agent suggested fix s/agent-fix-lose Author adopted the agent's fix and it turned out to be bad s/agent-fix-pr-picked AI could not beat the PR fix - PR is the best among all candidates and removed s/agent-fix-win AI found a better alternative fix than the PR s/agent-fix-lose Author adopted the agent's fix and it turned out to be bad labels Feb 18, 2026
@kubaflo kubaflo added s/agent-approved AI agent recommends approval - PR fix is correct and optimal s/agent-changes-requested AI agent recommends changes - found a better alternative or issues and removed s/agent-review-incomplete AI agent could not complete all phases (blocker, timeout, error) s/agent-approved AI agent recommends approval - PR fix is correct and optimal labels Mar 16, 2026
@sheiksyedm
Copy link
Contributor

/azp run maui-pr-uitests , maui-pr-devicetests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

Copy link
Contributor

@kubaflo kubaflo left a comment

Choose a reason for hiding this comment

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

Could you please review the Ai's summary comment?

@kubaflo kubaflo added s/agent-fix-win AI found a better alternative fix than the PR and removed s/agent-fix-pr-picked AI could not beat the PR fix - PR is the best among all candidates labels Mar 17, 2026
@SubhikshaSf4851
Copy link
Contributor Author

@kubaflo

Concern 1 — Snapshots:

Updated the PR description to clarify that the macOS snapshot changes for CarouselViewShouldScrollToRightPosition.png and IndicatorViewWithTemplatedIcon.png are intentional. These baselines were regenerated to reflect the current correct rendering after this fix.

Concern 2 — LayoutIfNeeded() vs BeginInvokeOnMainThread:

BeginInvokeOnMainThread is intentional here. LayoutIfNeeded() forces an expensive synchronous layout pass and doesn't guarantee the internal scroll view is created by UIKit at that point. Deferring to the next run loop iteration is the safer and more efficient approach. no changes are needed

Concern 3 — Polling vs Task.Delay(100):

Polling isn't necessary here. The condition depends only on a BeginInvokeOnMainThread callback — which runs on the same thread as the test. await Task.Delay(100) yields back to the run loop, which drains the callback in microseconds. 100ms is more than sufficient and no changes are needed.

Concern 4 — VerifyScreenshot() / visual flakiness:

Avoided VerifyScreenshot() intentionally — scroll indicators on iOS are translucent and only visible while scrolling, so a static screenshot would pass even when the bug is present. Asserting the property value directly is more reliable and not susceptible to visual flakiness.

@MauiBot
Copy link
Collaborator

MauiBot commented Mar 24, 2026

🤖 AI Summary

📊 Expand Full Review2dd86da · Updated suggestion
🔍 Pre-Flight — Context & Validation

Issue: #29390 - [iOS] Horizontal Scroll Bar Not Visible on CarouselView (CV2)
PR: #33639 - [iOS] Fixed Scrollbar should render correctly in Carousel View2
Author: SubhikshaSf4851 (community ✨, partner/syncfusion)
Platforms Affected: iOS, macOS (MacCatalyst) — CV2 with UICollectionViewCompositionalLayout
Files Changed: 1 implementation (CollectionViewExtensions.cs), 1 test (CollectionViewTests.iOS.cs), 2 snapshots

Key Findings

  • Root Cause: UICollectionViewCompositionalLayout (used by CV2/CarouselView2) delegates scrollbar rendering to an internal UIScrollView subview. The existing extension methods only set ShowsHorizontalScrollIndicator/ShowsVerticalScrollIndicator on the UICollectionView itself, not on the internal UIScrollView, so scrollbars never appear.
  • Fix approach: In CollectionViewExtensions.cs, after setting the indicator on the UICollectionView, detect if CollectionViewLayout is UICollectionViewCompositionalLayout and walk subviews to find the first UIScrollView that isn't the collection view itself, then mirror the indicator setting. A BeginInvokeOnMainThread retry handles the deferred case where the internal scroll view doesn't exist yet.
  • Test type: iOS Device Test (in DeviceTests/Elements/CollectionView/CollectionViewTests.iOS.cs), NOT a UI test. No TestCases.HostApp entry. Gate must be skipped.
  • Test name: CheckCarouselViewScrollBarVisibilityUpdates — covers Always/Never visibility states on both the native collection view and the internal UIScrollView.
  • Prior agent review labels: s/agent-reviewed, s/agent-fix-implemented, s/agent-fix-pr-picked — a prior full review was completed. The PR author has since updated the test based on inline review feedback.
  • Snapshot updates: Two PNG snapshots in TestCases.Mac.Tests/snapshots/mac/ were updated: CarouselViewShouldScrollToRightPosition.png and IndicatorViewWithTemplatedIcon.png. The PR description does not explain why these changed.

Fix Candidates

# Source Approach Test Result Files Changed Notes
PR PR #33639 Walk UICollectionView.Subviews to find internal UIScrollView; mirror indicator visibility; retry via BeginInvokeOnMainThread if not yet created ⏳ PENDING (Gate) CollectionViewExtensions.cs Original PR fix

Edge Cases Noted

  • Internal UIScrollView may not exist immediately (deferred layout) — addressed with single retry logic
  • Fix scoped only to UICollectionViewCompositionalLayout (CV2), not affecting CV1 or other layouts
  • TryApplyToInternalScrollView returns the first non-self UIScrollView subview — could theoretically match wrong view if Apple adds other scroll views internally (low risk in practice, documented in code)
  • macOS snapshots changed — indicates fix has visual impact on macOS too (expected, same code path via MacCatalyst)
  • Test uses Task.Delay(100) for timing — potentially fragile but acceptable in device test context

Issue: #29390 - [iOS] Horizontal Scroll Bar Not Visible on CarouselView (CV2)
PR: #33639 - [iOS] Fixed Scrollbar should render correctly in Carousel View2
Author: SubhikshaSf4851 (community / partner: Syncfusion)
Platforms Affected: iOS, macOS (CV2 only — UICollectionViewCompositionalLayout)
Files Changed: 1 implementation, 1 device test, 2 Mac snapshots

Key Findings

  • Root cause: UICollectionViewCompositionalLayout (used by CV2/CarouselView2) manages scroll indicators via an internal UIScrollView subview. Setting ShowsHorizontalScrollIndicator / ShowsVerticalScrollIndicator only on the outer UICollectionView has no visual effect in CV2.
  • Fix: Extended CollectionViewExtensions.cs to walk the UICollectionView.Subviews and update the first non-self UIScrollView found. A single deferred retry via BeginInvokeOnMainThread handles the case where the internal scroll view doesn't exist yet at the time the property is set.
  • Test type: Device test (CollectionViewTests.iOS.cs) — NOT a UI test in TestCases.HostApp/Shared.Tests.
  • Prior agent review: 3 inline review comments from Copilot reviewer (all resolved by PR author): null dereference, timing race, missing internalScrollView horizontal assertion.
  • Snapshot changes: Two Mac test snapshots modified — likely due to minor visual changes from the fix.
  • Risk note: TryApplyToInternalScrollView relies on internal Apple implementation details (UIScrollView subview of UICollectionViewCompositionalLayout). Documented in code comment.

Fix Candidates

# Source Approach Test Result Files Changed Notes
PR PR #33639 Walk UICollectionView.Subviews to find internal UIScrollView; propagate indicator visibility; one deferred retry via BeginInvokeOnMainThread ⏳ PENDING (Gate) CollectionViewExtensions.cs Original PR

Result: ✅ COMPLETE

Issue: #29390 - [iOS] Horizontal Scroll Bar Not Visible on CarouselView (CV2)
PR: #33639 - [iOS] Fixed Scrollbar should render correctly in Carousel View2
Platforms Affected: iOS, MacCatalyst
Files Changed: 1 implementation, 1 test, 2 snapshot artifacts

Key Findings

  • The linked issue reports that CarouselView using CV2 does not show the horizontal scrollbar on iOS/macOS even when HorizontalScrollBarVisibility is Always or Default.
  • The PR updates src/Core/src/Platform/iOS/CollectionViewExtensions.cs so compositional-layout-backed UICollectionView instances also propagate indicator visibility to an internal UIScrollView, with one deferred retry if that subview is not yet available.
  • Test coverage added in src/Controls/tests/DeviceTests/Elements/CollectionView/CollectionViewTests.iOS.cs is an iOS device test, not a HostApp/UI test; the PR also includes two Mac snapshot updates that appear unrelated to the bug fix itself.
  • Prior automated review comments focused on the test becoming timing-dependent and not fully asserting the internal horizontal indicator path; the current version addresses those concerns by polling for the internal scroll view and asserting both native and internal indicator state in the Always and Never cases.

Edge Cases Mentioned

  • The issue was verified on both iOS and MacCatalyst, while the new automated test only exercises the iOS device-test surface.
  • The production fix depends on UICollectionViewCompositionalLayout continuing to expose a separate internal UIScrollView for indicators; if UIKit changes that implementation, the helper silently falls back to updating only the outer collection view.

Fix Candidates

# Source Approach Test Result Files Changed Notes
PR PR #33639 Mirror horizontal/vertical scroll indicator visibility from compositional-layout UICollectionView to its internal UIScrollView, retrying once on the main thread if the inner scroll view is not yet PENDING (Gate) src/Core/src/Platform/iOS/CollectionViewExtensions.cs, src/Controls/tests/DeviceTests/Elements/CollectionView/CollectionViewTests.iOS.cs Original PR created.

Issue: #29390 - [iOS] Horizontal Scroll Bar Not Visible on CarouselView (CV2)
PR: #33639 - [iOS] Fixed Scrollbar should render correctly in Carousel View2
Platforms Affected: iOS, MacCatalyst/macOS
Files Changed: 1 implementation, 1 test, 2 snapshot updates

Key Findings

  • The linked issue reports that CarouselView using CV2 does not show the horizontal scrollbar on iOS/macOS even when HorizontalScrollBarVisibility is Always or Default.
  • The PR updates src/Core/src/Platform/iOS/CollectionViewExtensions.cs so compositional-layout-backed collection views also propagate scrollbar visibility to the internal UIScrollView, with one deferred retry if that internal scroll view is not ready yet.
  • The PR adds an iOS device test in src/Controls/tests/DeviceTests/Elements/CollectionView/CollectionViewTests.iOS.cs, so the relevant test surface is DeviceTest.
  • Review discussion focused on making the new test deterministic: wait for the internal scroll view to exist, account for deferred updates, and assert the internal horizontal indicator in the Never case.
  • The PR also updates two macOS snapshot baselines (CarouselViewShouldScrollToRightPosition.png, IndicatorViewWithTemplatedIcon.png); these are collateral test artifacts, not the primary fix surface.

Edge Cases Mentioned

  • Verified repro comment confirms the issue reproduces on both iOS and MacCatalyst.
  • The PR description explicitly notes the fix depends on UICollectionViewCompositionalLayout using an internal UIScrollView, which is the key platform-specific behavior under test.

Fix Candidates

# Source Approach Test Result Files Changed Notes
PR PR #33639 Propagate scrollbar visibility from the outer UICollectionView to the internal compositional-layout UIScrollView, with a deferred retry, and validate it with an iOS device PENDING (Gate) src/Core/src/Platform/iOS/CollectionViewExtensions.cs, src/Controls/tests/DeviceTests/Elements/CollectionView/CollectionViewTests.iOS.cs Original PR test.

🚦 Gate — Test Verification

Gate Result: ⚠️ SKIPPED

Platform: iOS
Mode: Skipped — no UI tests in TestCases.HostApp or TestCases.Shared.Tests

Reason: PR #33639 includes only a Device Test in src/Controls/tests/DeviceTests/Elements/CollectionView/CollectionViewTests.iOS.cs. The Gate phase requires tests in TestCases.HostApp or TestCases.Shared.Tests to be verified via BuildAndRunHostApp.ps1. Device tests use a different test infrastructure (XHarness/Helix).

  • Tests FAIL without fix: ⏳ NOT VERIFIED (device test infrastructure, not UI test)
  • Tests PASS with fix: ⏳ NOT VERIFIED

Note: The PR includes a device test CheckCarouselViewScrollBarVisibilityUpdates that exercises the fix. Try-Fix phase will use Run-DeviceTests.ps1 to validate fix candidates.

Gate Result: ⚠️ SKIPPED

Platform: iOS
Mode: Full Verification (attempted)

Reason: No tests found in TestCases.HostApp or TestCases.Shared.Tests. The PR adds a device test (src/Controls/tests/DeviceTests/Elements/CollectionView/CollectionViewTests.iOS.cs) — a different test type (xUnit device tests) that runs on a real/simulated device via the run-device-tests skill, not the verify-tests-fail-without-fix skill (which targets UI tests).

Test that exists:

  • CollectionViewTests.iOS.csCheckCarouselViewScrollBarVisibilityUpdates() device test

Impact: Cannot run the automated FAIL/PASS verification cycle via verify-tests-fail-without-fix. Proceeding to Try-Fix phase.

  • Tests FAIL without fix: ⚠️ UNVERIFIED (no UI tests to run)
  • Tests PASS with fix: ⚠️ UNVERIFIED (no UI tests to run)

Gate SKIPPEDResult:

Platform: ios
Mode: Full Verification

  • Tests FAIL without fix:
  • Tests PASS with fix:

Notes

  • PR [iOS] CarouselView2: Update internal scroll indicators for compositional layout #33639 does not add a TestCases.HostApp / TestCases.Shared.Tests UI test that the verify-tests-fail-without-fix skill can run.
  • The added coverage is an iOS device test in src/Controls/tests/DeviceTests/Elements/CollectionView/CollectionViewTests.iOS.cs, so the standard Gate workflow is not applicable here.
  • Proceeding to mandatory Try-Fix exploration with this limitation documented.

Gate SKIPPEDResult:

Platform: ios
Test Type: DeviceTest (Controls)
Mode: Full Verification

  • Tests FAIL without Unable to verify due to iOS simulator deployment timeout (XHarness exit code 83 / app launch failure).fix:
  • Tests PASS with Not run because the without-fix phase did not complete.fix:

Detected Runner: pwsh .github/skills/run-device-tests/scripts/Run-DeviceTests.ps1 -Project Controls -Platform ios -TestFilter "<filter>"
Working Try-Fix Command: pwsh .github/skills/run-device-tests/scripts/Run-DeviceTests.ps1 -Project Controls -Platform ios -TestFilter "FullyQualifiedName~CheckCarouselViewScrollBarVisibilityUpdates"

Notes: The verification skill auto-detected this PR as an iOS Controls device-test change. Full gate verification was blocked by the local simulator environment timing out during app launch/deployment, so Phase 3 continues under the environment-blocker rule.


🔧 Fix — Analysis & Comparison

Gate Result: ⚠️ SKIPPED

Platform: iOS
Mode: Skipped — no UI tests in TestCases.HostApp or TestCases.Shared.Tests

Reason: PR #33639 includes only a Device Test in src/Controls/tests/DeviceTests/Elements/CollectionView/CollectionViewTests.iOS.cs. The Gate phase requires tests in TestCases.HostApp or TestCases.Shared.Tests to be verified via BuildAndRunHostApp.ps1. Device tests use a different test infrastructure (XHarness/Helix).

  • Tests FAIL without fix: ⏳ NOT VERIFIED (device test infrastructure, not UI test)
  • Tests PASS with fix: ⏳ NOT VERIFIED

Note: The PR includes a device test CheckCarouselViewScrollBarVisibilityUpdates that exercises the fix. Try-Fix phase will use Run-DeviceTests.ps1 to validate fix candidates.

Gate Result: ⚠️ SKIPPED

Platform: iOS
Mode: Full Verification (attempted)

Reason: No tests found in TestCases.HostApp or TestCases.Shared.Tests. The PR adds a device test (src/Controls/tests/DeviceTests/Elements/CollectionView/CollectionViewTests.iOS.cs) — a different test type (xUnit device tests) that runs on a real/simulated device via the run-device-tests skill, not the verify-tests-fail-without-fix skill (which targets UI tests).

Test that exists:

  • CollectionViewTests.iOS.csCheckCarouselViewScrollBarVisibilityUpdates() device test

Impact: Cannot run the automated FAIL/PASS verification cycle via verify-tests-fail-without-fix. Proceeding to Try-Fix phase.

  • Tests FAIL without fix: ⚠️ UNVERIFIED (no UI tests to run)
  • Tests PASS with fix: ⚠️ UNVERIFIED (no UI tests to run)

Gate SKIPPEDResult:

Platform: ios
Mode: Full Verification

  • Tests FAIL without fix:
  • Tests PASS with fix:

Notes

  • PR [iOS] CarouselView2: Update internal scroll indicators for compositional layout #33639 does not add a TestCases.HostApp / TestCases.Shared.Tests UI test that the verify-tests-fail-without-fix skill can run.
  • The added coverage is an iOS device test in src/Controls/tests/DeviceTests/Elements/CollectionView/CollectionViewTests.iOS.cs, so the standard Gate workflow is not applicable here.
  • Proceeding to mandatory Try-Fix exploration with this limitation documented.

Fix Candidates

# Source Approach Test Result Files Changed Notes
PR PR #33639 Propagate scrollbar visibility from the outer UICollectionView to the internal compositional-layout UIScrollView, with a deferred retry, and validate it with an iOS device Gate blocked src/Core/src/Platform/iOS/CollectionViewExtensions.cs, src/Controls/tests/DeviceTests/Elements/CollectionView/CollectionViewTests.iOS.cs Original PR; gate blocked by local iOS simulator timeout test.

Cross-Pollination

Model Round New Ideas? Details

Exhausted: No
Selected Fix: awaiting try-fix attempts.Pending


📋 Report — Final Recommendation

Gate Result: ⚠️ SKIPPED

Platform: iOS
Mode: Skipped — no UI tests in TestCases.HostApp or TestCases.Shared.Tests

Reason: PR #33639 includes only a Device Test in src/Controls/tests/DeviceTests/Elements/CollectionView/CollectionViewTests.iOS.cs. The Gate phase requires tests in TestCases.HostApp or TestCases.Shared.Tests to be verified via BuildAndRunHostApp.ps1. Device tests use a different test infrastructure (XHarness/Helix).

  • Tests FAIL without fix: ⏳ NOT VERIFIED (device test infrastructure, not UI test)
  • Tests PASS with fix: ⏳ NOT VERIFIED

Note: The PR includes a device test CheckCarouselViewScrollBarVisibilityUpdates that exercises the fix. Try-Fix phase will use Run-DeviceTests.ps1 to validate fix candidates.

Gate Result: ⚠️ SKIPPED

Platform: iOS
Mode: Full Verification (attempted)

Reason: No tests found in TestCases.HostApp or TestCases.Shared.Tests. The PR adds a device test (src/Controls/tests/DeviceTests/Elements/CollectionView/CollectionViewTests.iOS.cs) — a different test type (xUnit device tests) that runs on a real/simulated device via the run-device-tests skill, not the verify-tests-fail-without-fix skill (which targets UI tests).

Test that exists:

  • CollectionViewTests.iOS.csCheckCarouselViewScrollBarVisibilityUpdates() device test

Impact: Cannot run the automated FAIL/PASS verification cycle via verify-tests-fail-without-fix. Proceeding to Try-Fix phase.

  • Tests FAIL without fix: ⚠️ UNVERIFIED (no UI tests to run)
  • Tests PASS with fix: ⚠️ UNVERIFIED (no UI tests to run)

Gate SKIPPEDResult:

Platform: ios
Mode: Full Verification

  • Tests FAIL without fix:
  • Tests PASS with fix:

Notes

  • PR [iOS] CarouselView2: Update internal scroll indicators for compositional layout #33639 does not add a TestCases.HostApp / TestCases.Shared.Tests UI test that the verify-tests-fail-without-fix skill can run.
  • The added coverage is an iOS device test in src/Controls/tests/DeviceTests/Elements/CollectionView/CollectionViewTests.iOS.cs, so the standard Gate workflow is not applicable here.
  • Proceeding to mandatory Try-Fix exploration with this limitation documented.

📋 Expand PR Finalization Review

PR #33639 Finalization Review

Title: Needs Update

Current: [iOS] Fixed Scrollbar should render correctly in Carousel View2

Recommended: [iOS] CarouselView2: Update internal scroll indicators for compositional layout

Why: The current title is grammatically awkward and underspecifies the actual fix. The implementation is specifically about propagating ScrollBarVisibility to the internal UIScrollView used by UICollectionViewCompositionalLayout in CV2, so the title should say that directly.

Description: Good foundation, but tighten accuracy

Quality assessment:

  • Structure: Good. It has the required NOTE block and key sections.
  • Technical depth: Good. The root cause and fix approach are described.
  • Accuracy: Mostly good, but not fully aligned with the final PR contents.
  • Completeness: Needs platform/test cleanup and artifact clarification.

Keep:

  • The NOTE block.
  • The root cause section describing CV2/compositional layout using an internal UIScrollView.
  • The description of updating both UICollectionView and the internal scroll view.

Update:

  • The Tested the behavior in the following platforms checklist currently marks Windows and Android as tested, but this PR only changes iOS/CV2 code and an iOS device test. That section overclaims relative to the actual diff.
  • Use MacCatalyst instead of generic Mac if that is the platform that was actually exercised.
  • Remove the empty before/after comparison table, or populate it.
  • If the Mac snapshot changes remain in the PR, explain why they are part of this fix.

Suggested description adjustment:

  • Keep the current root-cause and fix sections.
  • Correct the tested-platform list to only the platforms actually validated.
  • Add one sentence noting that the fix depends on CV2's compositional-layout internal scroll view.

Code Review Findings

Important Issues

Unrelated Mac snapshot updates should be removed or justified

  • Files:
    • src/Controls/tests/TestCases.Mac.Tests/snapshots/mac/CarouselViewShouldScrollToRightPosition.png
    • src/Controls/tests/TestCases.Mac.Tests/snapshots/mac/IndicatorViewWithTemplatedIcon.png
  • Problem: These files are unrelated to the iOS CarouselView2 scrollbar fix described by the issue, the title, and the code changes. Leaving them in the PR adds review noise and makes it harder to tell whether the PR contains unintended visual-regression artifacts.
  • Recommendation: Drop the snapshot-only commit unless these images are intentionally required for this fix. If they are intentional, explain the causal link in the PR description.

Suggestions

  • The implementation relies on UIKit's internal compositional-layout structure (UICollectionView hosting a separate internal UIScrollView) and applies only a single deferred retry. That is acceptable for this fix, but it is worth calling out in the description because the behavior depends on UIKit internals and may need revalidation on future iOS updates.
  • The new device test is much stronger after the follow-up commits because it now waits for the internal scroll view and asserts both native and internal indicators for both Always and Never. If this test becomes flaky later, the fixed Task.Delay(100) calls would be the first thing to revisit.

Looks Good

  • The root cause in the description matches the actual code change: CV2/compositional layout uses an internal UIScrollView, so updating only the outer UICollectionView was insufficient.
  • The final test coverage is materially better than the initial version shown in the commit history; it now validates the key internal-scroll-view behavior the bug depends on.
  • The code change is scoped to the iOS/CV2 path and does not introduce obvious cross-platform churn in the handler logic itself.

Final Verdict

Not ready to merge as-is.

The core fix looks reasonable, but before merge I would:

  1. Update the PR title to describe the actual implementation.
  2. Correct the PR description's tested-platform claims.
  3. Remove or explicitly justify the unrelated Mac snapshot updates.

@MauiBot MauiBot added s/agent-review-incomplete AI agent could not complete all phases (blocker, timeout, error) and removed s/agent-changes-requested AI agent recommends changes - found a better alternative or issues labels Mar 24, 2026
@SubhikshaSf4851 SubhikshaSf4851 changed the title [iOS] Fixed Scrollbar should render correctly in Carousel View2 [iOS] CarouselView2: Update internal scroll indicators for compositional layout Mar 24, 2026
@MauiBot MauiBot added s/agent-approved AI agent recommends approval - PR fix is correct and optimal s/agent-fix-pr-picked AI could not beat the PR fix - PR is the best among all candidates and removed s/agent-review-incomplete AI agent could not complete all phases (blocker, timeout, error) s/agent-fix-win AI found a better alternative fix than the PR labels Mar 25, 2026
@dotnet dotnet deleted a comment from MauiBot Mar 25, 2026
@dotnet dotnet deleted a comment from MauiBot Mar 25, 2026
@dotnet dotnet deleted a comment from MauiBot Mar 25, 2026
@dotnet dotnet deleted a comment from MauiBot Mar 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-controls-collectionview CollectionView, CarouselView, IndicatorView community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration platform/ios s/agent-approved AI agent recommends approval - PR fix is correct and optimal s/agent-fix-implemented PR author implemented the agent suggested fix s/agent-fix-pr-picked AI could not beat the PR fix - PR is the best among all candidates s/agent-reviewed PR was reviewed by AI agent workflow (full 4-phase review)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[iOS] Horizontal Scroll Bar Not Visible on CarouselView (CV2)

7 participants