Repository navigation
feat: io fill replaces the focused text field #527
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
d276798
feat: io clear empties the focused text field
gmegidish 0074761
feat: io fill replaces the focused text field, android through action…
gmegidish ff97abf
fix: send empty modifiers instead of null to the ios agent
gmegidish 8974f4a
fix: io fill waits for the tapped field to take focus on android
gmegidish 46e3fd7
fix: io fill requires text, so a missing one doesn't clear the field
gmegidish File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| package commands | ||
|
|
||
| import "fmt" | ||
|
|
||
| type FillRequest struct { | ||
| DeviceID string `json:"deviceId"` | ||
| Text string `json:"text"` | ||
| } | ||
|
|
||
| // FillCommand replaces the focused text field's text on the specified device; "" clears it. | ||
| func FillCommand(req FillRequest) *CommandResponse { | ||
| targetDevice, err := FindDeviceWithAgent(req.DeviceID) | ||
| if err != nil { | ||
| return NewErrorResponse(err) | ||
| } | ||
|
|
||
| if err := targetDevice.Fill(req.Text); err != nil { | ||
| return NewErrorResponse(fmt.Errorf("failed to fill text on device %s: %v", targetDevice.ID(), err)) | ||
| } | ||
|
|
||
| return NewSuccessResponse(MessageResult{ | ||
| Message: fmt.Sprintf("Filled the focused text field on device %s", targetDevice.ID()), | ||
| }) | ||
| } |
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| package devices | ||
|
|
||
| import ( | ||
| "encoding/json" | ||
| "testing" | ||
| ) | ||
|
|
||
| // The iOS agent rejects "modifiers": null, so a combo built without modifiers must send []. | ||
| func TestToWdaKeyCombosSendsEmptyModifiersInsteadOfNull(t *testing.T) { | ||
| payload, err := json.Marshal(toWdaKeyCombos([]KeyCombo{{Key: "clear"}})) | ||
| if err != nil { | ||
| t.Fatal(err) | ||
| } | ||
|
|
||
| want := `[{"key":"clear","modifiers":[]}]` | ||
| if string(payload) != want { | ||
| t.Fatalf("toWdaKeyCombos() = %s, want %s", payload, want) | ||
| } | ||
| } |
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift
🔎 Supported by static analysis
🏁 Script executed:
Repository: mobile-next/mobilecli
Length of output: 14201
🏁 Script executed:
Repository: mobile-next/mobilecli
Length of output: 14126
🏁 Script executed:
Repository: mobile-next/mobilecli
Length of output: 493
🏁 Script executed:
Repository: mobile-next/mobilecli
Length of output: 12983
Wait for the tapped field before replacing text.
device.io.tapreturns after the gesture completes, but not after the target field gains focus. If the previous field remains focused,fillselects it and immediately appliesACTION_SET_TEXT; the polling loop does not wait becausefieldis already non-null.Make the tap wait for its target to take focus, or carry the target identity into
filland poll for that field.🤖 Prompt for AI Agents