Skip to content

fix(mobile): hide nodes under the soft keyboard and fail covered taps as actions - #1686

Merged
okwasniewski merged 2 commits into
mainfrom
kdy1/fix-mobile-covered-node-taps
Nov 12, 2026
Merged

okwasniewski merged 2 commits into
mainfrom
kdy1/fix-mobile-covered-node-taps

Conversation

@kdy1

@kdy1 kdy1 commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator

On a device, "visible" meant only "not hidden", and hidden came only from agent-device's visibleToUser: false. A row under the soft keyboard therefore counted as visible. scrollUntilVisible stopped on it, toBeVisible() passed, and the tap then failed as an engine error.

  • packages/mobile/src/nodes.ts: projectSnapshot takes a keyboard band. A node whose centre is in the band and none of whose children shows gets states.hidden, the same as a node scrolled off screen.
  • The band comes from keyboardBand in nodes.ts. It is agent-device's measured frame when there is one. Otherwise it spans from the top of the tree's keyboard elements (Keyboard, its Keys, and the SystemInputAssistantView suggestion strip) to the bottom of the screen. On iOS 27, agent-device 0.21.36's simulator capture publishes no frame, so the fallback is the path that runs there.
  • Never hidden: the keyboard's own nodes (keys, keyboardOwned, the window that holds the keyboard, later siblings that lie inside the band such as the globe and dictation dock), and the focused field. On a live device, iOS reported the focused search field at its frame from before the keyboard came up (y=789, drawn at about 511).
  • packages/mobile/src/errors.ts: a target_covered or tap_keyboard_occludes_target refusal with dispatched: 'no' now maps to NOT_ACTIONABLE (ACTION_FAILED), keeping agent-device's hint. Before, it was ENGINE_FAILURE, which counts as an infrastructure failure.
  • The golden test projects with the same band as observe. In ios/sequential-onboarding.tree.txt, the Continue button under the keyboard is now [hidden]. The benchmark's onboarding tests dismiss the keyboard before they tap it.
  • Docs: a new Visibility section in docs/reference/mobile.mdx, a note on scrollUntilVisible in screen.mdx, and the skills/e2e setup reference.

Not covered: an app view drawn over a node that agent-device's cover scan does not classify, such as the plain View footer in the issue. That node is still not hidden, and agent-device does not refuse a tap on it. I did not turn interactionBlocked: 'covered' into hidden, because a false positive there (ENG-968) would remove a real node from role queries.

Judgment call for review: a node listed after the keyboard under the same parent that starts inside the band counts as keyboard (the dock). A bare app control in that exact spot would stay visible. No capture shows that shape, and hiding the dock instead would drop real keyboard buttons (thread).

Issue

Part of ENG-1042

Verified

Ran it locally: yes

  • Built CLI, iPhone 17 simulator (iOS 27, Korean locale), Contacts app. The test opens a new contact, taps the 성 field to raise the keyboard, then works with the 벨소리 row under the keyboard.
  • e2e run tests/scroll.e2e.ts: toBeHidden() on 벨소리, toBeVisible() on the focused 성 field, then scrollUntilVisible(getByText('벨소리')) and toBeVisible(). Passes on this branch.
main this branch
벨소리 row under the keyboard (y=783) before scrolling visible hidden
scrollUntilVisible(getByText('벨소리')) stops at once, row stays at y=783 under the keyboard scrolls, row ends at y=494
getByText('벨소리').tap() with the keyboard up ENGINE_FAILURE, exit 3 ACTION_FAILED, exit 1

Branch output for the tap:

× |iphone| tests/keyboard.e2e.ts > tap under the keyboard 9.98s
ACTION_FAILED: perform tap failed: Ref @e72 is behind the visible keyboard and cannot be tapped safely Hint: The visible keyboard covers this target, so the tap would land on a key instead of on it. End editing first: ...

🤖 Generated with Claude Code

… as actions

A node whose centre the soft keyboard covers is now hidden in the
projection, so scrollUntilVisible keeps scrolling to it, toBeVisible()
fails on it, and getByRole skips it. The band is agent-device's measured
frame, else the keyboard elements in the tree down to the screen bottom
(the iOS simulator capture publishes no frame). The keyboard's keys, dock,
and suggestion bar stay visible, and so does the focused field.

agent-device's target_covered and tap_keyboard_occludes_target refusals
that dispatched nothing now map to NOT_ACTIONABLE (ACTION_FAILED) with the
hint naming the cover, not ENGINE_FAILURE.

Part of ENG-1042.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kdy1
kdy1 requested a review from okwasniewski as a code owner November 11, 2026 01:51
@github-actions github-actions Bot added the size:L Up to 499 changed lines, not counting tests, fixtures, translated docs, or the lockfile label Nov 11, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 13 files

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread skills/e2e/references/setup.md Resolved
Comment thread packages/mobile/src/nodes.ts Resolved
Comment thread packages/mobile/src/nodes.ts Resolved
Also qualify the skill line and changeset: the keyboard's own nodes, the
focused field, and a container with a showing child stay visible, and only
a refusal that sent no tap becomes ACTION_FAILED.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

🟢 e2e ios agent: 21 passed, 1 skipped

25 agent steps · 11 replayed from cache · 60 model calls · 378.4k tokens (82% cached) · $0.0253

All 22 tests in 1 file
Test Agent Time
⏭️ tests-agent/scenarios.e2e.ts · 21 passed, 1 skipped 25 steps · 60 calls 9m 11s
🟢 act completes Login Form 1 step 43.4s
🟢 act completes Infinite Scroll List 1 step 39.3s
🟢 act completes Modal Flow 1 step 10.1s
🟢 act completes Bottom Tabs 1 step 7.8s
🟢 act completes Text Input Variations 1 step 13.9s
🟢 act completes Broken Accessibility 2 steps · 5 calls 38.7s
🟢 act completes Vision Only 2 steps · 6 calls 28.5s
🟢 act completes Gestures 1 step · 9 calls 40.6s
🟢 act completes Async States 1 step · 8 calls 22.6s
🟢 act completes Debounced Search 1 step · 1 call 27.1s
🟢 act completes Flattened Registration Form 2 steps · 1 call 28.3s
🟢 act completes Flattened Login 2 steps · 10 calls 54.2s
🟢 act completes Sticky Chrome Target 1 step · 3 calls 32.9s
🟢 act completes WebView Accessibility 1 step 12.2s
🟢 act completes Permission Prompt 1 step 11.8s
🟢 act completes Photo Picker 1 step · 2 calls 31.6s
🟢 act completes Product Catalog 1 step 10.8s
🟢 act completes Error Recovery 1 step 10.3s
🟢 act completes Choice Controls 1 step · 7 calls 39.7s
🟢 act completes Stripe PaymentSheet 1 step · 8 calls 34.3s
🟢 act completes Apple Pay 1 step 13.1s
⏭️ act completes Apple Pay Billing Address (skipped: the CI simulator's Apple Pay sheet skips the billing-address step, so the scenario cannot be completed there)

Tested by e2e 0.23.0 · 9m 12s · ios-simulator · run artifacts

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 issues found across 5 files (changes from recent commits).

View guided diff | Turn on auto-fix | Re-trigger cubic

@github-actions

Copy link
Copy Markdown
Contributor

🟢 e2e android agent: 20 passed

24 agent steps · 15 replayed from cache · 44 model calls · 286.7k tokens (84% cached) · $0.0179

All 20 tests in 1 file
Test Agent Time
🟢 tests-agent/scenarios.e2e.ts · 20 passed 24 steps · 44 calls 5m 59s
🟢 act completes Login Form 1 step 21.6s
🟢 act completes Infinite Scroll List 1 step 20.7s
🟢 act completes Modal Flow 1 step 11.3s
🟢 act completes Bottom Tabs 1 step 6.9s
🟢 act completes Text Input Variations 1 step 6.3s
🟢 act completes Broken Accessibility 2 steps · 5 calls 13.5s
🟢 act completes Vision Only 2 steps · 1 call 6.7s
🟢 act completes Gestures 1 step · 7 calls 18.2s
🟢 act completes Async States 1 step · 19 calls 43.2s
🟢 act completes Debounced Search 1 step 6.7s
🟢 act completes Huge Virtualized List 1 step 1m 54s
🟢 act completes Flattened Registration Form 2 steps · 1 call 7.7s
🟢 act completes Flattened Login 2 steps · 6 calls 15.9s
🟢 act completes Sticky Chrome Target 1 step 9.0s
🟢 act completes WebView Accessibility 1 step · 5 calls 14.9s
🟢 act completes Permission Prompt 1 step 6.4s
🟢 act completes Product Catalog 1 step 8.2s
🟢 act completes Error Recovery 1 step 9.4s
🟢 act completes Choice Controls 1 step 8.9s
🟢 act completes Sequential Onboarding 1 step 10.2s

Tested by e2e 0.23.0 · 6m 0s · android-emulator · run artifacts

@github-actions

Copy link
Copy Markdown
Contributor

🟢 e2e android: 57 passed, 1 skipped

All 58 tests in 7 files
Test Time
⏭️ tests/controls.e2e.ts · 24 passed, 1 skipped 2m 25s
🟢 control inventory › a label query resolves a labeled text field 16.2s
🟢 control inventory › a labeled field answers name, display value, value reads, fill, and clear 10.2s
🟢 control inventory › a placeholder query and attribute reads find the field 4.4s
🟢 control inventory › a secure field takes a fill and denies value reads 5.8s
🟢 control inventory › press sends a character and Enter through the soft keyboard 7.2s
🟢 control inventory › a field autofocuses on mount and focus() moves the focus 7.0s
🟢 control inventory › toBeFocused follows the focus 7.5s
🟢 control inventory › a switch checks, unchecks, and reports its state 7.8s
🟢 control inventory › checkbox and radio roles answer getByRole, and a checkbox toggles by tap 6.7s
🟢 control inventory › checkbox and radio roles check, uncheck, and report their state 9.5s
🟢 control inventory › a tab role answers getByRole 3.5s
🟢 control inventory › a radio group reports the checked option 7.5s
🟢 control inventory › buttons report disabled, enabled, and a state that arrives later 6.3s
🟢 control inventory › a display: none element is absent rather than hidden, its visible twin attached 6.3s
🟢 control inventory › a header answers its accessible name 3.6s
🟢 control inventory › a tab row answers count, all, texts, filters, positions, and switching 5.0s
🟢 control inventory › a list answers counts, list-form text, reads, and boxes in order 4.8s
⏭️ control inventory › a row contains its texts (skipped: React Native flattens a plain View out of the accessibility tree on both platforms: XCTest and the Android helper report a View with a testID as a leaf beside its children, so filter({ has }) and a query scoped to it match nothing; only Sc…)
🟢 control inventory › a long press lands as one 6.8s
🟢 control inventory › a double tap lands inside the 300 ms window 6.1s
🟢 control inventory › an ambiguous locator fails at once 4.5s
🟢 control inventory › screenshot, restart, and clearState reopen the app on its home list 5.9s
🟢 refusals › verbs a device never declares are refused before the engine 1ms
🟢 refusals › keys the soft keyboard cannot send are refused by the engine 1.3s
🟢 refusals › a missing locator fails as not found once its timeout passes 1.0s
🟢 tests/device-fixture.e2e.ts · 10 passed 1m 10s
🟢 device fixture › setOrientation rotates the window the app measures 4.8s
🟢 device fixture › home leaves the app, openApp brings it back where it was 4.2s
🟢 device fixture › foregroundApp sees the home screen after home() 3.5s
🟢 device fixture › closeApp then openApp relaunches on the home list 5.2s
🟢 device fixture › closeApp leaves the next commands on the same device 5.9s
🟢 device fixture › foregroundApp after closeApp reports the closed session as APP_NOT_OPEN 4.1s
🟢 device fixture › device.back pops the scenario 4.2s
🟢 device fixture › unstable_raw reaches the test session through agent-device 3.4s
🟢 device fixture › setNetwork and setAirplaneMode change what the app sees 14.8s
🟢 device fixture › setLocation and clearLocation change what the app reads 20.4s
🟢 tests/device.e2e.ts · 5 passed 37.0s
🟢 permission prompt › allowing the system dialog enables the microphone 5.1s
🟢 permission prompt › a denied prompt recovers once the permission is granted outside 11.4s
🟢 sequential onboarding echoes the exact values 9.3s
🟢 onboarding rejects a malformed email before advancing 5.1s
🟢 dismissing the keyboard over choice controls leaves them as they were 6.1s
🟢 tests/flows-lists.e2e.ts · 7 passed 3m 11s
🟢 infinite scroll reaches the target item 28.5s
🟢 product catalog adds exactly two of the right variant 8.1s
🟢 gestures: long-press, then swipe left 7.7s
🟢 gestures: double-tap completes the flow 9.4s
🟢 sticky chrome: accept below the fold, then continue 10.4s
🟢 async states: load, pull to refresh, claim through the toast 12.4s
🟢 huge virtualized list reaches row 512 1m 54s
🟢 tests/flows.e2e.ts · 7 passed 47.7s
🟢 text inputs unlock the submit button 5.8s
🟢 filled text inputs report their values 5.3s
🟢 modal flow confirms through the native alert 8.5s
🟢 bottom tabs act inside the last tab 6.2s
🟢 error recovery retries, then confirms the delete 8.0s
🟢 choice controls place the exact order 5.8s
🟢 debounced search selects the target once results arrive 8.1s
🟢 tests/login-form.e2e.ts · 3 passed 25.5s
🟢 login form › rejects a malformed email 6.9s
🟢 login form › rejects an unknown account 6.7s
🟢 login form › signs in and logs out 11.9s
🟢 tests/smoke.e2e.ts · 1 passed 5.0s
🟢 home lists the scenarios and opens one 5.0s

Tested by e2e 0.23.0 · 8m 42s · android-emulator · run artifacts

@github-actions

Copy link
Copy Markdown
Contributor

🟢 e2e ios: 55 passed, 1 skipped

All 56 tests in 7 files
Test Time
⏭️ tests/controls.e2e.ts · 23 passed, 1 skipped 3m 5s
🟢 control inventory › a label query resolves a labeled text field 13.1s
🟢 control inventory › a labeled field answers name, display value, value reads, fill, and clear 15.2s
🟢 control inventory › a placeholder query and attribute reads find the field 4.3s
🟢 control inventory › a secure field takes a fill and denies value reads 7.9s
🟢 control inventory › press sends a character and Enter through the soft keyboard 9.3s
🟢 control inventory › a field autofocuses on mount and focus() moves the focus 9.7s
🟢 control inventory › toBeFocused follows the focus 8.6s
🟢 control inventory › a switch checks, unchecks, and reports its state 10.2s
🟢 control inventory › checkbox and radio roles answer getByRole, and a checkbox toggles by tap 9.0s
🟢 control inventory › checkbox and radio roles check, uncheck, and report their state 12.6s
🟢 control inventory › a radio group reports the checked option 8.8s
🟢 control inventory › buttons report disabled, enabled, and a state that arrives later 7.7s
🟢 control inventory › a display: none element is absent rather than hidden, its visible twin attached 7.9s
🟢 control inventory › a header answers its accessible name 4.6s
🟢 control inventory › a tab row answers count, all, texts, filters, positions, and switching 6.3s
🟢 control inventory › a list answers counts, list-form text, reads, and boxes in order 8.3s
⏭️ control inventory › a row contains its texts (skipped: React Native flattens a plain View out of the accessibility tree on both platforms: XCTest and the Android helper report a View with a testID as a leaf beside its children, so filter({ has }) and a query scoped to it match nothing; only Sc…)
🟢 control inventory › a long press lands as one 8.7s
🟢 control inventory › pointer verbs land at the point asked for 11.4s
🟢 control inventory › an ambiguous locator fails at once 7.0s
🟢 control inventory › screenshot, restart, and clearState reopen the app on its home list 12.6s
🟢 refusals › verbs a device never declares are refused before the engine 1ms
🟢 refusals › keys the soft keyboard cannot send are refused by the engine 439ms
🟢 refusals › a missing locator fails as not found once its timeout passes 1.1s
🟢 tests/device-fixture.e2e.ts · 11 passed 1m 33s
🟢 device fixture › setAppearance flips the color scheme the app reads 16.0s
🟢 device fixture › setOrientation rotates the window the app measures 9.5s
🟢 device fixture › the clipboard reads back what was written 5.7s
🟢 device fixture › home leaves the app, openApp brings it back where it was 6.0s
🟢 device fixture › closeApp then openApp relaunches on the home list 7.6s
🟢 device fixture › closeApp leaves the next commands on the same device 9.8s
🟢 device fixture › foregroundApp after closeApp reports the closed session as APP_NOT_OPEN 5.2s
🟢 device fixture › device.back pops the scenario 5.5s
🟢 device fixture › unstable_raw reaches the test session through agent-device 4.4s
🟢 device fixture › setLocation and clearLocation change what the app reads 12.6s
🟢 device fixture › enrollBiometrics and setBiometrics answer a biometric prompt 10.6s
🟢 tests/device.e2e.ts · 3 passed 1m 11s
🟢 sequential onboarding echoes the exact values 42.4s
🟢 onboarding rejects a malformed email before advancing 15.7s
🟢 dismissing the keyboard over choice controls leaves them as they were 12.7s
🟢 tests/flows-lists.e2e.ts · 7 passed 4m 19s
🟢 infinite scroll reaches the target item 39.8s
🟢 product catalog adds exactly two of the right variant 11.1s
🟢 gestures: long-press, then swipe left 9.5s
🟢 sticky chrome: accept below the fold, then continue 13.2s
🟢 async states: load, pull to refresh, claim through the toast 12.0s
🟢 huge virtualized list reaches row 512 2m 41s
🟢 web view coupon form applies the code shown on the page 12.3s
🟢 tests/flows.e2e.ts · 7 passed 1m 13s
🟢 text inputs unlock the submit button 13.8s
🟢 filled text inputs report their values 11.3s
🟢 modal flow confirms through the native alert 10.1s
🟢 bottom tabs act inside the last tab 7.8s
🟢 error recovery retries, then confirms the delete 10.0s
🟢 choice controls place the exact order 8.1s
🟢 debounced search selects the target once results arrive 11.5s
🟢 tests/login-form.e2e.ts · 3 passed 49.1s
🟢 login form › rejects a malformed email 14.2s
🟢 login form › rejects an unknown account 14.0s
🟢 login form › signs in and logs out 20.9s
🟢 tests/smoke.e2e.ts · 1 passed 7.6s
🟢 home lists the scenarios and opens one 7.6s

Tested by e2e 0.23.0 · 7m 3s · ios-simulator · run artifacts

@kdy1 kdy1 added the Ready for Human Review Green, conflict-free, every thread handled. Waiting on a maintainer. label Nov 11, 2026
@okwasniewski

Copy link
Copy Markdown
Member

Overlap with #1644 (@TanmayOG, Refs #1324, re-reviewed 2026-11-10 and close to landing). Both PRs add the same staleOr branch in packages/mobile/src/errors.ts mapping target_covered to NOT_ACTIONABLE, and both change hidden-state projection in nodes.ts, so whichever lands second conflicts.

Proposed order: #1644 lands first, since it's older and covers target_covered plus the covered-node visibility. This PR then rebases and keeps what's new here: the keyboard band in projectSnapshot and tap_keyboard_occludes_target, which can go in alongside #1644's target_covered check, keeping the dispatched === 'no' guard.

This was an automated triage.

@okwasniewski
okwasniewski merged commit 368f638 into main Nov 12, 2026
33 checks passed
@okwasniewski
okwasniewski deleted the kdy1/fix-mobile-covered-node-taps branch November 12, 2026 08:48
TanmayOG added a commit to TanmayOG/e2e that referenced this pull request Nov 12, 2026
- A node agent-device marks interactionBlocked: covered reads as
  hidden, so toBeVisible waits and scrollUntilVisible scrolls until it
  is clear. agent-device's refusal of it already fails as ACTION_FAILED
  through the staleOr branch from e2e-inc#1686.
- Role queries still find such a node, so getByRole(...).tap() fails
  with that refusal rather than finding nothing. A node under the soft
  keyboard stays out of role queries, as e2e-inc#1686 documents: the projected
  node's platformHidden fact covers the platform and the keyboard only.
- e2e-inc#1686's keyboard rule reads its children's platformHidden, so a
  covered child above the keyboard still keeps its container visible.
- The e2e/engine role-query note allows keeping a node hidden only by
  a cover. Docs, the e2e skill and the Covered Field scenario (skipped
  until callstack/agent-device#4347) are updated.

Refs e2e-inc#1324
TanmayOG added a commit to TanmayOG/e2e that referenced this pull request Nov 12, 2026
- agent-device counts the Android keyboard as a cover, so its covered
  mark overrode e2e-inc#1686's keyboard rules: a focused field, a container
  with a child above the keyboard and the keyboard's own dock read as
  hidden on Android. Under the keyboard the mark is now ignored, tested
  at agent-device's own cover point (centerOfRect).
- On Android, while agent-device reports a keyboard it could not measure
  and e2e has no band, the mark hides nothing (keyboardUnplaced). iOS
  keeps the mark: agent-device never counts the iOS keyboard as a cover.
- The golden-tree harness projects the way observe does.
- Docs, the e2e skill and the changeset say so; the engine test fixture
  is trimmed to what it asserts.

Refs e2e-inc#1324
TanmayOG added a commit to TanmayOG/e2e that referenced this pull request Nov 21, 2026
- A node agent-device marks interactionBlocked: covered reads as
  hidden outside the soft keyboard, so toBeVisible waits and
  scrollUntilVisible scrolls until it is clear. Under the keyboard, and
  on Android while a keyboard agent-device cannot measure may be up,
  e2e-inc#1686's keyboard rules decide, since agent-device counts the Android
  keyboard as a cover.
- Role queries still find a covered node, so getByRole(...).tap() fails
  with agent-device's refusal rather than finding nothing; a node the
  keyboard hides stays out. The e2e/engine role-query note allows this.
- The keyboard drag start keeps a covered node as an obstacle.
- Docs, the e2e skill, the changeset and the Covered Field scenario
  (skipped until callstack/agent-device#4347).

Refs e2e-inc#1324
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Ready for Human Review Green, conflict-free, every thread handled. Waiting on a maintainer. size:L Up to 499 changed lines, not counting tests, fixtures, translated docs, or the lockfile

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants