fix(android): include the from point in input.swipe - #42353
Closed
Ayaan Gazali (ayaangazali) wants to merge 1 commit into
Closed
fix(android): include the from point in input.swipe#42353Ayaan Gazali (ayaangazali) wants to merge 1 commit into
Ayaan Gazali (ayaangazali) wants to merge 1 commit into
Conversation
swipe(from, segments, steps) documents from as the point to start swiping from, and segments as the points following it, but only segments reached the driver, so the gesture actually began at segments[0]. The channel has no from field, so prepending it to segments keeps the protocol and the device driver unchanged. drag() already forwards its own from, which is why this one stood out.
|
Heads-up: this duplicates #42349, which makes the identical change (segments: [from, ...segments]) and additionally ships a regression test (\ ests/android/input.spec.ts). That PR is already approved and currently has active follow-up on CI flakiness of the new test. Suggest consolidating on #42349 to avoid conflicting merges — the explanatory comment added here would still be a nice addition over there. |
Author
|
You are right, thanks for catching it. #42349 predates this by most of a day, makes the same change, adds the regression test this one lacks, and is already approved. That one should land. Closing this. My mistake for not checking open PRs before opening it. |
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.
Rationale
input.swipe(from, segments, steps)documentsfromas "The point to start swiping from", andsegmentsas "Points following thefrompoint in the swipe gesture". Onlysegmentsever reachedthe driver, so the gesture actually started at
segments[0]and the caller'sfromwas discarded:inputSwipeinprotocol/spec/android.yml:172has nofromfield, and the driver builds itsPoint[]fromsegmentsalone before callingUiDevice.swipe.drag(from, to, steps)four linesbelow does forward its own
from, and the driver'sinputDragparses it, which is what made thisone stand out.
Since
fromis just the first point of the path, prepending it tosegmentsfixes the behaviourwithout touching the protocol schema or the device driver, which is the smaller change of the two
options in the issue.
Test
None, and I want to be upfront about why rather than have it look like an omission.
tests/android/needs a real device, and I do not have one, so I can verify the plumbing and the types but not the
resulting gesture on hardware. There is also no existing swipe coverage in that suite to extend.
flintis clean.If you would rather this were confirmed on a device before landing, or would rather take the other
option from the issue and correct the documentation instead, both are completely reasonable and I am
happy either way.
Fixes #42348
thanks for assigning it. the one assumption I am leaning on is that
UiDevice.swipetreats thefirst element of the array as the origin of the gesture, which is what the parameter docs imply but
which I could not confirm by running it. freshman in college, so please do sanity check that bit :)