Skip to content

Refactor Android platform module into focused submodules #154

Closed

Description

@thymikee

Problem

src/platforms/android/index.ts is currently ~1435 LOC and combines app lifecycle, input actions, settings/permissions, notifications, keyboard/clipboard, and UI dump/snapshot logic in one file. This makes targeted changes and reviews harder.

Goal

Refactor into focused Android submodules while preserving existing behavior and exported command contracts.

Proposed split

  • src/platforms/android/app-lifecycle.ts
    • app resolve/list/open/close/reinstall/appstate flows
  • src/platforms/android/input-actions.ts
    • press/swipe/longPress/type/fill/scroll/scrollIntoView
  • src/platforms/android/device-input-state.ts
    • keyboard + clipboard read/write/dismiss helpers
  • src/platforms/android/settings.ts
    • appearance/permission/fingerprint setting handlers
  • src/platforms/android/notifications.ts
    • push notification payload + broadcast extras
  • src/platforms/android/snapshot.ts
    • snapshot + UI hierarchy dump/retry helpers
  • Keep src/platforms/android/index.ts as a thin export/compose layer.

Acceptance criteria

  • No CLI behavior changes.
  • Existing public exports remain backward-compatible.
  • Each new implementation file targets <=300 LOC when practical.
  • No module remains >500 LOC unless explicitly justified.
  • Existing Android unit tests pass without weakening assertions.

Validation

  • pnpm typecheck
  • pnpm test:unit
  • pnpm test:smoke

Activity

  1. added a commit that references this issue on Mar 3, 2026
    d6dafbf
  2. added a commit that references this issue on Mar 6, 2026
    1a3ae62
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions