Skip to content

refactor: reduce parameter complexity in swipe action helper - #41

Closed
Dor-bl wants to merge 2 commits into
masterfrom
refactor-swipe-action-helpers-11046140107786784364
Closed

Dor-bl wants to merge 2 commits into
masterfrom
refactor-swipe-action-helpers-11046140107786784364

Conversation

@Dor-bl

@Dor-bl Dor-bl commented Oct 25, 2026

Copy link
Copy Markdown
Owner

🎯 What

Refactored swipe in appium/webdriver/extensions/action_helpers.py to allow passing start and end points as tuples/lists as well as positional/keyword coordinate arguments. Extracted coordinate processing into dedicated helper methods _extract_start_point and _extract_end_point_and_duration.

💡 Why

The swipe method previously required 5 separate arguments (start_x, start_y, end_x, end_y, duration). Accepting coordinate tuples and using internal helper methods improves code maintainability and readability while preserving full backward compatibility.

✅ Verification

  • All existing unit tests and new unit tests in test/unit/webdriver/action_helpers_test.py pass (207 passed).
  • Code linting and strict type checks passed via make check (ruff, mypy).

✨ Result

Cleaner, more versatile swipe method API and improved maintainability of ActionHelpers.


PR created automatically by Jules for task 11046140107786784364 started by @Dor-bl

claude and others added 2 commits October 21, 2026 07:09
The Release workflow triggers on every push to master. On a fork that means
semantic-release rewrites the version in pyproject.toml, commits the change to
the default branch, tags it and then tries to publish the result to PyPI under
the upstream package name.

Gate the job on the repository name so forks keep a clean master.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PjZRpyoEfSCLjTx5ctzQmJ
Support both tuple coordinate pairs and individual coordinate arguments in `ActionHelpers.swipe`.
Extracted point extraction logic into helper methods `_extract_start_point` and `_extract_end_point_and_duration` to reduce function complexity and parameter count. Added `@overload` type hints and unit tests.
@google-labs-jules

Copy link
Copy Markdown

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Dor-bl commented Nov 1, 2026

Copy link
Copy Markdown
Owner Author

Closing: superseded by upstream's own direction for this method. cd224d9 ("mark ActionHelpers interaction shortcuts as deprecated", appium#1333, shipped in 6.1.0) marks swipe itself @deprecated, telling users to move to W3C actions (ActionChains/ActionBuilder) or mobile: gesture extensions instead. Expanding swipe's parameter-handling surface with overloads and new helper methods now runs against the maintainers' own stated direction for this method, so it's no longer worth mirroring upstream.


Generated by Claude Code

@Dor-bl Dor-bl closed this Nov 1, 2026
@google-labs-jules

Copy link
Copy Markdown

Closing: superseded by upstream's own direction for this method. cd224d9 ("mark ActionHelpers interaction shortcuts as deprecated", appium#1333, shipped in 6.1.0) marks swipe itself @deprecated, telling users to move to W3C actions (ActionChains/ActionBuilder) or mobile: gesture extensions instead. Expanding swipe's parameter-handling surface with overloads and new helper methods now runs against the maintainers' own stated direction for this method, so it's no longer worth mirroring upstream.


Generated by Claude Code

Understood. Acknowledging that this work is now obsolete given upstream deprecation of ActionHelpers shortcuts in favor of W3C actions and mobile gesture extensions, and stopping work on this task.

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