Skip to content

fix: avoid unsafe iOS keyboard dismissal - #957

Merged
thymikee merged 1 commit into
mainfrom
fix/ios-keyboard-dismiss-safe-controls
Jun 30, 2026
Merged

fix: avoid unsafe iOS keyboard dismissal#957
thymikee merged 1 commit into
mainfrom
fix/ios-keyboard-dismiss-safe-controls

Conversation

@thymikee

@thymikee thymikee commented Jun 30, 2026

Copy link
Copy Markdown
Member

Summary

Closes #952.

  • Removes the iOS keyboard dismissal swipe/coordinate fallbacks that could type into focused fields on iOS 26.
  • Keeps dismissal limited to safe native controls and updates the unsupported-operation copy/docs/help to match.

The dismiss-control search intentionally checks matching buttons beyond app.toolbars.buttons because iOS 26 may expose keyboard-accessory Done controls outside a UIToolbar. It remains bounded by exact safe labels and keyboard-accessory geometry, so it can tap a nearby dismiss control without falling back to input-mutating gestures or raw coordinates.

Touched files: 8. Scope stayed within iOS runner keyboard behavior plus related help/docs/tests.

Validation

  • Verified in Safari on iPhone 17 Pro simulator: keyboard dismiss no longer appended TV to abc; it failed closed when no safe control was available.
  • Verified in examples/test-app Checkout form on iPhone 17 Pro simulator: field stayed Final952 after keyboard dismiss returned UNSUPPORTED_OPERATION.
  • Verified tvOS simulator path still reports keyboard unsupported.
  • pnpm build
  • pnpm build:xcuitest
  • pnpm build:xcuitest:tvos
  • pnpm exec vitest run src/utils/tests/args.test.ts src/commands/system/index.test.ts src/core/tests/dispatch-keyboard.test.ts src/core/tests/capabilities.test.ts
  • pnpm exec vitest run src/platforms/ios/tests/runner-client.test.ts
  • pnpm format
  • pnpm check:quick

@github-actions

github-actions Bot commented Jun 30, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-06-30 12:08 UTC

@github-actions

github-actions Bot commented Jun 30, 2026

Copy link
Copy Markdown

Size Report

Metric Base Current Diff
JS raw 1.4 MB 1.4 MB -53 B
JS gzip 456.1 kB 456.1 kB -18 B
npm tarball 557.9 kB 557.8 kB -144 B
npm unpacked 2.0 MB 2.0 MB -1.1 kB

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 27.5 ms 27.9 ms +0.4 ms
CLI --help 48.2 ms 57.8 ms +9.5 ms

Top changed chunks:

Chunk Raw diff Gzip diff
dist/src/cli-help.js -80 B -25 B
dist/src/2948.js +27 B +7 B

@thymikee

Copy link
Copy Markdown
Member Author

Reviewed against #952 and the iOS runner path. This removes the unsafe dismiss swipe/coordinate fallback that could type into focused fields, keeps dismissal limited to safe native controls, and preserves an explicit UNSUPPORTED_OPERATION result when the keyboard stays visible. Docs/help now steer agents away from manual Done/back fallbacks unless intentional, and checks are green. No remaining blockers; marking ready-for-human.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Jun 30, 2026
@thymikee
thymikee force-pushed the fix/ios-keyboard-dismiss-safe-controls branch from efe667d to 5ea727e Compare June 30, 2026 12:06
@thymikee
thymikee merged commit 305594f into main Jun 30, 2026
22 checks passed
@thymikee
thymikee deleted the fix/ios-keyboard-dismiss-safe-controls branch June 30, 2026 12:08
thymikee added a commit that referenced this pull request Jul 9, 2026
Review on #1173 flagged the unconditional "does not block" claim as false
for targets visually covered by the keyboard: direct-selector press
resolution is isHittable-gated and falls through to ELEMENT_NOT_FOUND, the
tree path allows non-hittable taps with only a no-visible-effect hint, and
bottom-pinned-button-under-keyboard (#291/#469/#957) is a real case where
dismissal was the remedy.

All three strings (runner hint, help manual-qa, help workflow) now say the
keyboard USUALLY does not block presses and name concrete fallbacks: scroll
the target into view, or keyboard enter when submission is wanted.
thymikee added a commit that referenced this pull request Jul 9, 2026
…1173)

* fix: guide agents past iOS keyboard dismissal and get-text guesses

Tonight's benchmark leaderboard showed two recurring agent-UX misses:
keyboard dismiss failing after fill (5x, now the #1 failed command) and
get-text guessed as a command name (1x).

- iOS keyboardDismiss now returns a hint explaining the on-screen keyboard
  does not block agent-device interactions, so agents should press the next
  target directly instead of retrying dismiss, and use keyboard enter only
  when submission is actually wanted.
- help manual-qa and help workflow recovery text no longer teach the false
  "dismiss to unblock the target" pattern.
- The command-suggestion curated map now maps get-text/gettext/get_text to
  the real get text command shape; the generic edit-distance fallback did
  not produce any suggestion for these guesses.

* fix: soften keyboard guidance for genuinely covered targets

Review on #1173 flagged the unconditional "does not block" claim as false
for targets visually covered by the keyboard: direct-selector press
resolution is isHittable-gated and falls through to ELEMENT_NOT_FOUND, the
tree path allows non-hittable taps with only a no-visible-effect hint, and
bottom-pinned-button-under-keyboard (#291/#469/#957) is a real case where
dismissal was the remedy.

All three strings (runner hint, help manual-qa, help workflow) now say the
keyboard USUALLY does not block presses and name concrete fallbacks: scroll
the target into view, or keyboard enter when submission is wanted.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

keyboard dismiss types " TV" into the focused field instead of dismissing the keyboard (iOS 26 simulator)

1 participant