Repository navigation
Conversation
Co-authored-by: Andres Pineda <[email protected]>
Co-authored-by: Andres Pineda <[email protected]>
Co-authored-by: Andres Pineda <[email protected]>
Co-authored-by: Andres Pineda <[email protected]>
Co-authored-by: Andres Pineda <[email protected]>
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
|
The build 240635 found UI Test snapshots differences: Details
|
|
|
Xiaoy312
left a comment
There was a problem hiding this comment.
Looks good overall. The gesture, loupe and flyout changes hang together well, and the follow-ups listed in the description cover the known gaps. A few non-blocking notes are inline, plus two below that have no line to attach to.
Docs: UseNativeTextLoupe and UseManagedTextLoupe are new public switches, but doc/articles/feature-flags.md (which documents the neighbouring DisableNumberPadPopover) doesn't mention them. Worth adding a short entry for each.
Android: TextBoxCore.OnTouchSelectAllFromFlyout also runs under the Android convention, so Select All from a touch flyout now shows handles and reopens the menu there too. Is that intended? It's an Android behaviour change in an iOS-scoped PR. Also, PasswordBox (not a TextBox) doesn't get it, because of the target is TextBox check in ExecuteSelectAll.
CI: the iOS Skia shard failure is from three tests that fail on master too (When_Automation_Run_Sample_Keeps_Toolbar_Offset, Given_ShellLayout's theme-cleanup test, When_Shared_EventsSource_Changes_...), so it's unrelated. The new iOS tests that ran on that lane all passed.
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
previously blocked on tests that are now fixed/disabled from master:
|
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
|
The build 242559 found UI Test snapshots differences: Details
|
|
|
|
@Xiaoy312 thanks for the review. The fixes for your inline notes are pushed (head 3c45059), and each thread has a reply naming its commit. On the notes in the review body:
Your approval was on 6cbe7fa, so the 11 new commits haven't had a review yet. |
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved issues cause incorrect selection on trailing empty lines, misaligned magnification for default-aligned right-to-left text, and retention of the last TextBox and its DataContext after the shared flyout closes.
3 open issues
What changed in this PR
This PR brings Skia TextBox touch editing closer to native iOS behavior, including gestures, magnification, edit-menu services, and AutoFill. It also preserves keyboard focus when tapping an already-focused field in WebAssembly.
Changes:
- Adds iOS-style caret and selection gestures with native and managed magnifiers.
- Extends touch edit menus and maps input scopes to iOS AutoFill content types.
- Adds runtime regression tests, pointer-cancellation cleanup, and magnifier configuration documentation.
| File | Description |
|---|---|
| src/Uno.UI/UI/Xaml/Controls/TextBoxCore/TextBoxCore.TouchCommands.cs | Adds touch selection commands and selection bounds. |
| src/Uno.UI/UI/Xaml/Controls/TextBoxCore/TextBoxCore.pointers.cs | Implements iOS tap, hold, and caret-drag behavior. |
| src/Uno.UI/UI/Xaml/Controls/TextBoxCore/TextBoxCore.Loupe.cs | Coordinates native and managed magnifiers. |
| src/Uno.UI/UI/Xaml/Controls/TextBoxCore/TextBoxCore.Input.cs | Integrates magnifier cleanup and handle interactions. |
| src/Uno.UI/UI/Xaml/Controls/TextBox/TextBox.Properties.cs | Exposes managed magnifier state for tests. |
| src/Uno.UI/UI/Xaml/Controls/TextBox/TextBox.Overrides.cs | Forwards pointer cancellation to the core. |
| src/Uno.UI/UI/Xaml/Controls/TextBox/TextBox.cs | Forwards pointer exits to cancel pending holds. |
| src/Uno.UI/UI/Xaml/Controls/TextBox/Extensions/ITextCommandBarFlyoutCommandsExtension.cs | Defines platform-provided edit-menu commands. |
| src/Uno.UI/UI/Xaml/Controls/TextBox/Extensions/INativeTextLoupeExtension.cs | Defines the native magnifier interface. |
| src/Uno.UI/UI/Xaml/Controls/TextBlock/TextBlock.cs | Implements the added gripper lifecycle callback. |
| src/Uno.UI/UI/Xaml/Controls/RichEditBox/RichEditBox.uno.cs | Implements the added gripper lifecycle callback. |
| src/Uno.UI/UI/Xaml/Controls/Primitives/TextSelectionGripperPresenter.cs | Notifies hosts when grippers lose their pointers. |
| src/Uno.UI/UI/Xaml/Controls/Primitives/TextBoxTouchLoupe.cs | Provides the managed magnifier fallback. |
| src/Uno.UI/UI/Xaml/Controls/PasswordBox/PasswordBox.Overrides.cs | Forwards pointer cancellation to the shared core. |
| src/Uno.UI/UI/Xaml/Controls/PasswordBox/PasswordBox.cs | Forwards pointer exits to the shared core. |
| src/Uno.UI/UI/Xaml/Controls/CommandBarFlyout/TextCommandBarFlyout.Uno.cs | Adds Select and platform command handling. |
| src/Uno.UI/UI/Xaml/Controls/CommandBarFlyout/TextCommandBarFlyout.mux.cs | Integrates touch commands and Select All handles. |
| src/Uno.UI/UI/Xaml/Controls/CommandBarFlyout/TextCommandBarFlyout.h.mux.cs | Adds the Select command identifier. |
| src/Uno.UI/UI/Xaml/Controls/CommandBarFlyout/Strings/en-us/Resources.resw | Adds English edit-menu labels. |
| src/Uno.UI/Helpers/WinUI/ResourceAccessor.ResourceKeys.cs | Adds resource keys for new commands. |
| src/Uno.UI/FeatureConfiguration.cs | Adds native and managed magnifier switches. |
| src/Uno.UI.RuntimeTests/Microsoft/UI/Xaml/Controls/Given_TextBox.skia.cs | Adds gesture, menu, and magnifier regression tests. |
| src/Uno.UI.Runtime.WebAssembly.Browser/ts/Runtime/BrowserInvisibleTextBoxViewExtension.ts | Guards focused inputs against trailing compatibility clicks. |
| src/Uno.UI.Runtime.AppleUIKit/UI/Xaml/Controls/TextBox/InvisibleTextBoxViewExtension.cs | Connects native magnification and AutoFill. |
| src/Uno.UI.Runtime.AppleUIKit/UI/Xaml/Controls/TextBox/InvisibleTextBoxLoupe.cs | Wraps iOS system magnifier sessions. |
| src/Uno.UI.Runtime.AppleUIKit/UI/Xaml/Controls/TextBox/InputScopeHelper.UIKit.cs | Maps input scopes to native content types. |
| src/Uno.UI.Runtime.AppleUIKit/UI/Xaml/Controls/TextBox/IInvisibleTextBoxView.cs | Exposes the native text content type. |
| src/Uno.UI.Runtime.AppleUIKit/UI/Xaml/Controls/TextBox/AppleUIKitTextFlyoutCommands.cs | Implements iOS text services and anchored popovers. |
| src/Uno.UI.Runtime.AppleUIKit/Hosting/ExtensionsRegistrar.cs | Registers iOS text services outside tvOS. |
| doc/articles/feature-flags.md | Documents magnifier configuration switches. |
Review effort: Balanced
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
|
The build 242958 found UI Test snapshots differences: Details
|
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-25619/docs/index.html |
|
The build 242988 found UI Test snapshots differences: Details
|
|
@Mergifyio backport servicing/6.8 |
✅ Backports have been createdDetails
Cherry-pick of 9c46cf5 has failed: Cherry-pick of 56a23aa has failed: Cherry-pick of 138c921 has failed: Cherry-pick of 73c77a0 has failed: Cherry-pick of 21d7657 has failed: Cherry-pick of e286605 has failed: Cherry-pick of 27ebcf0 has failed: Cherry-pick of 7fc4304 has failed: Cherry-pick of 6d1023e has failed: To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally |
…r-25619 feat(textbox): Follow native iOS touch text editing (backport #25619)
…ress-context-flyout-22229 Conflicts with the iOS touch editing work (unoplatform#25619) and the deferred release handling (unoplatform#25818): - TextBoxCore.pointers.cs: the hold handled in OnHolding now goes through master's iOS path (HandleTouchHold_iOS, once per press with the 0.5 s hold timer) and Android's ToTouchTextPoint; a release after either is not a tap. - InputManager.Pointers.Managed.cs: the release stops the delayed context menu at the start of OnPointerReleasedCore. - Given_TextBox.skia.cs: both new iOS tests kept.
Takes Uno's servicing/6.8 from 6951c2c up to 5254ace (42 pull requests). Conflicts, by area: IME and TextBox (unoplatform#25984, backport of unoplatform#25804; unoplatform#25952, backport of unoplatform#25619; unoplatform#25976, backport of unoplatform#25818) - Takes upstream's composition design (unoplatform#25804): the browser's input is the source of truth for the text, compositions included. This drops the composition parts of the unoplatform#24502 port (90746b8): its TypeScript composition handling, the StartIndex/TextChangePending event arguments, the IsReadOnly forwarding to the hidden input, and its Given_TextBox.BrowserSoftKeyboard tests. - Keeps the non-IME browser fixes on top of it, in the form their master pull requests have on unoplatform#25804: Enter raised once per press and tracked by key code (unoplatform#25174, with Given_TextBox.BrowserEnterKey from master in place of the Enter tests that lived in the dropped file), the iOS refocus on tap (unoplatform#25185), pastes without text and isIOS from BrowserInputHelper. - Moves the unoplatform#26005 MaxLength fixes onto unoplatform#25804's native input path, as master has them: a refused browser edit keeps the TextBox's selection, TextBoxView.UpdateTextFromNative reports whether the edit went in, and the IME keeps its range on the applied text (master be85699, which d226897 had ported onto the unoplatform#24502 IME). Adds that commit's browser and platform-applied IME tests. - TextBox.pointers.skia.cs: upstream's file (unoplatform#25619 iOS touch editing, unoplatform#25818, unoplatform#25804), with the unoplatform#25126 port (the hold acts when it starts, a touch right-tap keeps the caret) in the form master's unoplatform#25126 branch has it on unoplatform#25619, including focusing before the iOS hold timer acts and its iOS not-focusable test. Pointers (unoplatform#25976, backport of unoplatform#25818) - Tapped and RightTapped are raised once the PointerReleased bubbled (unoplatform#25818), with the unoplatform#25732 port's window coordinates (2-argument routed event args, RawPosition for ContextRequested), as master's unoplatform#25732 branch has them. - The release wrapper of unoplatform#25818 keeps the unoplatform#25126 port's StopContextMenuTimer at the start of the release. DependencyObject (unoplatform#26142, backport of unoplatform#26123) - Takes upstream, then the code of unoplatform#25839 (97a2f17), which replaces this branch's unoplatform#25102 ports (800247f, be41da6, fd40bf9, 7546379). DependencyObjectStore.Binder.cs, .alc.cs, Application.Alc.cs, ResourceDictionary.alc.cs and their tests now match unoplatform#25839; this drops 800247f's own SingleParentNonFE_Parent_Removes_Value_Then_Next_Parent_Starts_Clean test, which unoplatform#25839 doesn't have. Imaging (unoplatform#25597, unoplatform#25915, unoplatform#25911, unoplatform#25897) - Keeps this branch's side: it has the later forms of these fixes (unoplatform#25124, unoplatform#25559, unoplatform#25633 and unoplatform#26370 ports), where upstream has the 6.8-only unoplatform#25597 design and earlier snapshots. Upstream's shared download, IgnoreImageCache and failed-load fixes are covered by SharedImageDecode. Adds upstream's When_Source_Outlives_Brushes test. ToolTip (unoplatform#26098, backport of unoplatform#25137 and unoplatform#26096) - Keeps this branch's unoplatform#25137 port and adds unoplatform#26096 in master's form: the service releases only a ToolTip it opened, and leaves one the app opened during the show delay to the app. Keeps both sides' tests. Flyout (unoplatform#26062, backport of unoplatform#26060) - This branch had the same commits already; keeps the "Keep non-resizable flyouts in window" port and its tests. Also removes a helper pair in Given_AccessibleTextBox that both sides added.

GitHub Issue: closes unoplatform/kahua-private#558
PR Type:
✨ Feature
What changed? 🚀
Under
TouchSelectionConvention.iOS, touch text editing in the SkiaTextBoxdidn't match a native iOS text field. This PR makes it follow native iOS behaviour. Most of the work was contributed by @jbourque-kahua; the first five commits are his, split into logical steps. The rest are fixes found while reviewing them.Gestures
ScrollViewer.Loupe
UITextLoupeSession). Hosts without one, such as Safari on iPad and iOS before 17, get an Uno-drawn magnifier.FeatureConfiguration.TextBox.UseNativeTextLoupeandUseManagedTextLoupe. Both default totrue, and both are documented indoc/articles/feature-flags.md.Edit menu
ApiExtensibilityfromUno.UI.Runtime.AppleUIKit.AutoFill
InputScopenow maps toUITextContentTypeon the hidden native text field, so iOS can offer AutoFill (email, phone, name, address, URL, …).WebAssembly on iPad
TextBoxthat already has focus no longer dismisses the keyboard.Fixes on top of the contributed commits
UIReferenceLibraryViewControllerandUIActivityViewController.ITextSelectionGripperHost.OnGripperPointerLost.TextBoxandPasswordBoxnow forwardPointerCanceledandPointerExitedto stop the hold. The drag also captures the touch that pressed, instead of whichever pointer moved last.UnicodeText.GetIndexAtplaced it before the line break, for the mouse too and on every platform, so this one changes shared text hit-testing.TextBlockwidth.DataContext, alive.Validation
When_Touch_LongPress_Drags_Caret_Shows_Managed_Loupe_iOSfailed (shard 3) because the system loupe takes over there. The test now turns the system loupe off. The other new tests passed on iOS, Android, WebAssembly and tvOS. The shard 0 failures were failing on master too, and have since been fixed or disabled there.Uno.UI.Runtime.AppleUIKitbuilds fornet10.0-ios26.0, and SamplesApp builds fornet10.0-desktop.Given_TextBoxtests.Given_TextBox.When_Touch_*,Given_CommandBarFlyout,Given_RichEditBox.When_Touch_*,Given_PasswordBoxand gripper test (102 tests): 102/102.Given_TextBoxclass: everything passes on my machine exceptWhen_Multiline_Pointer_TapandWhen_Pointer_RightClick_Selection, which fail identically on the base commit there and pass on CI.Given_TextBox,Given_TextBlock,Given_UnicodeText,Given_RichEditBox,Given_RichTextBlock,Given_PasswordBox,Given_CommandBarFlyoutand the shared-flyout leak tests: 1501 passed, 11 failed. The same run on the previous head also had 11 failures:When_Touch_Selection_Does_Not_Lock_ScrollViewer_iOSfailed intermittently because of this PR.Known follow-ups, not in this PR
x-web-search://URL scheme, which Apple doesn't document.InputScopechanges during editing.PR Checklist ✅
Screenshots Compare Test Runresults.🤖 Generated with Claude Code