Repository navigation
[net11.0] Obsolete legacy CollectionView handler APIs - #38049
Conversation
Mark superseded Items handler APIs obsolete on Apple platforms and Windows while preserving active and shared implementations. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 38049Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 38049" |
|
Azure Pipelines: Successfully started running 1 pipeline(s). There may be pipelines that require an authorized user to comment /azp run to run. |
There was a problem hiding this comment.
🟢 Approval recommended
Pull request overview
This PR updates the .NET MAUI Controls “Items/” (legacy) CollectionView/CarouselView handler surface for .NET 11 by marking legacy handler extension-point APIs as [Obsolete] on platforms where Items2/ is the active implementation (iOS/MacCatalyst and Windows CollectionView). It also scopes CS0618 suppressions to internal legacy inheritance and to tests that intentionally exercise CV1 behavior, and it corrects repository guidance to reflect that Items2/ includes a Windows CollectionView handler.
Changes:
- Mark legacy Items handler public APIs as obsolete on iOS/MacCatalyst and Windows CollectionView (with migration guidance to Items2 types).
- Add narrowly-scoped
#pragma warning disable/restore CS0618in tests and internal legacy implementation points that must continue to reference obsolete legacy APIs. - Update
.github/instructionsguidance to correctly reflect Items vs Items2 handler coverage on Windows and across platforms.
File summaries
| File | Description |
|---|---|
| src/Controls/tests/TestCases.HostApp/CollectionViewHostBuilderExtentions.cs | Suppress CS0618 for CV1 test wiring |
| src/Controls/tests/DeviceTests/TestCases/ControlsViewTypesTestCases.cs | Suppress CS0618 for legacy handler matrix |
| src/Controls/tests/DeviceTests/Memory/MemoryTests.cs | Suppress CS0618 for legacy handler coverage |
| src/Controls/tests/DeviceTests/Elements/VisualElementTree/VisualElementTreeTests.cs | Suppress CS0618 for legacy CollectionView handler |
| src/Controls/tests/DeviceTests/Elements/Shell/ShellTests.cs | Suppress CS0618 for legacy CollectionView handler |
| src/Controls/tests/DeviceTests/Elements/NavigationPage/NavigationPageTests.cs | Suppress CS0618 for legacy Items handlers |
| src/Controls/tests/DeviceTests/Elements/CollectionView/CollectionViewTests.Windows.cs | File-scoped CS0618 suppression for legacy handler tests |
| src/Controls/tests/DeviceTests/Elements/CollectionView/CollectionViewTests.iOS.cs | File-scoped CS0618 suppression for legacy handler tests |
| src/Controls/tests/DeviceTests/Elements/CollectionView/CollectionViewTests.cs | Scoped CS0618 suppressions around legacy handler usage |
| src/Controls/tests/DeviceTests/Elements/CollectionView/CollectionViewCacheTests.ios.cs | CS0618 suppression for legacy handler cache tests |
| src/Controls/tests/DeviceTests/Elements/CarouselView/CarouselViewTests.cs | File-scoped CS0618 suppression for legacy CarouselView handler tests |
| src/Controls/src/Core/Hosting/AppHostBuilderExtensions.cs | Keep Windows CV1 opt-out path; suppress CS0618 |
| src/Controls/src/Core/Handlers/Items/StructuredItemsViewHandler.Windows.cs | Obsolete legacy Windows structured handler base |
| src/Controls/src/Core/Handlers/Items/StructuredItemsViewHandler.iOS.cs | Obsolete legacy iOS structured handler base |
| src/Controls/src/Core/Handlers/Items/SelectableItemsViewHandler.Windows.cs | Obsolete legacy Windows selectable handler base |
| src/Controls/src/Core/Handlers/Items/SelectableItemsViewHandler.iOS.cs | Obsolete legacy iOS selectable handler base |
| src/Controls/src/Core/Handlers/Items/ReorderableItemsViewHandler.Windows.cs | Obsolete legacy Windows reorderable handler base |
| src/Controls/src/Core/Handlers/Items/ReorderableItemsViewHandler.iOS.cs | Obsolete legacy iOS reorderable handler base |
| src/Controls/src/Core/Handlers/Items/ItemsViewHandler.iOS.cs | Obsolete legacy iOS ItemsViewHandler base |
| src/Controls/src/Core/Handlers/Items/iOS/WidthConstrainedTemplatedCell.cs | Suppress CS0618 for internal legacy cell inheritance |
| src/Controls/src/Core/Handlers/Items/iOS/VerticalDefaultSupplementalView.cs | Suppress CS0618 for internal legacy cell inheritance |
| src/Controls/src/Core/Handlers/Items/iOS/VerticalDefaultCell.cs | Suppress CS0618 for internal legacy cell inheritance |
| src/Controls/src/Core/Handlers/Items/iOS/TemplatedCell.cs | Obsolete legacy templated cell extension point |
| src/Controls/src/Core/Handlers/Items/iOS/StructuredItemsViewController.cs | Obsolete legacy controller API |
| src/Controls/src/Core/Handlers/Items/iOS/SelectableItemsViewDelegator.cs | Obsolete legacy delegator API |
| src/Controls/src/Core/Handlers/Items/iOS/SelectableItemsViewController.cs | Obsolete legacy controller API |
| src/Controls/src/Core/Handlers/Items/iOS/ReorderableItemsViewDelegator.cs | Obsolete legacy delegator API |
| src/Controls/src/Core/Handlers/Items/iOS/ReorderableItemsViewController.cs | Obsolete legacy controller API |
| src/Controls/src/Core/Handlers/Items/iOS/ListViewLayout.cs | Obsolete legacy layout API |
| src/Controls/src/Core/Handlers/Items/iOS/LayoutAttributesChangedEventArgs.cs | Obsolete legacy event args API |
| src/Controls/src/Core/Handlers/Items/iOS/ItemsViewLayout.cs | Obsolete legacy layout base API |
| src/Controls/src/Core/Handlers/Items/iOS/ItemsViewDelegator.cs | Obsolete legacy delegator base API |
| src/Controls/src/Core/Handlers/Items/iOS/ItemsViewController.cs | Obsolete legacy controller base API |
| src/Controls/src/Core/Handlers/Items/iOS/ItemsViewCell.cs | Obsolete legacy cell base API |
| src/Controls/src/Core/Handlers/Items/iOS/HorizontalDefaultSupplementalView.cs | Suppress CS0618 for internal legacy cell inheritance |
| src/Controls/src/Core/Handlers/Items/iOS/HorizontalDefaultCell.cs | Suppress CS0618 for internal legacy cell inheritance |
| src/Controls/src/Core/Handlers/Items/iOS/HeightConstrainedTemplatedCell.cs | Suppress CS0618 for internal legacy cell inheritance |
| src/Controls/src/Core/Handlers/Items/iOS/GroupableItemsViewDelegator.cs | Obsolete legacy delegator API |
| src/Controls/src/Core/Handlers/Items/iOS/GroupableItemsViewController.cs | Obsolete legacy controller API |
| src/Controls/src/Core/Handlers/Items/iOS/GridViewLayout.cs | Obsolete legacy layout API |
| src/Controls/src/Core/Handlers/Items/iOS/DefaultCell.cs | Obsolete legacy default cell API |
| src/Controls/src/Core/Handlers/Items/iOS/CarouselViewLayout.cs | Obsolete legacy carousel layout API |
| src/Controls/src/Core/Handlers/Items/iOS/CarouselViewDelegator.cs | Obsolete legacy carousel delegator API |
| src/Controls/src/Core/Handlers/Items/iOS/CarouselViewController.cs | Obsolete legacy carousel controller API |
| src/Controls/src/Core/Handlers/Items/iOS/CarouselTemplatedCell.cs | Obsolete legacy carousel templated cell API |
| src/Controls/src/Core/Handlers/Items/GroupableItemsViewHandler.Windows.cs | Obsolete legacy Windows groupable handler base |
| src/Controls/src/Core/Handlers/Items/GroupableItemsViewHandler.iOS.cs | Obsolete legacy iOS groupable handler base |
| src/Controls/src/Core/Handlers/Items/CollectionViewHandler.Windows.cs | Obsolete legacy Windows CollectionViewHandler |
| src/Controls/src/Core/Handlers/Items/CollectionViewHandler.iOS.cs | Obsolete legacy iOS CollectionViewHandler |
| src/Controls/src/Core/Handlers/Items/CarouselViewHandler.iOS.cs | Obsolete legacy iOS CarouselViewHandler |
| .github/instructions/collectionview-windows.instructions.md | Update guidance: Items2 is default for Windows CollectionView |
| .github/instructions/collectionview-handler-detection.instructions.md | Correct handler detection guidance + shared infra notes |
Review details
- Files reviewed: 52/52 changed files
- Comments generated: 0
- Review effort level: Lite
This comment has been minimized.
This comment has been minimized.
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
Clarify platform-scoped obsolete messages and route general Apple device tests through Items2 while retaining explicit CV1 compatibility and shared-helper coverage. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
🔵 Needs a closer look
It introduces broad public API obsolescence across multiple platforms and relies on platform-specific compilation/validation (especially Windows) that should be confirmed by a human reviewer.
Review details
- Files reviewed: 54/54 changed files
- Comments generated: 0 new
- Review effort level: Lite
This comment has been minimized.
This comment has been minimized.
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
MauiBot
left a comment
There was a problem hiding this comment.
AI Review Summary
@mattleibow — new AI review results are available based on commit
17f2bd7.
🗂️ Review Sessions — click to expand
🚦 Gate — Test Before & After Fix
Gate Result: ⚠️ INCONCLUSIVE
Platform: IOS · Base: net11.0 · Merge base: 14797cb1
🩺 Could not verify — environment/infrastructure error. The gate ran the tests but hit an environment error (an emulator/simulator/Appium/XHarness flake, a device that would not boot, or an empty/invalid result file), so it could not record a real pass/fail. The /review to retry on a fresh agent.
XHarness did not produce the expected fresh result 'testResults.xml' for requested class(es) 'Microsoft.Maui.DeviceTests.CacheTestCollectionView' (the target tests did not run).
⚠️ Gate coverage limitations
- The A/B gate did not verify 5 dropped DeviceTest group(s): CollectionViewTests (CellSizeAccountsForMargin, CollectionScrollToUngroupedWorks, CollectionScrollToGroupWorks, CollectionViewItemsWithFixedWidthAndDifferentHeight, SwipeViewInCollectionViewDoesNotCrash, ClearingItemsSourceClearsBindingContext, ItemsSourceGroupedClearDoestCrash, CollectionViewContentRespectsMargin, ClearingItemsSourceAfterCellMeasureInvalidationDoesNotCrash, CollectionViewCellContentShouldBeScrollViewDescendant), MemoryTests (HandlerDoesNotLeak, CollectionViewHeaderFooterDoesntLeak, CarouselViewController2ControllerDoesNotLeakAfterNavigationPop), NavigationPageTests, ShellTests, VisualElementTreeTests. Deep UI Tests runs HostApp UI categories only and does not execute DeviceTests; separate device-test validation is required.
| Test | Without Fix (expect FAIL) | With Fix (expect PASS) |
|---|---|---|
📱 CacheTestCollectionView CacheTestCollectionView |
||
📱 CarouselViewTests Category=CarouselView |
🔴 Without fix — 📱 CacheTestCollectionView: ⚠️ ENV ERROR · 180s
No log file found
🟢 With fix — 📱 CacheTestCollectionView: ⚠️ ENV ERROR · 63s
No log file found
🔴 Without fix — 📱 CarouselViewTests: ⚠️ ENV ERROR · 95s
No log file found
🟢 With fix — 📱 CarouselViewTests: ⚠️ ENV ERROR · 54s
No log file found
⚠️ Failure Details
⚠️ CacheTestCollectionView without fix:XHarness did not produce the expected fresh result 'testResults.xml' for requested class(es) 'Microsoft.Maui.DeviceTests.CacheTestCollectionView' (the target tests did not run).⚠️ CarouselViewTests without fix:XHarness did not produce the expected fresh result 'testResults.xml' for requested class(es) 'Microsoft.Maui.DeviceTests.CarouselViewTests' (the target tests did not run).⚠️ CacheTestCollectionView with fix:XHarness did not produce the expected fresh result 'testResults.xml' for requested class(es) 'Microsoft.Maui.DeviceTests.CacheTestCollectionView' (the target tests did not run).⚠️ CarouselViewTests with fix:XHarness did not produce the expected fresh result 'testResults.xml' for requested class(es) 'Microsoft.Maui.DeviceTests.CarouselViewTests' (the target tests did not run).
📁 Fix files reverted (40 files)
src/Controls/src/Core/Handlers/Items/CarouselViewHandler.iOS.cssrc/Controls/src/Core/Handlers/Items/CollectionViewHandler.Windows.cssrc/Controls/src/Core/Handlers/Items/CollectionViewHandler.iOS.cssrc/Controls/src/Core/Handlers/Items/GroupableItemsViewHandler.Windows.cssrc/Controls/src/Core/Handlers/Items/GroupableItemsViewHandler.iOS.cssrc/Controls/src/Core/Handlers/Items/ItemsViewHandler.iOS.cssrc/Controls/src/Core/Handlers/Items/ReorderableItemsViewHandler.Windows.cssrc/Controls/src/Core/Handlers/Items/ReorderableItemsViewHandler.iOS.cssrc/Controls/src/Core/Handlers/Items/SelectableItemsViewHandler.Windows.cssrc/Controls/src/Core/Handlers/Items/SelectableItemsViewHandler.iOS.cssrc/Controls/src/Core/Handlers/Items/StructuredItemsViewHandler.Windows.cssrc/Controls/src/Core/Handlers/Items/StructuredItemsViewHandler.iOS.cssrc/Controls/src/Core/Handlers/Items/iOS/CarouselTemplatedCell.cssrc/Controls/src/Core/Handlers/Items/iOS/CarouselViewController.cssrc/Controls/src/Core/Handlers/Items/iOS/CarouselViewDelegator.cssrc/Controls/src/Core/Handlers/Items/iOS/CarouselViewLayout.cssrc/Controls/src/Core/Handlers/Items/iOS/DefaultCell.cssrc/Controls/src/Core/Handlers/Items/iOS/GridViewLayout.cssrc/Controls/src/Core/Handlers/Items/iOS/GroupableItemsViewController.cssrc/Controls/src/Core/Handlers/Items/iOS/GroupableItemsViewDelegator.cssrc/Controls/src/Core/Handlers/Items/iOS/HeightConstrainedTemplatedCell.cssrc/Controls/src/Core/Handlers/Items/iOS/HorizontalDefaultCell.cssrc/Controls/src/Core/Handlers/Items/iOS/HorizontalDefaultSupplementalView.cssrc/Controls/src/Core/Handlers/Items/iOS/ItemsViewCell.cssrc/Controls/src/Core/Handlers/Items/iOS/ItemsViewController.cssrc/Controls/src/Core/Handlers/Items/iOS/ItemsViewDelegator.cssrc/Controls/src/Core/Handlers/Items/iOS/ItemsViewLayout.cssrc/Controls/src/Core/Handlers/Items/iOS/LayoutAttributesChangedEventArgs.cssrc/Controls/src/Core/Handlers/Items/iOS/ListViewLayout.cssrc/Controls/src/Core/Handlers/Items/iOS/ReorderableItemsViewController.cssrc/Controls/src/Core/Handlers/Items/iOS/ReorderableItemsViewDelegator.cssrc/Controls/src/Core/Handlers/Items/iOS/SelectableItemsViewController.cssrc/Controls/src/Core/Handlers/Items/iOS/SelectableItemsViewDelegator.cssrc/Controls/src/Core/Handlers/Items/iOS/StructuredItemsViewController.cssrc/Controls/src/Core/Handlers/Items/iOS/TemplatedCell.cssrc/Controls/src/Core/Handlers/Items/iOS/VerticalDefaultCell.cssrc/Controls/src/Core/Handlers/Items/iOS/VerticalDefaultSupplementalView.cssrc/Controls/src/Core/Handlers/Items/iOS/WidthConstrainedTemplatedCell.cssrc/Controls/src/Core/Hosting/AppHostBuilderExtensions.cssrc/Templates/src/templates/maui-mobile/MauiProgram.cs
📋 Pre-Flight — Context & Validation
PR #38049 Pre-Flight
PR context
- Title:
[net11.0] Obsolete legacy CollectionView handler APIs - Base:
net11.0at merge base14797cb136 - Materialized review commit:
c92e7f5868 - Target platform for STEP 5a: iOS
- Scope: API lifecycle change; there is no linked bug issue.
The PR marks public APIs that belong exclusively to superseded CollectionView/CarouselView implementations as obsolete while preserving the runtime legacy implementations and their compatibility switches. The platform boundary matters:
- iOS and Mac Catalyst default to Items2 for both CollectionView and CarouselView.
- Windows defaults to Items2 only for CollectionView; Items remains the feature-switch fallback, while Windows CarouselView still uses Items.
- Android and Tizen continue to use Items.
- Items2 still consumes selected Items source/native/helper infrastructure, so those shared APIs must not be made obsolete merely because they live under
Handlers/Items.
Existing fix inspected
The PR changes 54 files (239 additions, 66 deletions). Its production strategy is:
- Put normal warning-level
[Obsolete]attributes on platform-specific partial declarations: 27 public legacy types on iOS/Mac Catalyst and the five CollectionView-specific legacy handler types on Windows. - Give each warning platform-specific migration guidance, naming an Items2 replacement where one exists and an Items2/
UICollectionViewLayoutpattern for legacy extension points without a one-to-one replacement. - Add narrowly scoped
CS0618suppressions only where the retained legacy implementation inherits from or instantiates its own obsolete APIs, and around intentional compatibility registration. - Leave runtime registration and feature-switch behavior intact.
- Switch general Apple device-test setup to Items2 while retaining explicit CV1 compatibility coverage.
- Remove the obsolete Windows V1 mapper customization from the .NET 11 sample template and correct handler-detection guidance.
The diff deliberately leaves active the Items APIs reused by Items2, including IItemsViewSource, IObservableItemsViewSource, ILoopItemsViewSource, MauiCollectionView, IndexPathHelpers, and ScrollToPositionExtensions, plus internal shared helpers.
Test contract
The prior gate is already complete and must not be re-run. It was INCONCLUSIVE, not a product failure: XHarness produced no fresh testResults.xml, so neither selector actually ran. Preserve gate/content.md.
Use only these detected iOS device-test commands for each candidate:
# Primary
pwsh .github/skills/run-device-tests/scripts/Run-DeviceTests.ps1 -Project Controls -Platform ios -TestFilter "CacheTestCollectionView"
# Mandatory regression
pwsh .github/skills/run-device-tests/scripts/Run-DeviceTests.ps1 -Project Controls -Platform ios -TestFilter "Category=CarouselView"Do not run a full suite. Each candidate has one implementation/test pass and at most one focused correction followed by a retest of the affected selector(s). A simulator/XHarness/setup failure is Blocked, not Pass.
The gate also identified dropped test coverage outside these bounded selectors: portions of CollectionViewTests, MemoryTests, NavigationPageTests, ShellTests, and VisualElementTreeTests. Record that limitation; do not expand STEP 5a into those suites.
Baseline and edit boundary
EstablishBrokenBaseline.ps1 identified the following 40 fix files. After the skill establishes its own baseline, .github/.baseline-state.json is authoritative and only files in its RevertedFiles array may be edited:
- Apple legacy handler roots:
CarouselViewHandler.iOS.cs,CollectionViewHandler.iOS.cs,ItemsViewHandler.iOS.cs,StructuredItemsViewHandler.iOS.cs,SelectableItemsViewHandler.iOS.cs,GroupableItemsViewHandler.iOS.cs, andReorderableItemsViewHandler.iOS.cs. - Windows legacy CollectionView roots:
CollectionViewHandler.Windows.cs,StructuredItemsViewHandler.Windows.cs,SelectableItemsViewHandler.Windows.cs,GroupableItemsViewHandler.Windows.cs, andReorderableItemsViewHandler.Windows.cs. - Apple legacy implementation files under
src/Controls/src/Core/Handlers/Items/iOS/:CarouselTemplatedCell.cs,CarouselViewController.cs,CarouselViewDelegator.cs,CarouselViewLayout.cs,DefaultCell.cs,GridViewLayout.cs,GroupableItemsViewController.cs,GroupableItemsViewDelegator.cs,HeightConstrainedTemplatedCell.cs,HorizontalDefaultCell.cs,HorizontalDefaultSupplementalView.cs,ItemsViewCell.cs,ItemsViewController.cs,ItemsViewDelegator.cs,ItemsViewLayout.cs,LayoutAttributesChangedEventArgs.cs,ListViewLayout.cs,ReorderableItemsViewController.cs,ReorderableItemsViewDelegator.cs,SelectableItemsViewController.cs,SelectableItemsViewDelegator.cs,StructuredItemsViewController.cs,TemplatedCell.cs,VerticalDefaultCell.cs,VerticalDefaultSupplementalView.cs, andWidthConstrainedTemplatedCell.cs. src/Controls/src/Core/Hosting/AppHostBuilderExtensions.cssrc/Templates/src/templates/maui-mobile/MauiProgram.cs
The worktree contains unrelated, pre-existing modifications under .github/scripts, .github/skills, and eng/scripts. They are not part of this PR candidate work and must remain untouched. Restoration must use only:
pwsh .github/scripts/EstablishBrokenBaseline.ps1 -RestoreCandidate requirements
Each attempt must propose one mechanism-level alternative to the existing platform-partial obsolescence strategy, preserve platform correctness and compatibility, perform the inline MAUI expert self-review required by try-fix, capture all required artifacts, and restore the baseline before returning. Candidate 2 must also avoid Candidate 1's recorded mechanism and must not reopen or rerun Candidate 1.
🔬 Code Review — Deep Analysis
Expert Code Review — PR #38049
Verdict
NEEDS_DISCUSSION
Confidence: low
The submitted change is mechanically sound on code inspection, and the expert review found no actionable file:line defect. Confidence remains low because the trusted Gate was inconclusive and required-check resolution was unavailable; that evidence gap is not itself a failing fix.
Independent Assessment
The PR adds platform-specific obsolescence warnings to legacy CollectionView and CarouselView handler APIs superseded by Items2 on iOS, Mac Catalyst, and (for CollectionView only) Windows. It retains the Windows feature-switch fallback and explicit legacy-test coverage through narrow CS0618 suppressions, moves general Apple device-test wiring to Items2, removes an obsolete Windows V1 mapper from the sample-content template, and corrects handler-detection guidance.
Findings
No actionable findings. inline-findings.json contains an empty JSON array.
Prior Review Reconciliation
Prior review concerns about warning messages, suppression scope, and Apple coverage intent are addressed in the submitted head. No unresolved prior error-level finding applies to the current diff.
Blast Radius and Failure Modes
- The public warning surface affects consumers that compile against the obsolete platform APIs, but no new runtime path, startup work, static state, subscription, or handler lifecycle behavior is introduced.
- The Windows V1 fallback remains reachable when
RuntimeFeature.IsWindowsCollectionView2HandlerEnabledis disabled. - Default Apple registration and general test wiring remain aligned on Items2, while explicit legacy compatibility coverage remains identifiable.
- No external-tool output classification or Trim/NativeAOT reachability contract is changed.
CI Evidence
The trusted Gate is inconclusive because its validation could not build or run. This is recorded as unverified rather than failed, and gate verification was not rerun.
Reviewer Improvement
The expert review proposed no corrective change, so there is no reviewer patch to apply to the submitted implementation.
🛠️ Try-Fix — Analysis & Comparison
Aggregate Try-Fix Results for PR #38049
Candidate 1 — Registration-boundary obsolescence
Model: gpt-5.3-codex
Result: Blocked
Candidate narrative: CustomAgentLogsTmp/PRState/38049/PRAgent/try-fix-1/content.md
Skill artifacts: CustomAgentLogsTmp/PRState/38049/PRAgent/try-fix/attempt-1
Candidate 1 proposed warning at explicit legacy compatibility registration/opt-in points rather than at every legacy type declaration. This is mechanism-level distinct from the PR, but baseline establishment rejected the unrelated pre-existing dirty worktree and created no edit allow-list, so the candidate made no source changes. Its tests ran against the unchanged PR and cannot validate the proposal. The CacheTestCollectionView selector unexpectedly expanded to 1,348 tests; later work must not repeat that broad execution.
Candidate 1 diff
# Empty: baseline blocked implementation.Candidate 2 — Consumer-side legacy API analyzer
Model: gpt-5.6-sol
Result: Blocked
Candidate narrative: CustomAgentLogsTmp/PRState/38049/PRAgent/try-fix-2/content.md
Skill artifacts: CustomAgentLogsTmp/PRState/38049/PRAgent/try-fix/attempt-2
Candidate 2 proposed a platform-aware Roslyn analyzer that diagnoses semantic references to the legacy types. Unlike the PR's declaration metadata, this would not make retained implementation symbols obsolete; unlike Candidate 1's registration boundary, it would cover direct construction, derivation, and other symbol uses. Baseline establishment again produced no edit allow-list. More fundamentally, the analyzer requires new project/source and packaging files outside the baseline boundary, so the mechanism is infeasible within STEP 5a. It made no source changes and correctly skipped both test launches.
Candidate 2 diff
# Empty: baseline and file-boundary constraints blocked implementation.Aggregate conclusion
Two candidates were attempted, in the required model order, and no further candidates were launched. Both are distinct from the PR and from each other, but neither produced a safely restorable implementation:
| Candidate | Alternative mechanism | Result | Key blocker |
|---|---|---|---|
| 1 | Warn at legacy registration/opt-in boundaries | Blocked | No baseline allow-list; direct public type use may bypass the warning |
| 2 | Consumer-side platform-aware Roslyn analyzer | Blocked | No baseline allow-list; requires new analyzer/package files outside the allowed boundary |
The existing PR's platform-specific [Obsolete] declarations remain the only evaluated mechanism that supplies compiler warnings for direct public API use using the files available to this bounded try-fix phase. This aggregate does not claim that the existing PR is verified: the prior gate remains INCONCLUSIVE, and Candidate 1's successful test commands ran unchanged PR code rather than a candidate.
🏁 Report — Final Recommendation
✅ Final Recommendation: APPROVE
Winning candidate
Winner: pr
The raw submitted PR is the only implemented, reviewable solution and the expert review found no actionable code defect. pr-plus-reviewer is implementation-equivalent because there was no reviewer feedback to apply, while both STEP 5a alternatives were blocked before producing source changes.
Comparative ranking
| Rank | Candidate | Implementation | Regression evidence | Assessment |
|---|---|---|---|---|
| 1 | pr |
Complete 54-file platform-specific obsolescence change | Trusted Gate INCONCLUSIVE; no test failure established |
Best coverage with the least mechanism complexity; expert review found no actionable issue |
| 2 | pr-plus-reviewer |
Identical to pr; empty reviewer.patch |
Not run because no reviewer change was applied | Correct but offers no improvement over the submitted fix |
| 3 | try-fix-2 |
Blocked; empty diff | Both selectors correctly skipped | A semantic analyzer could cover direct symbol use, but requires new analyzer and packaging surfaces outside the bounded change and is substantially more complex |
| 4 | try-fix-1 |
Blocked; empty diff | Results came from unchanged PR code and do not validate the proposal | Registration-boundary warnings can be bypassed by direct construction, inheritance, and other public type references |
No candidate has a valid regression-test failure or a valid candidate-specific pass. Candidate 1's CacheTestCollectionView command expanded to 1,348 tests and its four CarouselView tests ran against unchanged PR code; Candidate 2 made no change and launched neither selector. The ranking therefore does not misclassify blocked or infrastructure outcomes as product failures.
Why pr wins
- Platform-specific partial declarations give compiler warnings at every relevant public type use without incorrectly warning Android, Tizen, shared Items infrastructure consumed by Items2, or Windows CarouselView APIs that remain active.
- The Windows CollectionView V1 feature-switch fallback and explicit legacy compatibility tests remain available through narrowly scoped
CS0618suppressions. - General Apple device-test registration follows the default Items2 runtime path, while explicit V1 compatibility coverage remains identifiable.
- Removing the Windows V1 sample-template mapper matches the default
ItemsView-based handler, and the handler-detection guidance now reflects the iOS/Mac Catalyst and Windows split. - The regression cross-reference found no overlap with recent labeled bug-fix removals, and the single expert pass produced
[]inline findings.
Validation and residual uncertainty
The trusted Gate is INCONCLUSIVE: XHarness did not produce fresh results, so the requested iOS selectors did not establish pass or fail. It also identified unverified coverage in portions of CollectionView, memory, navigation, Shell, and visual-tree device tests. Per the supplied gate contract, this environment outcome is non-blocking and is not a reason by itself to request changes.
The expert evaluation's low-confidence NEEDS_DISCUSSION label reflects that missing authoritative validation evidence, not a code-level error or unresolved discussion item. On the implementation merits, the raw PR remains preferable to both unimplemented alternatives and the no-op reviewer candidate.
📱 UI Tests — CollectionView
Detected UI test categories: CollectionView
✅ Deep UI tests — 428 passed, 0 failed, 5 skipped across 1 category on platform-pool agent (replaces in-process counts above).
🧪 UI Test Execution Results (deep, platform pool)
| Category | Tests | Snapshot diffs |
|---|---|---|
CollectionView |
428/433 (5 skipped) ✓ | — |
📎 Download drop-deep-uitests artifact (TRX + snapshot diffs) |
🧭 Next Steps — review latest findings
No alternative fix was selected for this run. Review the session findings and CI results before merging.
There was a problem hiding this comment.
🔵 Needs a closer look
It touches a broad set of platform-specific handler APIs and test wiring across multiple targets, making it better suited for final human validation before approval.
Review details
- Files reviewed: 54/54 changed files
- Comments generated: 0 new
- Review effort level: Lite
<!-- 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 of Change This PR is stacked on #38049 and removes the remaining iOS/Mac Catalyst CollectionView and CarouselView V1 test coverage. The Apple V1 handler is obsolete, will receive no further fixes, and its dedicated test coverage is flaky and time-consuming. The change: - removes the dedicated iOS CollectionView V1 and CarouselView V1 UI-test stages and filters; - removes Apple `TEST_CONFIGURATION_ARGS=CollectionView1` handler switching, `CollectionView1`/`CarouselView1` controls, and their obsolete-warning suppressions; - deletes the V1-only iOS cache device test and disabled legacy `VerticalCell` leak test; - migrates general CarouselView and CollectionView host fixtures to the default Apple Items2 handlers; - removes the Apple-only Issue 25433 V1 snapshot coverage while preserving its Android Items test; and - keeps Items types still consumed by Items2, including item-source, index-path, template, snap, scroll, reorder, and `MauiCollectionView` infrastructure. ### Coverage audit | Removed Apple V1 coverage | Disposition | Replacement / rationale | |---|---|---| | Dedicated `ios_ui_tests_coreclr_cv1` CollectionView lane | **(a) Equivalent Items2 test exists** | The normal iOS lane runs the same `CollectionView` category with Items2. | | Dedicated `ios_ui_tests_coreclr_carv1` CarouselView lane | **(a) Equivalent Items2 test exists** | The normal iOS lane runs the same `CarouselView` category with Items2. | | Host `CollectionView1` / `CarouselView1` controls and environment switch | **(a)/(b) Removed or migrated** | Dedicated V1 selection is removed; explicit `CollectionView2` / `CarouselView2` fixtures remain. | | `EnsureCellSizesAreCached` and its custom handler/controller/delegator | **(c) V1 implementation-specific** | It introspected the legacy flow-layout cache through `ReorderableItemsViewHandler`, `ItemsViewController`, and `ItemsViewDelegator`. | | Disabled `CellsDoNotLeak` device test | **(c) V1 implementation-specific** | It directly constructed the legacy `VerticalCell`; current Apple handler/controller leak tests cover Items2. | | Carousel gallery next/previous and loop navigation tests | **(b) Migrated to Items2 in this PR** | `CarouselViewCoreGalleryPage` now uses standard `CarouselView`; these tests pass in the normal Apple lane. | | `CarouselViewSetPosition` and `CarouselViewKeepPositionChangingOrientation` | **(d) Apple Items2 coverage gap** | UI CI confirmed Items2 still reports position `0` instead of `3` and loses the visible item after rotation. Android Items coverage remains; Apple execution is excluded pending an Items2 fix. | | `CarouselViewUpdateCurrentItem` host fixture | **(b)/(d) Migrated to Items2; Apple execution needs follow-up** | The page now uses standard `CarouselView`; Android Items coverage remains, while Apple execution is excluded for open CV2 regression #29312. | | Issue 25433 horizontal-grid spacing test and three Apple snapshots | **(c) V1 implementation-specific** | Its fix (#25825) changed only `Handlers/Items/iOS`. Android Items coverage and snapshots remain. | | Issue 26066 CV1 comparison fixture | **(a) Equivalent Items2 test exists** | `CollectionView2ShouldFindAncestorType` continues to validate the Items2 scenario. | | Issue 27711 dedicated-lane CV1 execution | **(a) Equivalent Items2 test exists** | The normal Apple lane continues `RightToLeftFlowDirectionShouldWork` with Items2. | Categories: **(a)** equivalent Items2 coverage, **(b)** migrated to Items2 here, **(c)** V1 implementation-specific and intentionally removed, **(d)** possible coverage gap. ### Needs follow-up investigation - **(d) `CarouselViewUpdateCurrentItem.Issue9827Test`:** the host fixture now targets Items2, but the Appium test is restricted to Android while open CV2 regression #29312 is unresolved. Android Items coverage remains; Apple coverage needs to be re-enabled when #29312 is fixed. - **(d) `CarouselViewSetPosition` and `CarouselViewKeepPositionChangingOrientation`:** the Items2 host migration exposed failing Apple behavior in UI CI. Both remain enabled for Android Items and are excluded on iOS/Mac Catalyst until the Items2 behavior is fixed. ### Windows CV1 preserved - [x] `build_ui_tests_windows_cv1` and `winui_ui_tests_cv1` remain in `eng/pipelines/common/ui-tests.yml`. - [x] `useWindowsCV1`, `UseWindowsCV1:true`, and the `ui-tests-samples-windows-cv1` artifact flow remain in the UI-test templates. - [x] `UITest.cs` still maps Windows CV1 runs to the `windows-cv1` snapshot environment. - [x] All 70 baselines under `src/Controls/tests/TestCases.WinUI.Tests/snapshots/windows-cv1/` remain. - [x] Windows CollectionView V1 device tests, handler aliases, and feature-switch plumbing are unchanged. - [x] No Windows or WinUI file is removed or modified by this PR. ### Validation - Built `Controls.DeviceTests` for `net11.0-ios` and `net11.0-maccatalyst` with `CS0618` treated as an error. - Built `Controls.TestCases.HostApp` for `net11.0-ios` and `net11.0-maccatalyst` with `CS0618` treated as an error. - Built the iOS, Mac Catalyst, and Android Appium test projects with `CS0618` treated as an error. - Parsed `eng/pipelines/common/ui-tests.yml` successfully. - Confirmed no Apple V1 handler fixture, selector, dedicated stage, or legacy controller/cell reference remains in Apple test code. - Confirmed shared Items helpers used by Items2 and all Windows CV1 selectors/snapshots remain. ### Issues Fixed N/A --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Co-authored-by: Jakub Florkowski <kubaflo123@gmail.com>
…38728) <!-- 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! ### Issue Details After PR #38049, the SwipeViewTests device tests report a CS0618 obsolete warning for CollectionViewHandler on iOS and Mac Catalyst. The test explicitly registers the legacy CollectionViewHandler, which is now marked obsolete on these platforms. ### Root Cause PR #38049 marked the legacy CollectionViewHandler as obsolete on iOS and Mac Catalyst because CollectionViewHandler2 is used on these platforms. The SwipeViewTests setup still registers CollectionViewHandler for all platforms, which results in a CS0618 warning on iOS and Mac Catalyst. ### Description of Change Updated the CollectionViewHandler registration in SwipeViewTests to use CollectionViewHandler2 on iOS and Mac Catalyst, while retaining the existing CollectionViewHandler for other platforms. Added a Windows-specific warning suppression since the legacy handler is intentionally used for Windows coverage. **Reference:** https://github.com/dotnet/maui/blob/net11.0/src/Controls/tests/DeviceTests/Elements/NavigationPage/NavigationPageTests.cs#L97 ### Issues Fixed Fixes #38726 ### Output |Before|After| |--|--| | <img width="1500" height="200" alt="image" src="https://github.com/user-attachments/assets/5d896b6f-1a44-4d85-9929-3b1b6f526090" /> | <img width="900" height="100" alt="image" src="https://github.com/user-attachments/assets/b2e3a7bc-f368-4912-9689-6bab92109b5d" /> |
<!-- 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! ### Issue Details CollectionViewHandler should not be marked as obsolete on Windows in .NET 11. ### Description of change Reverted the CV1 obsoletion changes for Windows introduced in PR #38049. CV2 is introduced for CollectionView on Windows in .NET 11. CV1 (CollectionViewHandler) will continue to be supported on Windows for now instead of being marked as obsolete in the same release. The CV1 handler will remain available for existing applications and can be marked as obsolete in a future release.
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!
Description of Change
Marks the public APIs belonging exclusively to the legacy CollectionView/CarouselView handler implementations as obsolete on platforms where Items2 supersedes them. The attributes remain normal compiler warnings, identify the affected platform, and provide Items2 migration guidance. Runtime handler registration and feature-switch behavior are unchanged.
General iOS and Mac Catalyst device-test coverage now uses Items2, matching the default runtime path. Explicit CV1 compatibility tests and CI lanes remain in place during the obsolescence period.
The sample-content template no longer configures the obsolete Windows V1
CollectionViewHandler. That accessibility workaround targetedListViewBase.SingleSelectionFollowsFocus; the default CollectionView2 handler uses WinUIItemsView, so the V1 mapper was both obsolete and ineffective for generated .NET 11 projects.This PR also corrects the handler-detection guidance, which still said Items2 was iOS-only even though .NET 11 includes a Windows CollectionView2 implementation.
How the API boundary was determined
The
Handlers/Itemsdirectory cannot be treated as uniformly legacy. I classified types using two pieces of implementation evidence:AppHostBuilderExtensions.AddControlsHandlersidentifies which stack is active for each platform and control.That produced this platform matrix:
IsWindowsCollectionView2HandlerEnabledAPIs made obsolete
iOS and Mac Catalyst: 27 public types
ItemsViewHandler<TItemsView>,StructuredItemsViewHandler<TItemsView>,SelectableItemsViewHandler<TItemsView>,GroupableItemsViewHandler<TItemsView>,ReorderableItemsViewHandler<TItemsView>,CollectionViewHandler, andCarouselViewHandler.ItemsViewController<TItemsView>,StructuredItemsViewController<TItemsView>,SelectableItemsViewController<TItemsView>,GroupableItemsViewController<TItemsView>,ReorderableItemsViewController<TItemsView>, andCarouselViewController.ItemsViewDelegator<TItemsView, TViewController>,SelectableItemsViewDelegator<TItemsView, TViewController>,GroupableItemsViewDelegator<TItemsView, TViewController>,ReorderableItemsViewDelegator<TItemsView, TViewController>, andCarouselViewDelegator.ItemsViewCell,DefaultCell,TemplatedCell,CarouselTemplatedCell, andLayoutAttributesChangedEventArgs.ItemsViewLayout,ListViewLayout,GridViewLayout, andCarouselViewLayout.Windows: 5 public types
CollectionViewHandler.StructuredItemsViewHandler<TItemsView>,SelectableItemsViewHandler<TItemsView>,GroupableItemsViewHandler<TItemsView>, andReorderableItemsViewHandler<TItemsView>hierarchy.The attributes are placed on platform-specific partial declarations. This avoids producing incorrect warnings for the same Items handler symbols on Android, Tizen, or framework-neutral targets.
APIs deliberately kept active
ItemsViewHandler<TItemsView>andCarouselViewHandler, because CarouselView still depends on them.CollectionView,CarouselView,ItemsView, item layouts, and related control APIs).IItemsViewSource,IObservableItemsViewSource,ILoopItemsViewSource,MauiCollectionView,IndexPathHelpers, andScrollToPositionExtensions.Comparison with #37990
After the initial implementation, I compared this PR with #37990 and adopted two useful patterns:
CollectionViewHandler2/CarouselViewHandler2, and the CV1-only duplicate of the reset/animation test was removed.I intentionally did not copy #37990 wholesale:
[Obsolete]warns before removal but the implementation and feature-switch paths still work.IndexPathHelpers/item-source tests along with other V1 tests. Those APIs remain shared dependencies used by Items2, so their coverage stays here.Migration messages and internal compilation
Where Items2 exposes a public one-to-one replacement, the obsolete message names it directly. Legacy layout and cell extension points without a public one-to-one V2 type instead point developers to the Items2 handler/
UICollectionViewLayoutpattern.The legacy implementation necessarily references its own newly obsolete public bases. Those internal inheritance declarations have narrowly scoped
CS0618suppressions. The same narrow treatment is used for:CollectionView1/CarouselView1configurations.Consumer uses remain unsuppressed and receive the migration warnings.
Validation
Succeeded locally:
dotnet build Microsoft.Maui.BuildTasks.slnf -v:minimaldotnet build src/Controls/src/Core/Controls.Core.csproj -f net11.0-ios26.5 --no-restore -v:minimaldotnet build src/Controls/src/Core/Controls.Core.csproj -f net11.0-maccatalyst26.5 --no-restore -v:minimaldotnet build src/Controls/src/Core/Controls.Core.csproj -f net11.0-android37.0 --no-restore -v:minimaldotnet build src/Controls/tests/DeviceTests/Controls.DeviceTests.csproj -f net11.0-ios -warnaserror:CS0618 -v:minimaldotnet build src/Controls/tests/DeviceTests/Controls.DeviceTests.csproj -f net11.0-maccatalyst --no-restore -warnaserror:CS0618 -v:minimaldotnet build src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj -f net11.0-ios -v:minimaldotnet build src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj -f net11.0-maccatalyst -v:minimaldotnet build src/Templates/src/Microsoft.Maui.Templates.csproj --restore --verbosity:minimalThe Windows cross-build was attempted from macOS. Restore succeeded, but native Windows SDK tools (
MakePri.exeandXamlCompiler.exe) cannot execute on this host. Windows CI therefore remains the authoritative compile validation for the platform-specific attribute declarations, fallback suppression, and generated sample-content project.No PublicAPI file changes were required by the analyzers during the Apple platform builds.
Issues Fixed
N/A - this is an API lifecycle change for the .NET 11 handler transition, not a fix for a tracked bug.