You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit dbf400b
Browse filesBrowse the repository at this point in the historyBrowse files
fix(ios): hold the back bar still before the tap and surface a hung query
- Read the bar state twice around the button lookup and tap only when the
two reads agree and contain the button's frame, so a push still
animating is not taken for the state a pop changes.
- Compare bar count, identifier, static-text titles, and back buttons.
- Start bar reads only within the 1 s budget, checked before each bar's
snapshot; document what bounds a read in flight.
- Re-record a hung XCTest query as record(_:) requires, send nothing
more: BACK_SWIPE_NOT_DISPATCHED before the tap, BACK_SWIPE_UNVERIFIED
after it.
- Drop the dead outcome guard on the XCTest tap fallback.
- Correct the visionOS back hints; a thrown tap no longer logs a swipe
verification error line.
- Test the two-candidate rule, the skipped read, and hung queries; the
lookup-issue test asserts the swipe path, not a swipe outcome.
- Name the simulator still span in commands.md.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copy file name to clipboardExpand all lines: apple/runner/RUNNER_PROTOCOL.md
+19-9Lines changed: 19 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -137,19 +137,28 @@ than silently applied:
137
137
`backInApp` is the only back command. On iOS the runner first reads the current tree, in the same
138
138
call, for the navigation bar's system back button: a button with the identifier `BackButton` inside a
139
139
navigation bar. It taps that button with a synthesized tap only when exactly one live, hittable
140
-
candidate is found in a readable tree. No other button counts, whatever its label. After the tap it
141
-
reads every navigation bar's identifier and the label and frame of its `BackButton` children, one
142
-
XCTest snapshot per bar, with a 0.05 s pause between reads for up to 1 s. A change from the read
143
-
taken before the tap answers `ok`. No change, or reads that fail, answer `BACK_SWIPE_UNVERIFIED`;
144
-
a delivered tap is never followed by the swipe.
140
+
candidate is found in a readable tree, and two reads in a row of the bar state agree and contain
141
+
that button's frame; each round re-reads the buttons. No other button counts, whatever its label.
142
+
The bar state is every navigation bar's identifier, the labels of its static texts, and the label
143
+
and frame of its `BackButton` children, in bar order, one XCTest snapshot per bar. After the tap it
144
+
reads that state again with a 0.05 s pause between reads. A change from the state read before the
145
+
tap answers `ok`. No change, or reads that fail, answer `BACK_SWIPE_UNVERIFIED`; a delivered tap is
146
+
never followed by the swipe. Before and after the tap, reads start for up to 1 s each, checked
147
+
before each bar's snapshot; a query in flight finishes or ends at XCTest's own query timeout.
148
+
149
+
Every bar read holds its XCTest issues. A held issue means the read proved nothing. A hung query
150
+
("Timed out while evaluating UI query") is recorded again, and no further query follows it: before
151
+
the tap the runner answers `BACK_SWIPE_NOT_DISPATCHED` with nothing sent, and after it
152
+
`BACK_SWIPE_UNVERIFIED`.
145
153
146
154
The runner swipes instead when no tap was sent:
147
155
148
156
- The tree read is skipped: the window resolution marked the tree unreadable, accessibility is
149
157
unavailable, or the XCTest snapshot channel is penalized for the app.
150
158
- The read fails or XCTest rejects one of its queries.
151
159
- No candidate is found, or two or more are (such as a sheet over a stack).
152
-
- The synthesized tap and its XCTest fallback are both refused before anything is sent.
160
+
- The bar state does not hold still within 1 s.
161
+
- The synthesized tap is refused before anything is sent.
153
162
154
163
A tap whose outcome is unknown after it may have been sent throws, and neither the bar check nor
155
164
the swipe follows. The swipe verifies a change of the app's screen. When XCTest cannot resolve the
@@ -159,9 +168,9 @@ fills its screen; otherwise it refuses with `APP_SCREEN_UNRESOLVED`. Its failure
159
168
| Code | When | Sent |
160
169
| --- | --- | --- |
161
170
|`APP_SCREEN_WINDOW_UNRESOLVED`, `APP_SCREEN_UNRESOLVED`, `APP_SCREEN_CAPTURE_UNRENDERABLE`, `APP_SCREEN_OFF_LIT_PANEL`| The screen could not be sampled before the swipe. | Nothing |
162
-
|`BACK_SWIPE_NOT_DISPATCHED`| The swipe was refused before any touch went down, or the platform has no back gesture (visionOS; the daemon refuses it first). | Nothing |
171
+
|`BACK_SWIPE_NOT_DISPATCHED`| The swipe was refused before any touch went down, an XCTest query on the navigation bar hung before the tap, or the platform has no back command (visionOS; the daemon refuses it first). | Nothing |
163
172
|`BACK_SWIPE_NO_CHANGE`| The swipe was sent and the sampled grid (48×96 grayscale cells, with the top 7 rows always left out; in portrait they hold the status bar and Dynamic Island, and in landscape the iPhone status bar is hidden and the Dynamic Island sits at a side edge, outside those rows) changed in at most 1% of the remaining cells by more than 24 of 256 levels. | The swipe |
164
-
|`BACK_SWIPE_UNVERIFIED`| The swipe may have run, or the back button was tapped and the bar did not change within 1 s; the outcome is unknown. | Possibly the swipe, or the tap |
173
+
|`BACK_SWIPE_UNVERIFIED`| The swipe may have run, or the back button was tapped and the bar did not change within 1 s or a query on it hung; the outcome is unknown. | Possibly the swipe, or the tap |
165
174
166
175
The swipe is first resolved up to its contact. Then the settle window is a run of samples, with a
167
176
0.05 s pause between captures plus each capture's own time, that agree for as long as the gap the swipe will be credited across: a contact
@@ -190,7 +199,8 @@ window can still be misread as a back navigation; any finite window has that lim
190
199
191
200
Each iOS back whose window context resolved logs one `AGENT_DEVICE_RUNNER_BACK_NAVIGATION_BAR_BUTTON`
192
201
line on every exit of the button path, a thrown tap included, with `found` (`skipped`,
193
-
`unreadable`, `no`, `ambiguous`, or `yes`), `pressed`, `confirmed`, `lookupMs` (`0` when the read was
0 commit comments