Skip to content

refactor: consolidate platform branching into Interactor#231

Merged
thymikee merged 1 commit into
mainfrom
worktree-agent-a258c73f
Mar 17, 2026
Merged

refactor: consolidate platform branching into Interactor#231
thymikee merged 1 commit into
mainfrom
worktree-agent-a258c73f

Conversation

@thymikee
Copy link
Copy Markdown
Member

Summary

  • Extends the existing Interactor type with back(), home(), appSwitcher(), readClipboard(), writeClipboard(), setSetting(), and screenshot() methods
  • Replaces 8 scattered if (device.platform === 'ios') ... else ... blocks in dispatch.ts with single interactor.*() calls
  • Deduplicates runnerOpts construction — now built once in iosRunnerOverrides() and shared with the iOS interactor factory
  • Removes 7 now-unused platform imports from dispatch.ts

Net result: -62 lines of branching logic in dispatch.ts, consolidated into the interactor factory where all other platform dispatch already lives.

push, snapshot, keyboard, and pinch are intentionally left as-is — they have platform-specific return types or semantics that don't fit a shared interface.

Test plan

  • All 748 unit tests pass
  • TypeScript typecheck passes with zero errors
  • Prettier formatting applied
  • Smoke tests on iOS simulator
  • Smoke tests on Android emulator

🤖 Generated with Claude Code

Move back, home, appSwitcher, clipboard read/write, setSetting, and
screenshot into the Interactor abstraction, eliminating scattered
if-platform checks in dispatch.ts.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@github-actions
Copy link
Copy Markdown

PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://callstackincubator.github.io/agent-device/pr-preview/pr-231/

Built to branch gh-pages at 2026-03-17 14:26 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@thymikee thymikee merged commit d66a580 into main Mar 17, 2026
7 checks passed
@thymikee thymikee deleted the worktree-agent-a258c73f branch March 17, 2026 14:36
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.

1 participant