fix(mobile): keep iPad page headers clear of the window controls (#38635)

* fix(mobile): keep iPad page headers clear of the window controls

The reserved-regions probe reported the window's plain safe area, which on
iPadOS 26+ windowed mode does not cover the window controls. On iOS 27.1+
pages take their top inset from that value, so the host header sat under the
controls while native screens, which get the corner-adapted inset, cleared
them.

* fix(mobile): only raise the page's top inset for window controls
This commit is contained in:
Kelvin Amoaba
2026-11-05 19:35:07 +00:00
committed by GitHub
parent 87631616a8
commit 818fb8d683
@@ -103,12 +103,16 @@ public class OrcaReservedRegionsModule: Module {
.intersection(window.bounds)
keyboardInset = overlap.isNull ? 0 : overlap.height
}
// Same top as the root's (OrcaWindowControlsInset), so pages clear iPad window controls too.
var safeAreaInsets = window.safeAreaInsets
safeAreaInsets.top = max(
safeAreaInsets.top, window.edgeInsets(for: .safeArea(cornerAdaptation: .vertical)).top)
let snapshot = ReservedRegionsSnapshot(
divisions: window.reservedRegions(kind: .division).map(\.frame),
hasFoldDivision: !window.reservedRegions(kind: .division, options: .includeInactive).isEmpty,
occlusions: window.reservedRegions(kind: .occlusion).map(\.frame),
windowBounds: window.bounds,
windowSafeAreaInsets: window.safeAreaInsets,
windowSafeAreaInsets: safeAreaInsets,
keyboardInset: keyboardInset
)
// The first layout always reports, so a listener starts from the real state.