fix(capture-kit): ignore nested empty floating-bar containers in sheet occlusion

KH
4d ago
+329-4

Summary

Fixes #5240. On iOS 27, a presented sheet hosting nested UINavigationControllers emits an inner empty _UIFloatingBarContainerView before the outer sheet's _UIFloatingBarContainerView, which broke the own-presentation sibling walk and marked sheet inputs covered.

  • packages/capture-kit/src/snapshot-occlusion.ts: ignore nested empty _UIFloatingBarContainerView nodes as presentation boundaries for an enclosing outer floating-bar host (isNestedEmptyFloatingBarContainer, isNestedInLaterFloatingBarPresentation), while keeping real obstructing UIToolbar controls covered.
  • packages/capture-kit/src/snapshot-occlusion-ios27-system-toolbars.test.ts: added regression tests for nested sheet floating-bar containers and obstructing toolbars.

Before / after

  • Before: fill on a TextInput inside a sheet with nested navigation controllers fails with covered by another visible element (Toolbar).
  • After: the sheet input is not marked covered by the nested empty _UIFloatingBarContainerView; real obstructing toolbars still block interaction.

Validation

Tested at ea5417de11 on 59a640c08d:

  • vitest run --project unit-core on snapshot-occlusion, snapshot-occlusion-ios27-system-toolbars, snapshot-occlusion-sibling-sized-chrome: 3 files, 85 tests passed.
  • tsc -b tsconfig.typecheck.json examples/sdk/tsconfig.json: passed.
  • oxlint . --deny-warnings and oxfmt --check: passed.

CI obligations: unit-core and Apple smoke lanes. Risks: none known.