Repository navigation
fix(capture-kit): keep react-native dismiss-overlay off app Close and Dismiss buttons - #5013
Conversation
|
Thanks for tackling the Close-button tap. At c760aca, The footer-row signal is also not scoped to the overlay, which likely lets the same wrong tap happen with the expanded inspector open. Could the score become a gate? Candidates would be Dismiss and Close controls on an overlay surface, meaning the inspector footer or an evidence banner. No candidate would lead to the banner coordinate fallback and then to "detected, no safe target". That looks like the same line count and no new contract. It would drop the role, hittable and area ranking over unrelated app buttons, and the footer and surface evidence would become one predicate. Is there a reason to keep the ranking for the Dismiss branch? Not blocking, and fine to take or leave: the new tests never reach the case where the only Dismiss is the app's, which is why the first problem passes the suite. Checks at this head: unit and coverage jobs are green. The Smoke Tests Linux job fails in Not verified here: the PR head was not executed, and the findings above come from reading the code and the PR's own fixtures. The 3/3 base-versus-head device claim rests on the PR-body transcript, and real LogBox and RedBox accessibility shapes (including Android) were taken from the fixtures. Before merge, the Dismiss branch must be gated on overlay evidence and the footer signal scoped to the overlay, with tests for both. After that, please run on the final head with an app Close and an app Dismiss on screen. First, the collapsed banner should give |
…tons dismiss-overlay took any node labelled Close or a close glyph as the overlay's dismiss control and ranked semantic buttons first. An app's own [button] "Close" therefore beat LogBox's [other] "Dismiss" in the expanded inspector and suppressed the collapsed-banner fallback, so the command tapped app UI and then reported that the overlay was still detected. An app's [button] "Dismiss" beat LogBox's footer Dismiss the same way. Overlay evidence now outranks role. A Dismiss that shares its row with LogBox's Minimize or RedBox's Reload/Copy, or sits on an overlay surface, wins over one that does not. A generic close label counts only on an overlay surface: a descendant of, or fully inside, a collapsed warning banner with LogBox evidence, or a non-full-screen node whose own text names LogBox/RedBox. The collapsed-banner coordinate fallback keeps its stricter safety filter.
…erlay Overlay evidence ranked Dismiss and Close candidates but never gated them, and the evidence itself came from app-shaped facts: any Minimize, Reload or Copy in the same row, any node whose text named LogBox, and any control inside a banner's frame although LogBox floats over app content. The only control taken is now the footer Dismiss of LogBox's inspector or of RedBox. Both footers give each control an equal column across one row, so Dismiss and its Minimize, Reload, Copy or Extra Info partners sit centered at an even spacing, and the row meets the surface edges, or stops short by at most a landscape side inset (80 dp). Without a surface, a footer needs three or more columns. The target is Dismiss's column, whether the capture lists the full tile, only its text, or a row it folded the Dismiss tile into (the iOS simulator accessibility capture labels the footer row Dismiss and nests the other tiles inside it, so the row's center is Minimize). Otherwise the collapsed banner is closed at its own affordance, except while the inspector's Dismiss and Minimize share a row, when the banner lies under the inspector. Role, hittable and area no longer rank anything, and the unused 'close' action is gone. Handler fixtures for the inspector and RedBox now carry a surface and an evenly spaced footer; the banner fixtures use a LogBox evidence label.
c760aca to
c3767af
Compare
|
Thanks. Reworked in c3767af, rebased on main.
Your three cases are tests ( On your question: no, I found no reason to keep the ranking, so the gate replaces it. Among nodes labelled Dismiss, one centered in its own column is taken before a folded row, so the ref names the button rather than a wrapper. Known limits: a full-width app bar with exactly these labels in equal columns still reads as a footer, and a RedBox with extra custom buttons falls back to "no safe target". Device runs on
$ agent-device react-native dismiss-overlay --json
{
"success": true,
"data": {
"referenceWidth": 402,
"referenceHeight": 874,
"x": 369,
"y": 813,
"message": "React Native overlay dismiss action sent and verified gone",
"action": "dismiss-overlay",
"overlayAction": "close-collapsed-banner",
"ref": "e37",
"label": "!, agent-device overlay check",
"dismissed": true,
"verified": true,
"verificationRequired": false
}
}
$ agent-device react-native dismiss-overlay --json
{
"success": true,
"data": {
"referenceWidth": 402,
"referenceHeight": 874,
"x": 67,
"y": 833,
"message": "React Native overlay dismiss action sent and verified gone",
"action": "dismiss-overlay",
"overlayAction": "dismiss",
"ref": "e65",
"label": "Dismiss",
"dismissed": true,
"verified": true,
"verificationRequired": false
}
}
$ agent-device react-native dismiss-overlay --json
{
"success": true,
"data": {
"referenceWidth": 874,
"referenceHeight": 402,
"x": 146,
"y": 368,
"message": "React Native overlay dismiss action sent and verified gone",
"action": "dismiss-overlay",
"overlayAction": "dismiss",
"ref": "e42",
"label": "Dismiss",
"dismissed": true,
"verified": true,
"verificationRequired": false
}
}With the base overlay module ( In landscape, the collapsed banner is not detected at base or head. The command's capture puts the banner label on a full-screen |
|
Thanks for the quick follow-up. This PR is ready: both high-priority findings from the earlier review are fixed at c3767af, with tests and live iOS simulator runs. Only the Body rules check is not passing, and it was cancelled rather than failed. It checks the PR body format and this diff does not touch it, so it likely needs a re-run. The other 15 checks pass, and there are no conflicts. Not blocking, and fine to take or leave: footer membership is inferred from geometry (label vocabulary plus equal columns flush with the surface edges), not from overlay ownership, so a full-width app bar with equal columns labelled Dismiss and Copy/Reload/Minimize could match first in capture order (https://github.com/callstack/agent-device/blob/c3767af/packages/capture-kit/src/react-native-overlay.ts#L307). Preferring the last passing footer in capture order would reduce that risk now, and a follow-up issue could derive membership from the LogBox/RedBox container once the capture exposes window or subtree ancestry. Not verified here: execution of the PR head, the author-reported base-failing test count and mutation results, the Android LogBoxDialog/RedBox footer geometry (it rests on synthetic fixtures, so a real Android capture that misses the 2 dp portrait edge check would now return no target), and the real accessibility shapes of LogBox and RedBox. |
Footer membership is read from geometry, so a full-width app bar with equal columns labelled Dismiss and Copy, Reload or Minimize can match. The simulator accessibility capture lists the LogBox and RedBox windows after the app's, so the candidates are now tried from the end of the capture and the real footer wins there. A row is listed before the tiles it holds, so a tile, or its text, is still taken before the row folded around it.
|
|
Thanks for the follow-up. The reorder in 38ae926 keeps the footer gate intact, and it raises no new problems compared with the earlier review (c3767af). All 14 checks pass at 38ae926, and nothing else needs to happen before merge. Not verified here: the PR head was not executed, and this review comes from reading the code and tests. The live iOS simulator runs (collapsed banner, portrait and landscape inspector) were taken at c3767af. In those runs the chosen candidate was the only one passing the gate, so the reorder cannot change those outcomes. The capture-order claims (simulator AX overlay last, XCTest overlay first) are also unverified. If XCTest lists the overlay first, a footer-shaped app bar under the inspector can now win where c3767af picked the real footer. That is the known geometry limit, and main already ranked app controls in that case, so it is not a regression. The follow-up on container-derived membership can close it. The Android LogBoxDialog and RedBox footer geometry rests on synthetic fixtures. |
Summary
react-native dismiss-overlaytreated anyDismiss,Closeor×node as the overlay's control and ranked semantic buttons first, so an app's own[button] "Close"or[button] "Dismiss"beat LogBox's[other] "Dismiss".The only control taken is now the footer Dismiss of LogBox's inspector or of RedBox. Both footers give each control an equal column across one row, so Dismiss and its Minimize, Reload, Copy or Extra Info partners sit centered at an even spacing. The row meets the surface edges, or stops short by at most a landscape side inset (80 dp); without a surface it needs three columns. The tap goes to Dismiss's column, however the capture lists the footer, trying candidates from the capture's end.
Otherwise the collapsed banner is closed at its own affordance, except while the inspector's Dismiss and Minimize share a row. Role, hittable and area no longer rank anything.
Before / after
iPhone 17 Pro simulator (iOS 27.2),
examples/test-apppatched with an app[button] "Close"and[button] "Dismiss"and aconsole.erroron mount. Base runs swap in the base overlay module.Validation
38ae926da,check:affected --run --head,exactCommit: true: format, lint, typecheck, layering, fallow, build and vitest-related pass.c3767afa4;38ae926dapicks the same node and point in those captures.