Skip to content

fix: make iOS keyboard dismiss handle common native controls #468

@thymikee

Description

@thymikee

Summary

agent-device keyboard dismiss on iOS currently returns UNSUPPORTED_OPERATION when the runner cannot hide the keyboard via its narrow built-in paths. Dogfood exposed a case where agents had to fall back to a visible app control (Done) instead of keyboard dismiss.

Current behavior

The iOS runner currently tries:

  • app.keyboards.firstMatch.swipeDown()
  • keyboard/toolbar controls labeled Hide keyboard or Dismiss keyboard

If the keyboard remains visible, it returns:

UNSUPPORTED_OPERATION: Unable to dismiss the iOS keyboard without a native dismiss gesture or control

This misses common iOS dismissal controls such as a visible Done toolbar button.

Expected behavior

keyboard dismiss should reliably use common native iOS keyboard dismissal controls when they are exposed and hittable, without requiring agents to manually press app-specific controls first.

Suggested implementation

  • Expand tapKeyboardDismissControl in ios-runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Interaction.swift to include common safe labels such as Done.
  • Check toolbar buttons outside app.keyboards where relevant.
  • Keep the no-navigation guarantee: do not fall back to back --system behavior inside keyboard dismiss.
  • Preserve explicit UNSUPPORTED_OPERATION when no safe native dismiss path is available.

Tests / validation

Add or update tests covering iOS keyboard dismissal when a visible native/app toolbar Done button is available.

Also update guidance after the behavior is fixed:

  • agent-device help workflow in src/utils/command-schema.ts
  • website/docs/docs/commands.md
  • AGENTS.md
  • relevant SkillGym guidance cases, especially form-keyboard-dismiss-ios-fallback

The guidance should make keyboard dismiss the preferred iOS path again when the runner can handle common controls, while still documenting fallback behavior for truly unsupported layouts.

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