Repository navigation
fix(nsgotest): move native selections on phone targets - #1968
Merged
Merged
Conversation
This was referenced Nov 22, 2026
Collaborator
Author
|
Reviewed. iOS (UITextInput), Android (InputConnection.setSelection) and HarmonyOS (controller plus onTextSelectionChange) test hosts now move the real native selection in UTF-16 units and the model takes the range the host reads back; the shared keys fixture covers emoji/combining-mark ranges, clamping and copy/paste, and targets without a native path now skip instead of moving only the model. Rebased onto main (docs and roadmap conflicts only). HarmonyOS remains device-unverified as the docs say. |
houko
force-pushed
the
fix/native-select-1353
branch
from
November 22, 2026 14:37
8b8beb7 to
2f19efb
Compare
houko
enabled auto-merge
November 22, 2026 14:37
houko
force-pushed
the
fix/native-select-1353
branch
from
November 22, 2026 14:47
2f19efb to
0cbbe71
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
app.Selectnow moves the native focused field on iOS, Android and HarmonyOS target tests. Previously these targets changed only the test model; addingOnSelectionChangeskipped the test, and typing still acted on the native field's old caret.The optional
testhost.TextSelectionSurfaceuses UIKitUITextInput, AndroidInputConnection, and HarmonyOS's existingTextInputControllerpath. It returns the actual native range so fields without an application callback also keep the model correct. UTF-16 ranges are clipped and ordered before reaching the host. HarmonyOS waits for its real selection callback, and its test typing replaces that reported range and places the native caret afterward. Desktop/web editing-key selection remains in place.Refs #1353. The issue stays open: HarmonyOS device validation and its test host's existing lack of native clipboard editing keys are retained in the roadmap. This PR does not add that separate clipboard implementation.
Targets
core,base,ui,tsx, thensgotool)Screenshots
None. These are native test-driver actions, covered by text/range/callback assertions.
Verification
go tool nsgo check(host and dev client).go tool nsgo test ./nsgotest: 169 passed, 1 existing skip;go tool nsgo test ./internal/testhost: 3 passed.go tool nsgo check -target ios_simulator,android,harmonyos,web -jobs 2.nsgotest: delayed native bridge callback/readback and replacement typing, input configuration and press routing, 3 passed. The bridge regression waits for a delayed callback instead of manufacturing a test-model selection.No HarmonyOS target or SDK is available locally, so no HarmonyOS native device/emulator validation was performed. Physical iPhone/Android devices were not used. The Android runtime was rebuilt locally to run the new test-agent operation; only Java source is committed, with DEX/JAR updates left to the repository's runtime workflow. This task's isolated iOS simulator and Android emulator/AVD were removed afterward.
Checklist