fix(capture-kit): keep react-native dismiss-overlay off app Close and Dismiss buttons

Merged
IM
5d ago
+874-87

Summary

react-native dismiss-overlay treated any Dismiss, Close or × 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-app patched with an app [button] "Close" and [button] "Dismiss" and a console.error on mount. Base runs swap in the base overlay module.

$ react-native dismiss-overlay --json   # portrait, collapsed banner
base aecafaf30: overlayAction "close" on the app's Close (55, 253), verified false
head c3767afa4: overlayAction "close-collapsed-banner" (369, 813), verified true

$ react-native dismiss-overlay --json   # portrait, inspector opened from the banner
base aecafaf30: overlayAction "close" on the app's Close (55, 253), verified false
head c3767afa4: overlayAction "dismiss" in the footer's Dismiss column (67, 833), verified true

$ react-native dismiss-overlay --json   # landscape, inspector opened from the banner
base aecafaf30: overlayAction "close" on the app's Close (94, 144), verified false
head c3767afa4: overlayAction "dismiss" in the footer's Dismiss column (146, 368), verified true

Validation

  • Head 38ae926da, check:affected --run --head, exactCommit: true: format, lint, typecheck, layering, fallow, build and vitest-related pass.
  • Device runs at c3767afa4; 38ae926da picks the same node and point in those captures.
  • 33 new unit tests, 32 failing at base. Five handler fixtures gain a surface and an evenly spaced footer; four banner fixtures close at the banner's affordance.
  • 38 mutants on the new guards each fail a test; two more are equivalent.