Skip to content

feat: optional duration for swipe gestures - #344

Merged
gmegidish merged 1 commit into
mobile-next:mainfrom
hakanor:feat/swipe-duration
Aug 23, 2026
Merged

feat: optional duration for swipe gestures#344
gmegidish merged 1 commit into
mobile-next:mainfrom
hakanor:feat/swipe-duration

Conversation

@hakanor

@hakanor hakanor commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Summary

CLI side of the swipe duration support merged in mobile-next/devicekit-ios#62. Adds an optional --duration in milliseconds to io swipe.

  • Android: passed to adb shell input swipe, defaulting to the 1000ms it has always used.
  • iOS: optional, and left out of the RPC when not given so the agent applies its own default. Takes effect with devicekit-ios 0.0.24.

Verified on an iPhone 11 (iOS 26.6)

Summary by CodeRabbit

  • New Features
    • Added configurable swipe duration through the CLI using the --duration option.
    • Added support for specifying swipe duration in API requests.
    • Duration is measured in milliseconds; non-positive values use the platform’s default behavior.
    • Swipe duration is now supported consistently across Android, iOS, simulator, and remote devices.

@coderabbitai

coderabbitai Bot commented Aug 22, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: bd083691-0d56-4230-9726-19fe8c8f6118

📥 Commits

Reviewing files that changed from the base of the PR and between 15e5bb7 and 2cbf7eb.

⛔ Files ignored due to path filters (2)
  • docs/openrpc.json is excluded by !docs/**
  • docs/openrpc.md is excluded by !**/*.md, !docs/**
📒 Files selected for processing (9)
  • cli/io.go
  • commands/input.go
  • devices/android.go
  • devices/common.go
  • devices/devicekit/swipe.go
  • devices/ios.go
  • devices/remote.go
  • devices/simulator.go
  • server/server.go

Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review.


📝 Walkthrough

Walkthrough

The CLI and server now accept swipe durations. Commands and device interfaces propagate the value. Android uses a 1000 ms default for non-positive values, while DeviceKit and remote implementations send positive durations only.

Changes

Swipe duration propagation

Layer / File(s) Summary
Swipe duration request inputs
cli/io.go, server/server.go
The CLI adds a --duration flag with a default of 0. Server swipe parameters accept JSON duration values. Both paths populate SwipeRequest.Duration.
Command and device contract
commands/input.go, devices/common.go
SwipeRequest includes a serialized duration field. SwipeCommand passes the duration through the ControllableDevice.Swipe interface.
Platform duration handling
devices/android.go, devices/devicekit/swipe.go, devices/ios.go, devices/simulator.go, devices/remote.go
Device implementations accept duration values. Android defaults non-positive values to 1000 ms. DeviceKit converts positive milliseconds to seconds, and remote RPC parameters include positive durations.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: 🔵 Low · up to 2cbf7

The swipe duration option is mergeable, but iOS users connected to agents older than devicekit-ios 0.0.24 may have the duration ignored or the request rejected, so the compatible agent version should be confirmed.

Sequence Diagram(s)

sequenceDiagram
  participant CLI
  participant Server
  participant SwipeCommand
  participant Device
  participant DeviceKitClient

  CLI->>SwipeCommand: Submit swipe with --duration
  Server->>SwipeCommand: Submit JSON duration
  SwipeCommand->>Device: Pass coordinates and duration
  Device->>DeviceKitClient: Forward positive duration when applicable
  Device-->>SwipeCommand: Complete swipe
Loading

Suggested reviewers: gmegidish

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 9 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding optional duration support for swipe gestures.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@gmegidish
gmegidish force-pushed the feat/swipe-duration branch from 2cbf7eb to 182750b Compare August 23, 2026 18:36
@gmegidish
gmegidish merged commit 142b0e4 into mobile-next:main Aug 23, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants