fix(ios): keep a sheet's toolbar host off its own controls

Merged
JS
4d ago
+304-23

Summary

On iOS 26/27, press, click and fill refuse every control inside a sheet that keeps the screen beneath it in the capture, such as an undimmed sheet, as covered by the sheet-framed Toolbar host. #3162's exemption assumes iOS drops what sits beneath a sheet, true of SwiftUI sheets. Here the host also encloses the presenting screen, so it covers its own sheet.

Such a host now covers the presentation beneath it, including tab bars listed after the presenting host, but not its own sheet's controls, even with no bar or scroll view.

3 files. No linked issue.

Validation

Base f7879cf2d; head 67e7ca480 only rewords the changeset after 0bb0b8df2.

  • vitest run packages/capture-kit/src/snapshot-occlusion: 66 passed; six of them fail at base.
  • check:affected --run --head 0bb0b8df2: all eight checks passed. At 67e7ca480, only daemon-client-startup-race.test.ts fails; it fails 3 of 5 solo runs on base, and no issue tracks it.
  • iOS 27.0 simulator at 0bb0b8df2, test app with a local formSheet (sheetAllowedDetents: [1], sheetLargestUndimmedDetentIndex: 'last') not in this PR:
SheetBaseHead
Header and scroll viewfill, Continue, Close covered by "Toolbar" at (0, 62 402x812)Filled 8 chars; Continue and Close tapped
No header, plain viewSame refusalsSame results

Risks (hand-built shapes, noted in code): a host enclosing nothing still covers its sheet; an opaque toolbar enclosing only an earlier bar reads as a host.

CI: device lanes run on GitHub.

Disclosure: the fix, tests and this description were written with Claude Code.