Repository navigation
fix(mobile): hide nodes under the soft keyboard and fail covered taps as actions - #1686
Conversation
… 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>
There was a problem hiding this comment.
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
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>
🟢 e2e ios agent: 21 passed, 1 skipped25 agent steps · 11 replayed from cache · 60 model calls · 378.4k tokens (82% cached) · $0.0253 All 22 tests in 1 file
Tested by e2e 0.23.0 · 9m 12s · ios-simulator · run artifacts |
🟢 e2e android agent: 20 passed24 agent steps · 15 replayed from cache · 44 model calls · 286.7k tokens (84% cached) · $0.0179 All 20 tests in 1 file
Tested by e2e 0.23.0 · 6m 0s · android-emulator · run artifacts |
🟢 e2e android: 57 passed, 1 skippedAll 58 tests in 7 files
Tested by e2e 0.23.0 · 8m 42s · android-emulator · run artifacts |
🟢 e2e ios: 55 passed, 1 skippedAll 56 tests in 7 files
Tested by e2e 0.23.0 · 7m 3s · ios-simulator · run artifacts |
|
Overlap with #1644 (@TanmayOG, Refs #1324, re-reviewed 2026-11-10 and close to landing). Both PRs add the same Proposed order: #1644 lands first, since it's older and covers This was an automated triage. |
- 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
- 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
- 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
On a device, "visible" meant only "not hidden", and
hiddencame only from agent-device'svisibleToUser: false. A row under the soft keyboard therefore counted as visible.scrollUntilVisiblestopped on it,toBeVisible()passed, and the tap then failed as an engine error.packages/mobile/src/nodes.ts:projectSnapshottakes akeyboardband. A node whose centre is in the band and none of whose children shows getsstates.hidden, the same as a node scrolled off screen.keyboardBandinnodes.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, itsKeys, and theSystemInputAssistantViewsuggestion 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.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: atarget_coveredortap_keyboard_occludes_targetrefusal withdispatched: 'no'now maps toNOT_ACTIONABLE(ACTION_FAILED), keeping agent-device's hint. Before, it wasENGINE_FAILURE, which counts as an infrastructure failure.observe. Inios/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/reference/mobile.mdx, a note onscrollUntilVisibleinscreen.mdx, and theskills/e2esetup reference.Not covered: an app view drawn over a node that agent-device's cover scan does not classify, such as the plain
Viewfooter in the issue. That node is still not hidden, and agent-device does not refuse a tap on it. I did not turninteractionBlocked: 'covered'intohidden, 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
e2e run tests/scroll.e2e.ts:toBeHidden()on 벨소리,toBeVisible()on the focused 성 field, thenscrollUntilVisible(getByText('벨소리'))andtoBeVisible(). Passes on this branch.scrollUntilVisible(getByText('벨소리'))getByText('벨소리').tap()with the keyboard upENGINE_FAILURE, exit 3ACTION_FAILED, exit 1Branch output for the tap:
🤖 Generated with Claude Code