Skip to content

fix(wda): a native floating search bar covers the rows under it - #150

Merged
Derrors merged 1 commit into
mainfrom
fix/native-floating-search-cover
Nov 17, 2026
Merged

Derrors merged 1 commit into
mainfrom
fix/native-floating-search-cover

Conversation

@Derrors

@Derrors Derrors commented Nov 17, 2026

Copy link
Copy Markdown
Owner

What and why

Under native control (iOS 27) the element tree is flat: the floating search bar at the bottom of Settings is a bare SearchField straight under the Application, without the Toolbar that WDA's tree wraps it in. So it didn't count as covering anything. Tapping a row under it by text tapped the row's center, and the bar took the tap: Settings opened its search instead of the row. iphone_tap_element with scroll (#147) could stop with its target there as well. Found while reviewing #147.

A SearchField straight under the Application in the lower 40% of the screen now counts as a floating bar (floating_search in parse_tree): it covers the rows under it, and the area where it takes taps is the measured one, not its frame. On the phone the bar swallows taps up to about 58 pt above its field (field top 866: a tap at 806 still opens the row under it, 812, 820 and 826 do nothing), so SEARCH_BAR_REACH = 58 and 34 pt to the sides and below (SEARCH_BAR_SIDE, the plate plus BAR_SLOP). A row half in that area is tapped above it; a row fully in it is reported as covered and not tapped, and a scroll search goes on scrolling.

WDA trees are unchanged: their search field sits inside a Toolbar with its parent not the Application, so the new rule doesn't apply there.

Tests

1. Unit tests

  • cargo test --workspace --all-features --locked, cargo clippy --workspace --all-targets --all-features --locked -- -D warnings and cargo fmt --check (per package) pass (Rust 1.89 in Docker, Debian 12; clippy with the two lints 1.89 reports and CI's 1.99 doesn't allowed). The one local failure, tasks::tests::the_agent_cant_control_its_own_task, fails on main the same way in this container (process parentage); CI runs it.
  • New or changed behaviour has a unit test: elements::tests::a_native_floating_search_field_covers_the_rows_under_it, on a tree read from the phone (settings-floating-search-native-ios27.xml): a row clear of the bar is tapped at its center, a row in the bar's area is covered, a row half in it is tapped at y ≤ 806. Without the fix the covered row comes back as Center((215, 844)).
  • No existing test removed, ignored or loosened
  • #[ignore] tests of the changed area run by hand: none apply

2. Real-device regression

  • Device, iOS version, host (Linux / macOS): iPhone 15 Pro Max (iPhone16,2), iOS 27.2.1, native control, Debian 12
  • tests/device/run.py default steps pass on this branch (exit code 0): 16 calls, 0 failed, 15.3 s
  • tests/device/scenarios.py passes on this branch: tools, typing, fresh, batch, menu: 41 checks, 0 failed (lock and url not affected)
  • The same steps on main, same device: 16 calls, 0 failed, 14.8–15.6 s over three runs earlier today; no step clearly slower
  • Steps exercising this change: see section 4
  • Longer run: not affected (element parsing only)

3. Regression cases (docs/dev/regression-cases.md)

4. Real-device proof of the fix or feature

  • Device, iOS version, host (Linux / macOS): iPhone 15 Pro Max, iOS 27.2.1, native control, Debian 12
  • Bug fix: reproduced on main, gone with this branch, same device and steps
  • Untested conditions: iPad (WDA, unaffected), landscape, other apps with a bottom search bar
Steps and results (before / after)

Settings opened fresh, one or two slow swipes (215,634)→(215,307), so that a row sits under the search bar.

main (02257ca):
  iphone_tap_element {"text":"隐私与安全"}            row at 840..892
    已点击 Button "隐私与安全" … @(215,870) 390x52    -> Settings' search opened, keyboard up
  iphone_tap_element {"text":"隐私与安全","scroll":"down"}
    已点击 … @(215,866) (滑了 2 次后找到)            -> stopped under the bar; the privacy page didn't open

tap boundary, measured by hand with iphone_tap on rows near the bar:
  y=788, 806 open the row; y=812, 820, 826 do nothing

this branch:
  iphone_tap_element {"text":"主屏幕与App资源库"}     row at 810..862
    被挡住:… 整个被「搜索」盖住,没有点;先滑动让它露出来,或截图后按坐标点
  iphone_tap_element {"text":"隐私与安全"}            row at 838..890
    被挡住:… 整个被「搜索」盖住,没有点
  iphone_tap_element {"text":"相机"}                  row at 758..810
    已点击 … @(215,781)                               -> 相机 page (录制视频 …)
  iphone_tap_element {"text":"主屏幕与App资源库","scroll":"down"}
    已点击 … @(215,382)(滑了 2 次后找到)              -> its page (新下载的App …)
  iphone_tap_element {"text":"隐私与安全","scroll":"down"}   ×5
    已点击 … @(215,433)(滑了 3 次后找到)              -> 定位服务 … each time
  iphone_tap_element {"text":"App","scroll":"down"}
    已点击 Button "App" … @(215,712)(滑了 3 次后找到)

Checklist

  • MCP tool names, parameters and default outputs stay compatible (docs/decisions.md D10)
  • New or changed dependencies are pinned to exact versions; vendor changes recorded in THIRD_PARTY.md: no dependency changes
  • User-visible changes noted in CHANGELOG.md and CHANGELOG.zh-CN.md under Unreleased
  • No private data in fixtures, screenshots, logs or the outputs above (the fixture holds Settings' row titles only)

🤖 Generated with Claude Code

Read natively (iOS 27), the tree is flat: the floating search bar at the
bottom of Settings is a bare SearchField straight under the Application,
without the Toolbar WDA's tree wraps it in. It didn't count as covering
anything, so tapping a row under it by text tapped the row's center and
opened the search; a scroll search could stop with its target there too.

A SearchField straight under the Application in the lower 40% of the
screen now counts as a floating bar: it covers the rows under it and
takes taps BAR_SLOP beyond its frame, as the Toolbar does through WDA.
Regression case #152, unit test on a tree read from the phone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Derrors
Derrors merged commit 6288290 into main Nov 17, 2026
7 checks passed
Derrors added a commit to cosinec/iphone-control that referenced this pull request Nov 17, 2026
Resolve the conflicts with Derrors#141-Derrors#147: keep both sets of client tests, and
rows Derrors#146-Derrors#151 from main. This branch's row becomes Derrors#153 (Derrors#152 goes to the
native floating search bar fix, Derrors#150).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Derrors added a commit to cosinec/iphone-control that referenced this pull request Nov 17, 2026
Bring in Derrors#150: its CHANGELOG line and regression row Derrors#152 come before
this branch's line and row Derrors#153.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Derrors added a commit to cosinec/iphone-control that referenced this pull request Nov 17, 2026
Resolve the conflicts with Derrors#141-Derrors#150: TapElement's dispatch keeps main's
scroll search and this branch's clearing of before_action on a miss;
CHANGELOG lines after main's; this branch's regression row becomes Derrors#154
(Derrors#152 is Derrors#150's, Derrors#153 is Derrors#148's).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Derrors Derrors mentioned this pull request Nov 17, 2026
12 tasks done
@Derrors
Derrors deleted the fix/native-floating-search-cover branch November 18, 2026 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant