fix(ios): place a matched alert window in the box it sits in

Merged
TH
1mo ago
+57-3

Summary

Follow-up to #4001. That PR merged one commit before this fix.

In #4001, alertSnapshots checked every window against its own frame. A dismiss-popup candidate is itself a window, so any marked window counted as on screen, even an off-screen one. The base code rejected those.

Now a window is checked against the box it sits in, and it is the box only for what it hosts. SpringBoard alerts still use the window that hosts them, so the foldable fix from #4001 is unchanged.

Also adds three tests:

  • an off-screen dismiss-popup window is rejected; this fails on main and passes here;
  • an alert on the inner panel, inside a 466Ɨ678 application frame, is placed in its 951Ɨ669 window;
  • the tap is refused when the alert's host window can no longer be read. This covers #4001's code; this PR doesn't change it.

Validation

  • pnpm check:affected --run --head f3b09b4748: passed.
  • On the iPhone 17 Pro sim, the alert/modal runner unit tests pass, including the two new tests.

šŸ¤– Generated with Claude Code