SwipeItems: Implement vector compatibility methods - #23885
SwipeItems: Implement vector compatibility methods#23885morning4coffe-dev wants to merge 4 commits into
Conversation
|
Claude finished @morning4coffe-dev's task in 3m 6s —— View job Code Review
SummaryThe implementation is correct overall: 3 issues found — 1 minor bug, 2 convention gaps:
Details (see inline comments):
|
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-23885/wasm-skia-net9/index.html |
|
Claude finished @morning4coffe-dev's task in 3m 17s —— View job Code Review
SummaryAll four findings from the previous review pass on this commit.
No new issues found. Implementation logic is correct:
Ready to ship. |
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-23885/wasm-skia-net9/index.html |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Claude encountered an error after 0s —— View job I'll analyze this and get back to you. |
|
Claude encountered an error after 0s —— View job I'll analyze this and get back to you. |
There was a problem hiding this comment.
Pull request overview
This PR implements Uno-only compatibility implementations for SwipeItems.First, GetMany, and ReplaceAll (previously throwing), while hiding them from IntelliSense and ensuring vector-change notifications are raised consistently (notably for Remove and ReplaceAll). It also adds focused runtime-test coverage for these compatibility behaviors.
Changes:
- Implement
SwipeItems.First,GetMany, andReplaceAllas Uno compatibility methods and hide them via[EditorBrowsable(Never)]+[Obsolete]. - Route
SwipeItems.Remove(SwipeItem)throughRemoveAtto ensureVectorChangedis raised. - Add runtime tests validating method hiding, functional behavior, Execute-mode validation behavior, and vector change notifications.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeItems.Uno.cs | Updates Remove to trigger vector notifications via RemoveAt. |
| src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeItems.h.cs | Implements and hides compatibility vector methods (First, GetMany, ReplaceAll). |
| src/Uno.UI.RuntimeTests/MUX/Windows_UI_Xaml_Controls/SwipeControl/SwipeItemsTests.cs | Adds runtime tests for compatibility APIs, including visibility and notification behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| using System; | ||
| using System.ComponentModel; | ||
| using System.Linq; | ||
| using System.Reflection; | ||
| using Microsoft.UI.Xaml.Controls; | ||
|
|
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-23885/wasm-skia-net9/index.html |
|
Claude finished @morning4coffe-dev's task in 9m 38s —— View job Code Review
SummaryVerdict: ready to ship. All prior review findings were addressed and no new issues are found. The implementation is correct:
Regarding the Copilot inline comment (line 9 of This is a false positive.
|
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 838452d3-d864-4283-8690-7260d18c0672
|
Claude finished @morning4coffe-dev's task in 3m 16s —— View job Code Review
|
| Area | Status |
|---|---|
First / GetMany / ReplaceAll implementation |
✅ Correct |
[EditorBrowsable(Never)] + [Obsolete] decoration |
✅ Correct |
Remove → RemoveAt routing for VectorChanged |
✅ Correct |
Execute-mode guard preserved and tested |
✅ Correct |
VectorChangedEventArgs accessibility (internal via InternalsVisibleTo) |
✅ Correct |
Test naming (Given_ / When_) |
✅ Correct |
[GitHubWorkItem] on all 6 tests |
✅ Correct |
VectorChanged asserted after ReplaceAll |
✅ Correct |
Enumerator invalidation by ReplaceAll |
✅ Correct (new tests) |
Missing using Private.Infrastructure; (Copilot, prior review) |
✅ False positive — confirmed not needed |
No new issues found.
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-23885/wasm-skia-net9/index.html |
| @@ -0,0 +1,185 @@ | |||
| // Copyright (c) Microsoft Corporation. All rights reserved. | |||
There was a problem hiding this comment.
wait, are these tests actually part of winui code?
| namespace Uno.UI.RuntimeTests.MUX.Windows_UI_Xaml_Controls.SwipeControl; | ||
|
|
||
| [TestClass] | ||
| public class Given_SwipeItems |
There was a problem hiding this comment.
pick a lane: typename and filename shouild be consistent
| [PlatformCondition(ConditionMode.Exclude, RuntimeTestPlatforms.NativeWinUI)] | ||
| public void When_CompatibilityVectorMethodsAreHidden() | ||
| { | ||
| #if HAS_UNO |
There was a problem hiding this comment.
instead of doing this on every method
maybe rename file to SwipeItemsTests.Compatibility.cs (& make the class partial)
and just wrap the entire file in #if HAS_UNO

GitHub Issue: closes #23882
Fixes #23882
PR Type:
🐞 Bugfix
What changed? 🚀
Implements the throwing
SwipeItems.First,GetMany, andReplaceAllcompatibility methods while hiding the non-projected APIs from IntelliSense. It also preservesSwipeMode.Executevalidation and routes projected removal through the vector notification path.PR Checklist ✅
Source fidelity status
Compared against
microsoft-ui-xamlmain commitb8cfb849061c00df624ebb29ac4727b9e58ea99c. WinUI still leavesFirst,GetMany, andReplaceAllas native TODO stubs, and these methods are not part of the projected C# API. This PR therefore remains draft as an Uno compatibility implementation rather than a literal WinUI3 port.