iOS: size status-bar tap proxy to real safe-area inset (#4978)#4981
Merged
Conversation
The previous fix for #3589 mounted CN1StatusBarTapProxyView at the UIWindow level with frame height clamped to max(safeAreaInsets.top, 44) in [20, 80]pt. On iPhones without a notch (safeAreaInsets.top = 20pt) the proxy ended up 44pt tall while CN1's Toolbar StatusBar Container sits at ~20pt, so a 20-44pt window-level touch sink swallowed taps on toolbar content positioned right below the StatusBar -- buttons were only reachable at the very bottom of the toolbar. Use safeAreaInsets.top directly (falling back to UIApplication statusBarFrame.size.height pre-iOS 11). Keep a 1pt floor so iOS still routes UIStatusBarTapAction when the bar is hidden, and the existing 80pt cap for unusual device modes. Refresh the frame from viewSafeAreaInsetsDidChange so rotations / split view / show-hide status-bar transitions stay aligned. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
Collaborator
Author
|
Compared 110 screenshots: 110 matched. Benchmark Results
Build and Run Timing
Detailed Performance Metrics
|
Collaborator
Author
|
Compared 110 screenshots: 110 matched. Benchmark Results
Build and Run Timing
Detailed Performance Metrics
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CN1StatusBarTapProxyViewframe tomax(safeAreaInsets.top, 44)pt. OniPhones without a notch (
safeAreaInsets.top = 20pt) that left a 44ptwindow-level
UIScrollViewswallowing taps in the 20–44pt strip — rightwhere Toolbar content sits below CN1's StatusBar Container, so toolbar
buttons were only reachable at the bottom of the toolbar.
safeAreaInsets.topdirectly (withUIApplication.statusBarFramefallback for pre-iOS 11). 1pt floor keeps iOS routing
UIStatusBarTapActionwhen the bar is hidden, 80pt cap is preserved.viewSafeAreaInsetsDidChangeso rotation,split view, and status-bar show/hide transitions stay aligned with CN1's
StatusBar.
iPhone X+ behaviour is unchanged (
safeAreaInsets.top≈ 47/59 pt alreadymatched the proxy).
Test plan
Dtest.javareproducer: tapping thebuttons in the custom toolbar at the visually rendered position now
registers on a no-notch iPhone (e.g. iPhone SE / 8).
gesture) still triggers
cn1FireStatusBarTapand scrolls the form.status-bar strip (no spurious taps lost or intercepted after rotation).
hellocodenameone/ Metal CI remainbyte-identical (proxy lives at window level, outside
self.view).🤖 Generated with Claude Code